CrossSection: drop FillRule/Compose, add SetTolerance/GetTolerance#1760
Merged
Conversation
…ef Hull, tolerance API Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drop stale @param fillrule from CrossSection(SimplePolygon) doc - Replace CrossSection.compose with batch_boolean in all_apis.py - Add get_tolerance/set_tolerance to all_apis.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'Bevel' was registered in the embind enum but missing from the TypeScript type and from joinTypeToInt(), so passing 'Bevel' silently fell through to 'Square' (0). Add it to both. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rect and Circle constructors now set tolerance_ via InferEps, consistent with the Polygons constructor. Previously GetTolerance() returned 0 for these paths. - Hull(const SimplePolygon&): use the local sorted copy (points) for InferEps, not the original const-ref (pts). - Move SetTolerance declaration to the Information doxygen group alongside GetTolerance. - Add CBIND.cross_section_tolerance smoke test for manifold_cross_section_get/set_tolerance. - Fix stale comment in SimplifyPostFiltersBoolean2Output referencing the old epsilon=1e-6 default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1760 +/- ##
=======================================
Coverage 93.83% 93.83%
=======================================
Files 44 44
Lines 9985 9992 +7
=======================================
+ Hits 9369 9376 +7
Misses 616 616 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…Simplify default - Remove 'compose' from crossSectionStaticFunctions in garbage-collector.ts (CrossSection.compose no longer exists; wrapping undefined crashed with "originalFn is not a function" in WASM TBB:OFF CI lanes) - Add 'setTolerance' to crossSectionMemberFunctions (returns new CrossSection) - Update voronoi.mjs to use CrossSection.union() instead of .compose() - Fix stale @param epsilon / default 1e-6 in manifold-encapsulated-types.d.ts (parameter is now 'tolerance', default 0 uses the geometry's own tolerance) - Add @param doc note to CrossSection::Simplify explaining that default 0 resolves to tolerance_ (geometry-scale-derived, not a fixed 1e-6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zmerlynn
added a commit
to zmerlynn/manifold
that referenced
this pull request
Jun 20, 2026
CrossSection::Compose removed - replace with BatchBoolean(Add). CrossSection::FillRule enum removed - drop from constructors (new default uses positive winding, same semantics as FillRule::Positive). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zmerlynn
added a commit
to zmerlynn/manifold
that referenced
this pull request
Jun 22, 2026
CrossSection::Compose removed - replace with BatchBoolean(Add). CrossSection::FillRule enum removed - drop from constructors (new default uses positive winding, same semantics as FillRule::Positive). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zmerlynn
added a commit
to zmerlynn/manifold
that referenced
this pull request
Jun 23, 2026
CrossSection::Compose removed - replace with BatchBoolean(Add). CrossSection::FillRule enum removed - drop from constructors (new default uses positive winding, same semantics as FillRule::Positive). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zmerlynn
added a commit
to zmerlynn/manifold
that referenced
this pull request
Jun 24, 2026
CrossSection::Compose removed - replace with BatchBoolean(Add). CrossSection::FillRule enum removed - drop from constructors (new default uses positive winding, same semantics as FillRule::Positive). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Part of #1707. Breaks the CrossSection public API now that the boolean2 backend
is the only backend (#1751).
Dropped:
FillRuleenum and constructors that accepted it. The boolean2 backendsupports only positive-winding fill; the enum had no effect since Cut over CrossSection from Clipper2 to boolean2 #1751, and
passing any non-Positive value triggered a
DEBUG_ASSERTin assert-enabledbuilds. Callers passing
FillRule::Positive(the only valid value) just dropthe argument.
Compose(const std::vector<CrossSection>&)static. It was a batch booleanunion - identical to
BatchBoolean(..., OpType::Add). UseBatchBooleanorthe
+operator instead.ManifoldFillRuleenum from the C header (types.h).Added:
GetTolerance()/SetTolerance(double)- mirrorsManifold::GetTolerance/Manifold::SetTolerance.GetTolerancereturns the cross-section's propagateddrift budget.
SetTolerancereturns a copy with it adjusted: raising simplifiesto the new budget; lowering floors at the geometry's natural epsilon.
Changed:
Simplify(double epsilon = 1e-6)->Simplify(double tolerance = 0). Default0uses the section's own tolerance (fromGetTolerance()). Callers passingan explicit non-zero value are unaffected.
Hull(SimplePolygon pts)/Hull(Polygons polys)now take const-ref.HullImplsorts in place; the old by-value signature obscured this.Rect,Square, andCircleconstructors now settolerance_fromInferEpson the output geometry, consistent with thePolygonsconstructor.Previously
GetTolerance()returned 0 for these paths.Fixed (pre-existing):
JoinType:'Bevel'was missing from the TypeScript type and fromjoinTypeToIntinbindings.js, so passing'Bevel'silently fell throughto
'Square'.C, Python, and WASM bindings updated throughout.
Test plan
1 new
CBIND.cross_section_tolerance). 2 seed-queue CrossSection tests remaindisabled pending fixes on a separate branch.