-
Notifications
You must be signed in to change notification settings - Fork 26
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 a curve? #67
Comments
@mbutterick what I believe is going on here is that in the the second image the tangent lines / derivatives match, but I think what you want is to scale those tangent lines so that the curvatures match at the endpoints. The curvature is given by the first and second derivatives
https://en.wikipedia.org/wiki/Curvature#Curvature_from_arc_and_chord_length BezierKit doesn't have explicit support for this, and only has support for getting the first derivative. The second derivative for a cubic curve is linear, which can be obtained by taking the difference between the control points twice. Something like this
A simpler approach that may work well enough would be to scale the length of the tangent lines by the ratio of the length of the new vs old curves. That way if the new curve is larger as in your example, it would get longer tangent lines. You could do that by comparing |
|
Suppose I delete the marked point on the glyph below. Currently I get the glyph in the second pic, which is not wrong. But it would be more useful to get something closer to the glyph in the third pic (where the remaining Bézier handles have been adjusted to approximate the curve that existed before.).
The question: is there a way to accomplish this in BezierKit? I’m not sure how to characterize this operation. I suppose it would be a sort of curve simplification, where the remaining BCPs are adjusted to produce the curve that’s the closest fit to the one that was there before.
The text was updated successfully, but these errors were encountered: