cubic_to_quadratic: better handle edge cases when cubic degenerates to a line or single point - #485
Merged
Conversation
…o a line or point Fixes #484 intended to match fonttools/fonttools#3904 Note the above fonttools PR only handles 3 to 4 consecutive cubic control points, whereas in here I also consider intersections when a point is collinear and lies in between the other two.
anthrotype
force-pushed
the
cu2qu-degenerate-cubics
branch
from
August 18, 2025 14:56
8e87a17 to
1968edf
Compare
no need to handle other degenerate collinear points
anthrotype
force-pushed
the
cu2qu-degenerate-cubics
branch
from
August 18, 2025 17:30
77ca97c to
d3376d2
Compare
Just want to point out that in fonttools we updated the |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Sep 1, 2025
just realised I didn't update the CHANGELOG.md after #485
This file contains hidden or 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
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.
Fixes #484
This is intended to match fonttools/fonttools#3904
In addition to the above fonttools PR which only handles 3 to 4 consecutive cubic control points, in here I also consider intersections when a point is collinear and lies in between the endpoints of the other line.I think this is a logical consequence if we agree that when there are 3 consecutive equal points at the front/back of cubic bezier then there's an intersection at the common (start/end) point.
kurbo's.try_approx_quadraticusesLine::crossing_pointmethod, so I modified that one to behave like that