-
Notifications
You must be signed in to change notification settings - Fork 181
Don't manually flatten curves for which the control points are strictly within the tolerance threshold #1214
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
Conversation
…ly within the tolerance threshold
|
I've suggested two tighter (and cheaper to compute) bounds that I believe to be correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to merge this and open the further improvements as a separate PR, perhaps having more eyes on that math would be good.
Co-authored-by: Tom Churchman <[email protected]>
|
Nice! Yes I also figured that there probably is a way to generate an even tighter bbox, but lacked the maths skills to figure it out. 😄 |
|
Really impressive, this gives yet another pretty significant speed boost on top of what was initially introduced in this PR! |
|
Not bad at all! |
This is a branchless calculation of a point-onto-line-segment projection. Also marks the method `#[inline]`. I started looking at this because of the math we introduced in linebender/vello#1214. This might allow us to introduce some tighter bounds there without introducing additional branching. This should be useful here regardless of whether the above happens.
|
I've opened linebender/kurbo#505, which may allow us to introduce tighter bounds. The idea would be to test whether the control points are very close to their projection onto the chord/line segment defined by the Bezier end points, rather than just close to the end points. Edit: see #1216. |
This is a branchless calculation of a point-onto-line-segment projection. Also marks the method `#[inline]`. I started looking at this because of the math we introduced in linebender/vello#1214. This might allow us to introduce some tighter bounds there without introducing additional branching. This should be useful here regardless of whether the above happens.
This is a branchless calculation of a point-onto-line-segment projection. Also marks the method `#[inline]` and adds some testing. I started looking at this because of the math we introduced in linebender/vello#1214. This might allow us to introduce some tighter bounds there without introducing additional branching. This should be useful here regardless of whether the above happens. --------- Co-authored-by: jneem <[email protected]>
This is a branchless calculation of a point-onto-line-segment projection. Also marks the method `#[inline]` and adds some testing. I started looking at this because of the math we introduced in linebender/vello#1214. This might allow us to introduce some tighter bounds there without introducing additional branching. This should be useful here regardless of whether the above happens. --------- Co-authored-by: jneem <[email protected]>



A revival from an older PR. Confirmed to give a decent speed boost for 8x8 and 16x16 shapes.