Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 of 17 tasks
bmoren opened this issue Dec 1, 2018 · 9 comments
Closed
4 of 17 tasks

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

bmoren opened this issue Dec 1, 2018 · 9 comments

Comments

@bmoren
Copy link
Contributor

bmoren commented Dec 1, 2018

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

@bmoren
Copy link
Contributor Author

bmoren commented Dec 1, 2018

screen shot 2018-12-01 at 5 17 49 pm

@Spongman
Copy link
Contributor

Spongman commented Dec 1, 2018

My expectation would be to close the shape with a curved vertex similar to all the others.

@bmoren
Copy link
Contributor Author

bmoren commented Dec 2, 2018

here's a better one with a fill for reference:
screen shot 2018-12-01 at 8 38 20 pm

oh, and the code used to generate these images, is slightly different from the example. That is a much more simplified version for testing. The idea is the same.

@Niels-NTG
Copy link
Contributor

I don't think this issue can be closed yet. While the issue of shapes constructed with curved vertexes is not being closed when using endShape(CLOSE) is resolved, it closes it using a straight line as if the shape begun and ended with a normal vertex. This issue should be reopened until this is resolved. I for one would really like to see this working.

@ItsWasteD
Copy link

I think this bug doesn't only exist in P5.js but also in the normal Processing. For me it happened when trying to create a circle shaped audio visualizer and the first and last point were connected with a straight line instead of a curve.

Processing Version: 3.5.3

@alsino
Copy link

alsino commented Apr 30, 2019

I have the same problem and the closing of the curved vertices close with a straight line. This is not optimal I think. Is there maybe any progress already made on a solution for this or can you give a pointer to how this could be implemented?

@yanngraf
Copy link

yanngraf commented Sep 4, 2019

I'm experience the same problem as @alsino

In this sketch where I'm using CurvedVertex, the expected outcome (if the shape is closed) is that all spikes would have the same shape.

https://editor.p5js.org/yanngraf/sketches/Zbp6C8XBp

It is not the case, the start/end point is spiky.

@andras-gyarmati
Copy link

@yanngraf as a workaround you can repeat the starting vertices to achieve the expected behavior: https://editor.p5js.org/brianelete/sketches/-ujBjhRU3

@limzykenneth limzykenneth moved this to Proposal in p5.js 2.0 May 28, 2024
@davepagurek davepagurek moved this from Proposal to Out of Scope in p5.js 2.0 Jun 4, 2024
@davepagurek davepagurek moved this from Out of Scope to Proposal in p5.js 2.0 Jun 4, 2024
@davepagurek davepagurek self-assigned this Jun 18, 2024
@Qianqianye Qianqianye moved this from Proposal to Implementation in p5.js 2.0 Sep 17, 2024
@Garima3110 Garima3110 self-assigned this Oct 31, 2024
@davepagurek
Copy link
Contributor

This is now resolved in 2.0 after #7373!

@github-project-automation github-project-automation bot moved this from Implementation to Completed in p5.js 2.0 Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

No branches or pull requests

10 participants