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

Visualization of lowering cubic Beziers to arcs #106

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

raphlinus
Copy link
Owner

Use the same technique as Vello stroke expansion to get Béziers to Euler spirals, but then subdivide to arcs.

Will probably be combined with #100 as a multifunction interactive diagram, but I wanted to get something quick and dirty up

This contains a prototype of Euler spiral based offset and flatten, and will become an interactive figure in the corresponding blog post.
WIP, points to pre-merge commit.

Also put NONE back on the group.
Apply robustness logic borrowed from main Vello dev: switch to derivatives, tweak derivatives to be nonzero, etc.

Also improve drawing of the Euler spiral in the 180 degree U-turn case; it was drawn as a single cubic segment which is fine for small angle deviations, but makes a colinear case. This drawing is very hacky but is sufficient for visual display.
Implement idea of converting Euler spirals to arcs using simple error metric. Visualize arcs in red, original curve in black.
Working drawing of parallel curves with good error. Missing cusp handling though.
Fix error underestimate for near-cusps.
More careful error measurement (making sure to match up arc length parameterization) lets us tighten the error bound for handling cusps.
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 this pull request may close these issues.

None yet

1 participant