Remove duplicate curve vertex #3496

Merged
merged 1 commit into from Jul 20, 2015

Conversation

Projects
None yet
3 participants
@JakubValtar
Contributor

JakubValtar commented Jul 20, 2015

Fixes #2937

codeanticode added a commit that referenced this pull request Jul 20, 2015

@codeanticode codeanticode merged commit 368d6fe into processing:master Jul 20, 2015

@JakubValtar JakubValtar deleted the JakubValtar:bugfix-curve-tightness branch Jul 20, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 27, 2015

Member

So this is the sort of thing you need to special case so that you can close curves properly. It's not enough to just ignore the last vertex—you need it there as an indication that the curve should close—but the GL renderer needs to take it into account (internally) and not double up the point to cause the problems seen in #2937.

Member

benfry commented Jul 27, 2015

So this is the sort of thing you need to special case so that you can close curves properly. It's not enough to just ignore the last vertex—you need it there as an indication that the curve should close—but the GL renderer needs to take it into account (internally) and not double up the point to cause the problems seen in #2937.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Jul 27, 2015

Contributor

There is currently no way to make a loop which does not have stroke caps, just stroke joints. If you call endShape(CLOSE), the loop is indeed closed, but you get straight line between last vertex and the first vertex.

Contributor

JakubValtar commented Jul 27, 2015

There is currently no way to make a loop which does not have stroke caps, just stroke joints. If you call endShape(CLOSE), the loop is indeed closed, but you get straight line between last vertex and the first vertex.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Jul 27, 2015

Contributor

If the first and the last vertex happen to be at the same position, stroke starts to glitch.

Contributor

JakubValtar commented Jul 27, 2015

If the first and the last vertex happen to be at the same position, stroke starts to glitch.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 27, 2015

Member

That's what I'm saying: when the first and last are the same position, the renderer needs to special case that situation to have it properly close and not glitch. Internally it'll need to skip the last point to avoid the glitches, but from a user's point of view (and the API's point of view), the line should behave as if it's closed.

Member

benfry commented Jul 27, 2015

That's what I'm saying: when the first and last are the same position, the renderer needs to special case that situation to have it properly close and not glitch. Internally it'll need to skip the last point to avoid the glitches, but from a user's point of view (and the API's point of view), the line should behave as if it's closed.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Jul 27, 2015

Contributor

However, when you draw just vertices (straight lines) you don't draw the first one again at the end, endShape(CLOSE) will connect them. When you draw curves though, you want to draw the last one because there are multiple ways how the curve can go. Is this inconsistency something we can live with, or are we going to change how the simple lines work too?

Also, @codeanticode pointed out that when you want to smoothly close curve you need to repeat first three curve vertices again at the end and that we could provide some means to close it easily since we already have all the curve vertices. In theory you just need to supply a bunch of ordered vertices which the curve should go through and we can automatically make a curve loop out of that.

Contributor

JakubValtar commented Jul 27, 2015

However, when you draw just vertices (straight lines) you don't draw the first one again at the end, endShape(CLOSE) will connect them. When you draw curves though, you want to draw the last one because there are multiple ways how the curve can go. Is this inconsistency something we can live with, or are we going to change how the simple lines work too?

Also, @codeanticode pointed out that when you want to smoothly close curve you need to repeat first three curve vertices again at the end and that we could provide some means to close it easily since we already have all the curve vertices. In theory you just need to supply a bunch of ordered vertices which the curve should go through and we can automatically make a curve loop out of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment