Skip to content

port: topology.face_p4 (stacked on #693, merged with main) - #718

Merged
bherbruck merged 10 commits into
tangency-labs:mainfrom
brett19:stack/face-p4-find-vertex-sector
Oct 24, 2026
Merged

bherbruck merged 10 commits into
tangency-labs:mainfrom
brett19:stack/face-p4-find-vertex-sector

Conversation

@brett19

@brett19 brett19 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #693 by @outlookhazy, which ports topology.face_p4 and wires SmFace::FindVertexSector on the mutable curve-classification path.

This PR carries #693's commits unchanged (3ef352f1c, 1ba9727ff, c27cab26d; no rebase or squash). On top of them it adds merges and one revert commit (below):

  • merges of the latest main, which port: topology.face_p4 #693 conflicts with;
  • the merge of c27cab26d. That commit was written before IntersectTSBound's cached branch moved into ts_bound_cached_visits, so in this branch its vertex pruning sits in the loop-use fallback of intersect_ts_bound, and the curve cache domain is computed there.

Upstream-faithful reverts (our commit d1a8c32, on top of #693's commits)

Two parts of c27cab26d do not match upstream, so they are reverted in a separate commit. #693's commits themselves are left unchanged.

  • intersect_ts_bound fallback: SmCurveClassification::IntersectTSBound's loop-use branch (face trimmed cache not up to date, SmCurveClass.cpp ~15880-16000) visits every vertex use with no curve-domain check and builds no curve cache. The pruning of non-singular vertices outside the curve's UV box, and the cache build for it, are removed.
  • find_vertex_sector: upstream evaluates cpUVCurve only when the caller passes one, so a 2D cr3DCurve is no longer substituted for it.

Neither revert changes any outcome in intersect.curve_class_p4/p7/p9, topology.face_p2/face_p4/brep_p5/brep_p9 or query.face_p2. The counts match the head before the reverts.

Nine cases now reach the loop bisector on a copy (known mismatches)

Main now has #717, which wired GetLoopCrossings in query/face/p4.rs. With that in place, nine heal-path cases that used to defer at FindVertexSector run on into SetProps_Stage3 -> ClassifyLoops -> the loop bisector, which the port runs on a copy of the B-rep. They disagree the same way as #717's cases (UV trim curves and vertex/face gap resets missing from the real B-rep):

  • heal.heal_data_p1: file_plane_circ, file_plane_circ_rebuild_reverse
  • topology.brep_p1: plane_circ_heal
  • topology.brep_p10: read_Fillet_bottle, read_Fillet_cyl_cyl_shell, read_Fillet_fillet0227, read_Solids_extrusion2, gen0040, gen0165

They are listed in known_mismatches.toml under #717's existing reason and findings entry. A new findings entry records the evidence and a caveat: in read_Fillet_cyl_cyl_shell, HasSeamProblem's seam classification is a second possible source. After the change:

PARTIAL heal.heal_data_p1 cases=495 passed=456 failed=0 deferred=11 known_mismatch=28
PARTIAL topology.brep_p1 cases=2627 passed=2466 failed=0 deferred=136 known_mismatch=9
PARTIAL topology.brep_p10 cases=1404 passed=1380 failed=0 deferred=5 known_mismatch=12

All credit for the port and the fixes goes to @outlookhazy. This PR closes nothing by itself. If #693 merges first, this PR will be closed as superseded.

Difftest before, at #693's 1ba9727ff merged with main:

FAIL intersect.curve_class_p4 cases=3201 passed=3156 failed=43 deferred=2 max_rel_err=1e0 blocked_by=surface.surface_p2(2)
FAIL topology.face_p2 cases=2692 passed=2611 failed=1 deferred=80 (#693's CI)

Difftest after, with c27cab26d, latest main and the two reverts:

PARTIAL intersect.curve_class_p4 cases=3201 passed=3032 failed=0 deferred=169 max_rel_err=0e0 blocked_by=surface.surface_p2(169)
PASS topology.face_p4 cases=5506 passed=5506 failed=0 deferred=0 max_rel_err=0e0
PARTIAL topology.face_p2 cases=2692 passed=2611 failed=0 deferred=81 max_rel_err=0e0 blocked_by=query.face_p2(34),topology.edge(47)

For reference, main has curve_class_p4 at 2921 passed / 280 deferred, face_p4 at 5484 / 22, and face_p2 at 2596 / 96.

🤖 Generated with Claude Code

outlookhazy and others added 7 commits October 23, 2026 20:10
Co-Authored-By: Gemini 3.8 Flash <noreply@google.com>
- Wire FindVertexSector through Mutable<'g, G>::find_vertex_sector in
  crates/solidcore/src/intersect/curve_class/p7.rs by resolving face and
  vertex entities and calling find_vertex_sector_in.
- Update primitive::api_primitives tests to verify partial sphere and
  cylinder construct complete manifold solids without deferral.
- Set topology.face_p4 status to green in plan/units/topology.face_p4.toml
  (5,506 cases: 5,506 passed, 0 failed, 0 deferred, max_rel_err 0e0).

Co-Authored-By: Gemini 3.8 Flash <noreply@google.com>
- In crates/solidcore/src/topology/face/p4.rs: in find_vertex_sector, fall
  back to 2D curve_3d as uv_curve when uv_curve is not explicitly passed.
- In crates/solidcore/src/intersect/curve_class/p9.rs: in intersect_ts_bound,
  move curve domain computation before the cache fallback and prune
  non-singular vertices outside the curve's UV domain, matching upstream's
  spatial cache node pruning and preventing spurious vertex drops when
  tol_uv is mapped to 2D.
- In crates/difftest/src/units/intersect_curve_class_p4.rs: remove the
  artificial create_uv_trim_curves invocation in build_pool to match C++
  fixture state on closed revolution faces.

Co-Authored-By: Gemini 3.8 Flash <noreply@google.com>
The fix was written against main before IntersectTSBound's cached branch moved
into ts_bound_cached_visits. The vertex pruning now sits in the loop-use
fallback of intersect_ts_bound, and its curve cache domain is computed there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- intersect_ts_bound: the loop-use fallback (face trimmed cache not up to
  date) visits every vertex use with no curve-domain check and builds no
  curve cache, as SmCurveClassification::IntersectTSBound does
  (SmCurveClass.cpp, the pTSC->m_bFaceWasModified branch).
- find_vertex_sector: use the UV curve only when the caller passes one
  (upstream evaluates cpUVCurve only when it is non-NULL); a 2D curve is
  not substituted for it.

Neither change alters an outcome in intersect.curve_class_p4/p7/p9,
topology.face_p2/face_p4/brep_p5/brep_p9 or query.face_p2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brett19
brett19 marked this pull request as ready for review October 24, 2026 06:35
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
@bherbruck
bherbruck removed this pull request from the merge queue due to a manual request Oct 24, 2026
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
…a copy

Wiring FindVertexSector lets these cases run past it into SetProps_Stage3 ->
ClassifyLoops -> the loop bisector, which the port runs on a copy of the
B-rep. They disagree the same way as the cases already listed for that cause:
heal.heal_data_p1 file_plane_circ(_rebuild_reverse), topology.brep_p1
plane_circ_heal, topology.brep_p10 read_Fillet_bottle,
read_Fillet_cyl_cyl_shell, read_Fillet_fillet0227, read_Solids_extrusion2,
gen0040 and gen0165. They use the existing reason and findings entry. The new
findings entry records the evidence and the seam-classification caveat for
read_Fillet_cyl_cyl_shell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
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.

3 participants