-
Notifications
You must be signed in to change notification settings - Fork 22
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
Simplifying Bézier paths #95
Conversation
First draft of new blog post. Closes #94
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.
Nice article!
|
||
Two implementations are provided: parallel curves of cubic Béziers, and arbitrary Bézier paths for simplification. Implementing the trait is not very difficult, so it should be possible to add more source curves and transformations, taking advantage of powerful, general mechanisms to compute an optimized Bézier path. | ||
|
||
The core cubic Bézier fitting algorithm is based on measuring the area and moment of the source code. A default implementation is provided by the `ParamCurveFit` trait implementing numerical integration based on derivatives (Green's theorem), but if there's a better way to compute area and moment, source curves can provide their own implementation. |
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.
The core cubic Bézier fitting algorithm is based on measuring the area and moment of the source code. A default implementation is provided by the `ParamCurveFit` trait implementing numerical integration based on derivatives (Green's theorem), but if there's a better way to compute area and moment, source curves can provide their own implementation. | |
The core cubic Bézier fitting algorithm is based on measuring the area and moment of the source curve. A default implementation is provided by the `ParamCurveFit` trait implementing numerical integration based on derivatives (Green's theorem), but if there's a better way to compute area and moment, source curves can provide their own implementation. |
|
||
![Arc length parametrization is much more accurate](/assets/simplify-arc.svg) | ||
|
||
However, arc length parametrization is considerably slower (about a factor of 10) because it requires inverse arc length computations. The current approach is to classify whether the source curve is "spicy" (considering the deltas between successive normal angles) and use the more robust computation only in those cases. |
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.
However, arc length parametrization is considerably slower (about a factor of 10) because it requires inverse arc length computations. The current approach is to classify whether the source curve is "spicy" (considering the deltas between successive normal angles) and use the more robust computation only in those cases. | |
However, arc length parametrization is considerably slower (about a factor of 10) because it requires inverse arc length computations. My current approach is to classify whether the source curve is "spicy" (considering the deltas between successive normal angles) and use the more robust computation only in those cases. |
It wasn't clear to me what is actually implemented now.
First draft of new blog post.
Closes #94