Skip to content

curveVertex() with endshape(CLOSE) does not close with a curve #3352

Closed
@bmoren

Description

@bmoren

Nature of issue?

  • Found a bug
  • Existing feature enhancement
  • New feature request

Most appropriate sub-area of p5.js?

  • Color
  • 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)
  • 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

Metadata

Metadata

Type

No type

Projects

Status

Completed

Relationships

None yet

Development

No branches or pull requests

Issue actions