Skip to content

(2/3) Fix wrong hulls on ordinary input - #2109

Open
kimstik wants to merge 3 commits into
CadQuery:masterfrom
kimstik:hull_test23
Open

kimstik wants to merge 3 commits into
CadQuery:masterfrom
kimstik:hull_test23

Conversation

@kimstik

@kimstik kimstik commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

This PR fixes hull() returning wrong hulls on ordinary input - roughly one random circle-and-line set in four.
The march picked its supporting tangent by comparing wrapped angles and stopped on the first return to the start.
Both are heuristics that fail on valid input, and both are replaced by the condition they stood for.
The hull wire is now assembled in the order of the march, so a face built on it points the right way.

Follows #2100.

Fixes #931. Fixes #1891.

This one is the second of three in a hull fix PR series. The arc related rework is expected to follow.

pt_arc and arc_pt chose between the two tangency points by comparing
angles already wrapped into [0, 2pi), which picks the wrong one whenever
the pair straddles the seam. The march runs counter-clockwise, so the
circle must lie left of the supporting segment - and that is always the
first point for pt_arc and the second for arc_pt.
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.80%. Comparing base (5f5bc62) to head (cbdf987).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2109      +/-   ##
==========================================
- Coverage   95.81%   95.80%   -0.01%     
==========================================
  Files          30       30              
  Lines        9599     9594       -5     
  Branches     1441     1441              
==========================================
- Hits         9197     9192       -5     
  Misses        247      247              
  Partials      155      155              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

kimstik added 2 commits October 12, 2026 17:56
The march stopped as soon as it came back to the start entity, but an arc
can lie on the hull more than once - a large circle between two smaller
ones does. Keep going instead; the hull is closed when the march stands on
the start and every remaining candidate lies behind it.

Fixes CadQuery#931.
@kimstik
kimstik marked this pull request as ready for review October 12, 2026 16:29

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When fusing two Faces, in some cases (esp. hull result) the internal edges cannot be removed. Sketch - hull method

1 participant