Skip to content

port: intersect.curve_class_p5 - #610

Merged
bherbruck merged 3 commits into
tangency-labs:mainfrom
Loohi:unit/intersect.curve_class_p5
Oct 23, 2026
Merged

bherbruck merged 3 commits into
tangency-labs:mainfrom
Loohi:unit/intersect.curve_class_p5

Conversation

@Loohi

@Loohi Loohi commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Takes intersect.curve_class_p5 from partial to green.

The two remaining pieces were the edits upstream makes through const pointers:

  • sm_InsertSolutions, edge target: an edge-end vertex whose tolerance is below the edge's gets raised (SmVertex::SetTolerance, when GetOKToSetTolerance).
  • IntersectVertices, the GWC:CHANGED_SSS block (SmCurveClass.cpp:14826-15095): knot-snap cull of drop points, projection onto both classification surfaces (local solve from the UV curve, else global with point testing off), sm_SetXSectCurveThroughPoint on the classification curve, SetIsCurveCurrent(FALSE), then deleting the UV trim curves of the vertex's edges and of their topology intersector mates.

These go through a new ClassGeometryMut trait (insert_solutions_mut, intersect_vertices_mut). The existing read-only entry points keep their signatures (p8, p9 and query.face_p2 call them) and defer where an edit is due, tagged UNPORTED(topology.brep_p1) like point_class's merge. IntersectVertices also now projects onto an owner-free copy of the face surface, as upstream clears its owner for the call.

Difftest: new B-rep cases (shim intersect_curve_class_p5_topo.cpp, runner module topo) on box/face B-reps from topology.edgeuse_p1's block, with tolerance and vertex edits, UV trim creation and edge mates through a real SmTopologyIntersector. The Rust side owns the curve and both B-reps, and both sides compare the classification, solutions, the edited curve, every vertex tolerance and every edge-use UV trim flag. 30 hand-written fixtures plus 300 generated. Coverage (from per-case diagnostics in the report): curve edits with UV trims deleted, including on mates; vertex tolerance raises; edge point/range classes; tangency filtering; the refine gate with classification surfaces.

Before:

PASS intersect.curve_class_p5 cases=1081 passed=1081 failed=0 deferred=0 max_rel_err=0e0 with_values=1081 no_values=0 vacuous=0

After:

PASS intersect.curve_class_p5 cases=1411 passed=1411 failed=0 deferred=0 max_rel_err=0e0 with_values=1411 no_values=0 vacuous=0
SENSITIVE intersect.curve_class_p5 perturbed=1411 detected=1411 unperturbed=0 deferred=0
FUZZ-PASS intersect.curve_class_p5 cases=400 rejected=154 malformed=98 ran=148 differs=0 crashes=0 panics=0 timeouts=0

Callers re-run, counts unchanged from main: p8 1127/1127, p9 321 pass 115 deferred, p1 2122 pass 3 deferred, p2 1671/1671, query.face_p2 1326 pass 18 deferred, boolean.topology_intersector_p1 810 pass 20 deferred, topology.face_p1 1993 pass 319 deferred, surface.surface_p4 3015/3015.

Not reached by any case (written up in plan/findings.md): the cull's removal of a duplicate drop point, and the large-gap vertex insertion (the curve point solve never returns a drop point beyond XSectTol3d). Also in findings: C++ raises a vertex tolerance while computing a vertex/face gap when the local projection fails (trimmed surface cache build, suspected SmEdge::ValidateGeometry), which the topology.vertexuse port doesn't do. The generator avoids that setup.

🤖 Generated with Claude Code

https://claude.ai/code/session_013dBoSgwB37oA88rLG9LZ6E

Loohi and others added 3 commits October 23, 2026 19:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al B-reps

sm_InsertSolutions now raises an edge-end vertex's tolerance to the edge's
(SmVertex::SetTolerance) and IntersectVertices runs the GWC:CHANGED_SSS block:
knot-snap cull, surface projections, sm_SetXSectCurveThroughPoint on the
classification curve, SetIsCurveCurrent(FALSE) and deleting the UV trim curves
of the vertex's edges and their topology intersector mates. The _mut entry
points take a ClassGeometryMut; the read-only ones defer where an edit is due.

New B-rep difftest cases (shim intersect_curve_class_p5_topo.cpp): 30 fixtures
and 300 generated, all bit-identical. Unit goes green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013dBoSgwB37oA88rLG9LZ6E
@Loohi
Loohi marked this pull request as ready for review October 23, 2026 12:57
@bherbruck
bherbruck added this pull request to the merge queue Oct 23, 2026
Merged via the queue into tangency-labs:main with commit 7935b4c Oct 23, 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