Conversation
added 3 commits
September 23, 2026 08:53
_pt_arc takes sqrt(l**2 - r**2), which has no real value when the point is inside the circle and degenerates to the point itself when it is on it: a line end inside a circle, or a circle inside a bigger one, raised ValueError; a line end on the circle produced an empty segment. Such an entity cannot touch the hull beyond the circle, so it is not a candidate - report it the way get_angle already reports an entity against itself. Partially addresses CadQuery#1190 and CadQuery#1224.
A circle with every other entity inside it is its own hull, but the march raised "Hull could not be closed". The lone-circle shortcut was one instance of this and is folded in.
Two arcs on the same circle became two entities: arc_arc divided by the distance between their centres, and since the march closes on identity it could come back to the other one and fail to close. The merged bounds only steer select_lowest_arc; every tangent takes the full circle. Fixes CadQuery#1888. Partially addresses CadQuery#943 and CadQuery#1224.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2100 +/- ##
=======================================
Coverage 95.80% 95.81%
=======================================
Files 30 30
Lines 9589 9596 +7
Branches 1439 1441 +2
=======================================
+ Hits 9187 9194 +7
Misses 247 247
Partials 155 155 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
This PR hardens hull() against degenerate input - nested geometry, circles split at the seam by a fuse.
The direction is a hull for valid input and a clear error for the rest, not a crash.
Each fix sits where the algorithm assumed general position.
Arcs on one circle are matched exactly, so #1224 is only partly addressed for the moment.
Follows of #2096.
Fixes #1888. Partially addresses #943 and #1224.
This one is the first of three in a hull fix PR series, and the base for the other two.
The march (hulls on ordinary input) and the arc related rework are expected to follow.