forked from linebender/kurbo
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merge @raphlinus's upstream offset experiment for MFEK project testing/early alpha/beta use #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Following Orellana and de Michele 2020. WIP
Add a suite of tests from the paper. Also some cleanup (getting rid of println).
Use abs and copysign rather than an abs to make the trig case give the highest-value root. This is probably a minor improvement, and makes the code slightly less true to the paper.
May be messy.
Strengthen the cubic fit logic, including better error measuring, and start cusp finding. However, it doesn't fully solve the parallel curve problem yet, and I have some refactoring in mind.
This commit gets a new `ParamCurveFit` trait in place, and uses it to compute offsets, but it is not breaking at cusps (which seems to be necessary, fitting through a cusp produces artifacts). Also needs some cleanup.
Use ITP method to find cusps. The logic probably doesn't handle double and higher multiplicity cusps. Also arguably we should search for double cusps, but this is likely a fairly subtle improvement.
Also significant cleanup of `CurveOffset`, as a lot of that has moved into the fit module.
Mostly small changes to CubicOffset.
This computes an optimized fit (minimum number of segments, minimum error given that number), but without handling cusps. Also includes an example that plots a quartic polynomial.
Make the ParamCurveFit trait return the raw integrals, for refinement into moments in the curve fitting logic. This is easier and more efficient for new curves, and also facilitates more efficient and robust downstream processing.
The moment_integrals function is probably correct but likely can be optimized.
Implementation of SimplifyBezPath including ParamCurveFit. This also fixes some issues with the trait and fit implementation. Also a bit of cleanup, comment fixes, and micro-optimization.
This was referenced Dec 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is one for one with linebender#230 as of 2022-12-30.