Skip to content

Conversation

@atta-ullah01
Copy link
Contributor

Summary of Changes

_intersect() skipped parameter-range checks for self-intersection points, incorrectly assuming that any point valid on the supporting Bézier curve was also valid for every derived x-monotone subcurve.

For looping curves, that assumption fails: a self-intersection point may lie outside the parameter range of the specific subcurve being processed. These invalid points were being passed to downstream solvers, triggering assertion failures (e.g., roots.size() == 1).

This commit forces parameter range verification via _is_in_range() for all intersection points, including those produced by self-intersections.

Release Management

_intersect() skipped parameter-range checks for self-intersection
points, incorrectly assuming that any point valid on the supporting
Bézier curve was also valid for every derived x-monotone subcurve.

For looping curves, that assumption fails: a self-intersection point
may lie outside the parameter range of the specific subcurve being
processed. These invalid points were being passed to downstream
solvers, triggering assertion failures (e.g., roots.size() == 1).

This commit forces parameter range verification via _is_in_range()
for all intersection points, including those produced by
self-intersections.
@atta-ullah01 atta-ullah01 changed the title Fix crash when inserting Bézier curves that loop back in x Fix assertion failure in Bézier curve intersection handling Jan 1, 2026
@afabri afabri requested a review from efifogel January 4, 2026 17:00
@efifogel
Copy link
Member

efifogel commented Jan 5, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants