Skip to content

wire: B-rep ray fires and BrepQuery::classify on the single-pass live solve - #699

Merged
bherbruck merged 2 commits into
tangency-labs:mainfrom
erlis:wire/live-brep-ray-fires
Oct 24, 2026
Merged

bherbruck merged 2 commits into
tangency-labs:mainfrom
erlis:wire/live-brep-ray-fires

Conversation

@erlis

@erlis erlis commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Continues #619, which closed itself when #685 merged (its only commit was the empty claim, carried in through #613).

What. Since #613/#685, shell ray fires and region nesting classify faces in one pass on the live B-rep (query::brep::ray::live, LiveRayObjects), and missing UV trims are made lazily in upstream order. Two B-rep entries still solved read-only, so an edge use without a UV trim stopped them at SmEdgeuse::GetOrCreateUVTrimCurve (unprepared read-only topology), where upstream makes the trim inside the loop walk:

  • topology::brep::p2::ray_fire now solves through query::brep::solve_mutable_brep_point (made pub(crate)).
  • BrepQuery::classify's boundary solve does the same when the target is the caller's B-rep (Target::Own). A BrepClassifier's shared target keeps the read-only solve: its copy is not the caller's B-rep (site 5 on fix: B-rep copies keep geometry owners #681).

Test. query::brep::tests::ray_fires_make_missing_uv_trims_on_the_callers_brep: a create_box box with its UV trims stripped, classified under its own keys. The inside point classifies to the solid and the box has trims afterwards. On main it stops at the trim refusal. The boundary solve has no unit test of its own: on a box an edge or vertex point needs no trim, and a point inside a face reaches the topology.face_p2 face-handle stub first (#697). Its evidence is difftest query.brep endcap_face_mid_bnd / endcap_face_corner_bnd below.

Difftest (full sweep, base 9013227 vs this branch): 0 failed on both sides; 63 cases deferred → pass, no other transitions.

1  boolean.merge_p1 | deferred:topology.face_p2:SmFace handle of a surface's face -> pass | e.g. regions_file_sphere.smb
2  query.brep       | deferred:topology.edgeuse_p3:SmEdgeuse::GetOrCreateUVTrimCurve (unprepared read-only topology) -> pass | endcap_face_mid_bnd, endcap_face_corner_bnd
26 query.brep       | deferred:topology.face_p2:SmFace handle of a surface's face -> pass | e.g. mouse_vertex0_region
34 topology.brep_p2 | deferred:topology.face_p2:SmFace::GetTolerance -> pass | e.g. rayfire_Mouse
base:   PARTIAL query.brep cases=1172 passed=1115 failed=0 deferred=57 max_rel_err=0e0 blocked_by=topology.edgeuse_p3(2),topology.face_p2(55)
branch: PARTIAL query.brep cases=1172 passed=1143 failed=0 deferred=29 max_rel_err=0e0 blocked_by=topology.face_p2(29)
base:   PARTIAL topology.brep_p2 cases=1709 passed=1673 failed=0 deferred=36 max_rel_err=0e0 blocked_by=topology.brep_p2(1),topology.face_p2(35)
branch: PARTIAL topology.brep_p2 cases=1709 passed=1707 failed=0 deferred=2 max_rel_err=0e0 blocked_by=topology.brep_p2(1),topology.face_p2(1)
base:   PARTIAL boolean.merge_p1 cases=248 passed=243 failed=0 deferred=5 max_rel_err=0e0 blocked_by=boolean.topology_intersector_p3(4),topology.face_p2(1)
branch: PARTIAL boolean.merge_p1 cases=248 passed=244 failed=0 deferred=4 max_rel_err=0e0 blocked_by=boolean.topology_intersector_p3(4)

The 61 face-handle and GetTolerance cases are reached through the same two solves: they stop at those stubs on the read-only BrepObjects and pass on the live adapter (LiveRayObjects). I have not traced each one further.

Not in this PR. The remaining read-only-trim refusals need other entry points: query.api_queries (27; its functions take &dyn TopologyObjects over the runner's B-reps, with no &mut Brep to lend) and boolean.topology_intersector_p2 (1).

Checks (VM): fmt; clippy with and without difftest/cpp; cargo test -p solidcore (2080 passed); wasm; cargo test -p difftest --features cpp; the full sweep above.

🤖 Generated with Claude Code

erlis and others added 2 commits October 23, 2026 20:54
…e solve

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
topology::brep::p2::ray_fire and BrepQuery::classify's boundary solve
classified faces read-only, so an edge use without a UV trim stopped them
at SmEdgeuse::GetOrCreateUVTrimCurve (unprepared read-only topology),
where upstream makes the trim inside the loop walk. Both now solve through
query::brep::ray::solve_mutable_brep_point (tangency-labs#613's single-pass live solve
on the caller's B-rep), as region nesting already does. A classifier's
shared target keeps the read-only boundary solve: its copy is not the
caller's B-rep.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@erlis
erlis marked this pull request as ready for review October 24, 2026 03:16
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
Merged via the queue into tangency-labs:main with commit 2afcb54 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