-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add Euler spiral curve representation #169
base: main
Are you sure you want to change the base?
Conversation
Checkpoint of experiment work
Adds derivatives and curvature.
Generate Euler spirals from cubics.
Iterate from Euler spirals to cubics, with an error tolerance.
Provide accuracy (with verified error bounds).
Add benchmarks and refine error estimation (the powf was potentially expensive).
Rename "FitEulerResult" to "EulerParams".
Also make them easier to find and improve docs a bit.
A pretty good implementation of parallel curves, including handling the cusp, and applying the closed-form error metric for subdivision.
This commit captures the source code for the illustrations in the parallel curve blog post.
@raphlinus is this ready? going to do a piet release soon, might as well get whatever outstanding kurbo work merged as makes sense. |
I don't think we should block a piet release on it. I want to make some tweaks to the API (take an accuracy parameter pretty much everywhere), put the euler stuff into an euler namespace instead of top level, and make sure things are labeled as experimental. I'm also increasingly unsure about the "euler" feature - it feels like there should be an "advanced" or "full" feature that would encompass this, #174, and other future stuff along similar lines. I can get this ready but it would be tomorrow. |
no stress, I'm not going to get the release done today, although we're not too far off. |
This commit adds support for piecewise Euler spirals, gated under the
euler
feature. A primary goal is to support parallel curves, as described in raphlinus/raphlinus.github.io#46.There are some rough edges, and there's not an end-to-end parallel curve yet, but it's progress. Here's what's currently implemented:
EulerSeg
curve, along with someParamCurve
traits.CubicBez
to an iterator of Euler spiral segmentsHere's what's missing:
ParamCurveNearest
andParamCurveExtrema
onEulerSeg
EulerPath
including theShape
traitIt's slightly unclear that we'll even develop
EulerPath
at this point. It's possible to exercise the main parallel curve flow by composing iterators, and ending up with aBezPath
. Possibly that should be taken out of this PR and added later if/when needed.