Skip to content

wire: primitive.primitive_creation_p3 B-rep face services and axis classification (unit to green) - #617

Merged
bherbruck merged 4 commits into
tangency-labs:mainfrom
embed-3d:wire/primitive-p3-brep-faces
Oct 23, 2026
Merged

bherbruck merged 4 commits into
tangency-labs:mainfrom
embed-3d:wire/primitive-p3-brep-faces

Conversation

@embed-3d

Copy link
Copy Markdown
Contributor

Wires the PrimitiveAccess defaults that were still UNPORTED stubs, although their targets are ported, and makes the difftest fixtures reach them.

Changes

  • B-rep face services: planar_faces / planar_face / surface_faces / surface_face (topology.brep_p8: CreatePlanarFace(s)With3DCurves, CreateFace(s)FromSurface with SM_CT_G1 as at every call site) and delete_primitive_face (topology.brep_p3: DeleteFace(face, FALSE, TRUE)) are now real trait defaults over SweepAccess::with_brep_mut. PrimitiveModel's identical overrides are removed.
  • Axis classification: axis_inside_face is a trait default over the classifier SweepStore already used (SmFace::CurveOnClassify). That removes SweepStore's override and PrimitiveModel's Unported(query.face_p2).
  • Consumed curve slots: planar_faces now empties each consumed slot instead of clearing the vector, as the trait documents. No current caller depended on the old behaviour (skin.rs sets its transfer flags in the Ok branch).
  • Difftest fixtures (p2, p3):
    • A tag store and untagged curve lookups, as in PrimitiveModel.
    • The p3 fixture deletes faces through KernelManifoldIntersector::delete_faces_with_keys, as in SweepStore. It used to fail there silently, which the ignored upstream status hid.
    • The p3 entry-point records (shim and runner) now also compare the B-rep's face, edge and vertex counts, so the construction tails compare real topology. For example, the repeated linear wire sweep gives 2/7/6 and the full rotation of a line 1/3/2, both identical to C++. Face geometry is still not compared.
  • Tests:
    • store.rs: the test that pinned the brep_p8 stub now checks that the real constructor runs.
    • api_primitives: partial solids now get past the axis check. Sphere and cylinder stop at SmFace::FindVertexSector (topology.face_p4), the torus at SmFace::Point3DClassify (query.face_p1).
  • Plan: primitive.primitive_creation_p3 → green; p2 notes updated.

Difftest (macOS arm64, Apple clang, pinned c9c5979; Rust side merged with main 10a92977e)

PASS primitive.primitive_creation_p3 cases=296 passed=295 failed=0 deferred=0 max_rel_err=0e0 with_values=295 rejected=1
PARTIAL primitive.primitive_creation_p2 cases=328 passed=196 failed=0 deferred=112 max_rel_err=0e0 with_values=196 rejected=20
PARTIAL sweep.api_brep cases=573 passed=502 failed=0 deferred=71 max_rel_err=0e0
PARTIAL primitive.primitive_creation_p1 cases=773 passed=738 failed=0 deferred=26 rejected=9
PARTIAL primitive.api_primitives cases=1981 passed=1613 failed=0 deferred=368
PARTIAL sweep.api_surfaces cases=882 passed=862 failed=0 deferred=20
PASS sweep.topology_sweep cases=568 passed=568 failed=0 deferred=0
PARTIAL boolean.api_brep cases=287 passed=151 failed=0 deferred=136
PARTIAL topology.brep_p3 cases=897 passed=812 failed=0 deferred=85

Compared with main's CI reports:

  • p3: 286 → 295 passes, 9 → 0 deferred.
  • p2: 146 → 196 passes, 162 → 112 deferred (topology.brep_p8 71 → 0).
  • sweep.api_brep: 501 → 502 passes.
  • The other touched units are unchanged.

Full --green --jobs 4 on this Mac: every failing unit fails identically on unmodified main, from known macOS/arm64 issues (#448, #449, #450). I checked heal.heal_data_p1 case by case against main. blend.fillet_solver_p5 and geom.local_solve1d also fail identically on main locally. No absolute floors and no loosened tolerances. Run on macOS only, so CI is the Linux gate.

Also run: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test -p solidcore (2053 passed) and cargo check -p solidcore --target wasm32-unknown-unknown.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01TYEpC4tUKxEP3MCaFL5Kz2

embed-3d and others added 4 commits October 23, 2026 14:02
…een)

PrimitiveAccess's CreatePlanarFace(s)With3DCurves, CreateFace(s)FromSurface
(topology.brep_p8) and DeleteFace (topology.brep_p3) defaults were UNPORTED
stubs; they now call the ported B-rep functions through
SweepAccess::with_brep_mut. PrimitiveModel's identical overrides are removed.

The difftest adapter gains a tag store, untagged curve lookups and face
deletion through KernelManifoldIntersector::delete_faces_with_keys, and every
entry-point record now also compares the B-rep's face/edge/vertex counts.

difftest: 296 cases, 295 bit-identical passes, 0 deferred (was 9), 1 UB-78
rejection, 0 failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- axis_inside_face becomes a trait default over the SweepStore classifier
  (SmFace::CurveOnClassify); SweepStore's identical override and
  PrimitiveModel's Unported(query.face_p2) are removed.
- planar_faces empties each consumed slot instead of clearing the vector,
  as the trait documents.
- The p2 runner adapter keeps a tag store and untagged curves, like p3's;
  both fixtures drop their axis_inside_face fallback.
- api_primitives: partial solids now get past the axis check and stop at
  SmFace::FindVertexSector / SmFace::Point3DClassify.

difftest: primitive_creation_p2 196 passes (was 146), 0 failed, 112 deferred
(was 162); primitive_creation_p3 295 passes, 0 deferred; sweep.api_brep 502
(was 501); other touched units unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TYEpC4tUKxEP3MCaFL5Kz2
@bherbruck
bherbruck added this pull request to the merge queue Oct 23, 2026
Merged via the queue into tangency-labs:main with commit 4baf434 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