p5.js
p5.js copied to clipboard
curveVertex() with endshape(CLOSE) does not close with a curve
Nature of issue?
- [x] Found a bug
- [ ] Existing feature enhancement
- [x] New feature request
Most appropriate sub-area of p5.js?
- [ ] Color
- [x] Core/Environment/Rendering
- [ ] Data
- [ ] Events
- [ ] Image
- [ ] IO
- [ ] Math
- [ ] Typography
- [ ] Utilities
- [ ] WebGL
- [ ] Other (specify if possible)
Which platform were you using when you encountered this?
- [ ] Mobile/Tablet (touch devices)
- [x] Desktop/Laptop
- [ ] Others (specify if possible)
Details about the bug:
- p5.js version: 0.7.2
- Web browser and version: Firefox: Version 62.0
- Operating System: MacOSX
- Steps to reproduce this:
function draw() {
curvyPolygon(6, 100,100, 50)
}
function curvyPolygon( n, xPOS, yPOS, r) {
let angle = 360.0 / n;
beginShape();
for (let i = 0; i < n; i++) {
curveVertex(xPOS + r * cos(radians(angle * i)),
yPOS + r * sin(radians(angle * i)));
}
endShape(CLOSE);
}
When utilizing curveVertex() with endshape(CLOSE), the behavior is to draw a straight line to the close the shape. My expected behavior would be to have a curve complete the shape. Does anyone else feel this way? is this something that should be addressed? This has also been mentioned in #408