Skip to content

wire: IntersectInsertRelate into Boolean2D (primitive_creation_p1) and the PiecewiseMerge runner (merge_p3) - #738

Merged
bherbruck merged 5 commits into
tangency-labs:mainfrom
brett19:fix/merge-intersect-insert-relate
Oct 24, 2026
Merged

bherbruck merged 5 commits into
tangency-labs:mainfrom
brett19:fix/merge-intersect-insert-relate

Conversation

@brett19

@brett19 brett19 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Wires SmTopologyIntersector::IntersectInsertRelate (and the rest of m_vTI) into the two places that still stubbed it. MergeCoincidentSurfaces in boolean.merge_p1 is left to #728.

Changes

SmPrimitiveCreation::Boolean2D (primitive/primitive_creation/p1/boolean.rs)

  • The IntersectInsertRelate and DeleteFaces stubs and the PlanarIntersections stand-in are gone.
  • The local SmTopologyIntersector is merge p4's KernelManifoldIntersector over the two arenas, with the explicit tolerances (SM_ZONE_TO_APPROXTOL3D, 20 degrees).
  • GetCommonEdges/GetCommonVertices, Relate, GetOtherMate/GetBrepMate and DeleteFaces all use the adapter's single mate store. The B-reps are mutated in place, with no copies.
  • Notifications use the caller's key_of for both operands, and the face copies go through the adapter's records.

primitive.primitive_creation_p1 op-6 runner and shim

  • The operands are built as the shim builds them: SmBrep(SM_USE_DEFAULT, ...) with its infinite region, and real CreateFaceFromSurface faces. Before, they were bare face records with no loops or face uses.
  • On success, both sides now record the result's face/edge/vertex counts and its geometry (primitive_record).

boolean.merge_p3 runner, family 4 (PiecewiseMerge)

  • It constructs the merge as the shim's MergeAccess does.
  • That engine's intersector is m_vTI for every stage: IntersectInsertRelate, the mate clearing, SetSubset (by surface identity), the wire/lamina controls, RegisterExistingSSI/ClearExistingSSI and ProcessWiresAndShellVertices. ManifoldBoolean therefore sees the same mates.
  • The pool's stand-in TopologyIntersector<PoolRef> and its empty-relations wire processing are removed.
  • The kernel adapter makes its existing piecewise controls public and adds two getters.

Unit tests

  • Three Boolean2D unit tests (merge p3, primitive p1) asserted the old stub.
  • On their bare face records, the intersector now runs and finds nothing to relate. Copying an unrelated face then stops at the missing face use, and the tests now assert that.

Difftest (main 5351487 -> this branch merged with main 76f27c3)

boolean.merge_p3                 PARTIAL cases=423 passed=361 failed=0 deferred=62 blocked_by=boolean.topology_intersector_p2(48),topology.edge(5),topology.vertex(9)
                              -> PARTIAL cases=423 passed=395 failed=0 deferred=28 blocked_by=query.face_p2(4),topology.brep_p1(4),topology.face_p2(3),topology.vertex(17)
primitive.primitive_creation_p1  PARTIAL cases=773 passed=754 failed=0 deferred=10 rejected=9 blocked_by=boolean.topology_intersector_p2(10)
                              -> PARTIAL cases=773 passed=754 failed=0 deferred=10 rejected=9 blocked_by=query.face_p2(10)
  • merge_p3. 34 piecewise cases now compare and pass (11 values each). The other 14 piecewise box cases stop further on, at SmVertex::GetPoint, SmFace::PointClassify, the B-rep mutable owning context and the face handle of a surface. Those are dispatch gaps inside the boolean, not this wiring.
  • primitive_creation_p1. With real faces, the 10 coplanar cases now defer earlier: in CoverCoincidentSurface, before the intersector. There, STEPInversion of a face-owned surface reaches GlobalPointSolve's trimmed-cache point test (SmFace::PointClassify, surface/surface/p4.rs), which has no face context on that path. Upstream classifies against the face there, so these cases cannot compare until that path gets a face-tested variant.
  • Neither unit turns green. No case is decided from C++ output, and there are no new rejections.

Local gate

cargo fmt --check; clippy --workspace --all-targets -D warnings (with and without difftest/cpp); cargo test -p solidcore (2099 lib tests); cargo check -p solidcore --target wasm32-unknown-unknown; --unit boolean.merge_p3; --unit primitive.primitive_creation_p1; the difftest crate's unit tests ran on CI.

🤖 Generated with Claude Code

brett19 and others added 5 commits October 24, 2026 02:49
…ge runner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…4's kernel adapter

SmPrimitiveCreation::Boolean2D's local SmTopologyIntersector is now a
KernelManifoldIntersector over the two arenas: IntersectInsertRelate,
GetCommonEdges/GetCommonVertices, Relate, GetOtherMate/GetBrepMate and
DeleteFaces all go through the one retained mate store, notifying under the
caller's identities.

The primitive_creation_p1 op-6 runner now builds its operands as the shim
does (SmBrep with its infinite region, CreateFaceFromSurface faces instead of
bare face records) and, on success, both sides record the result's counts
and geometry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Family 4 now constructs the merge as the shim's MergeAccess does and uses
that engine's intersector as m_vTI for every PiecewiseMerge stage:
IntersectInsertRelate, the mate clearing, SetSubset (by surface identity),
the wire/lamina controls, RegisterExistingSSI/ClearExistingSSI and
ProcessWiresAndShellVertices, so ManifoldBoolean sees the same mates. The
pool's stand-in TopologyIntersector and its empty-relations wire processing
are gone. The kernel adapter exposes the piecewise controls it already had
(clear_relationships, wire edges, SSI registration) plus two getters.

Boolean2D's unit tests (merge p3 and primitive p1) asserted the old
IntersectInsertRelate stub; on their bare face records the intersector now
runs and copying an unrelated face stops at its missing face use, which
they now assert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brett19
brett19 marked this pull request as ready for review October 24, 2026 11:51
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
Merged via the queue into tangency-labs:main with commit a2aaf7e Oct 24, 2026
7 checks passed
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.

2 participants