Skip to content

endShape(CLOSE) won't treat the beginning point like a join #3430

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

Closed
3 of 17 tasks
escape0707 opened this issue Dec 29, 2018 · 3 comments · Fixed by #3433
Closed
3 of 17 tasks

endShape(CLOSE) won't treat the beginning point like a join #3430

escape0707 opened this issue Dec 29, 2018 · 3 comments · Fixed by #3433

Comments

@escape0707
Copy link

escape0707 commented Dec 29, 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: v0.7.2 (September 02, 2018)
  • Web browser and version: Firefox 64.0 (20181206201918)
  • Operating System: Windows 10 Pro 1809 (OS Build 17763.195)

Steps to reproduce this:

I first found this strange behavior during completing my course assignment and now confirmed when playing around with p5.gui's example - quicksettings-1.
image
Notice how the top/beginning point is rendered like a strokeCap(ROUND) rather than a strokeJoin(MITER).

Code:
beginShape();
for(var i = 0; i < 2 * n; i++) {
	var d = (i % 2 === 1) ? d1 : d2;
	var angle = PI / n * i;
	var px = x + sin(angle) * d / 2;
	var py = y - cos(angle) * d / 2;
	vertex(px, py);
}
endShape(CLOSE);

Is this by design?
Reference to original issue which didn't get replied from p5.gui's developer.

Feature enhancement details:

Maybe make the begin and end point rendered just like a join point, or simply demonstrate that this is by design in the documents?

@lmccart
Copy link
Member

lmccart commented Dec 29, 2018

is this the same issue being described here: #3352?

@escape0707
Copy link
Author

is this the same issue being described here: #3352?

I've seen that issue. I think mine is different.
In this issue I'm talking about the line's "Cap" shape is not intended but my line did close.
In his issue he's talking about the line won't even close.

@lmccart
Copy link
Member

lmccart commented Dec 29, 2018

I see, thank you for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants