primitive.primitive_creation_p3 green
- Layer
- 53
- Upstream lines
- 1,833
- Functions
- 8
- Rust module
primitive::primitive_creation::p3
Status history
- todo 1,842 lines
- partial 1,842 lines
- green 1,842 lines
Source: crates/solidcore/src/primitive/primitive_creation/p3.rs
Upstream: source/SMLib/src/SmPrimitiveCreation.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
2026-10-26 (WR-407 opt-in): the planar-path sweep frame below runs only with Kernel::fixes.sweep_frame_on_planar_path_normal (off by default = pinned SMLib); difftest 296 cases, 295 pass, 1 rejected, 0 failed. 2026-10-26 (#434: a planar path's sweep frame starts on the plane's normal, SolidCraft change from tangency-labs/smlib 1b6f5fa in prepare_curve_sweep; SmCurve::IsPlanar on a B-spline curve added as BSplineCurve::is_planar, nurbs.b_spline_curve_p2): the path is turned into the global frame with its z on the plane's normal, so a swept wall's caps are exactly planar (2.8e-5 mm off before, against a 1e-5 zone tolerance); without it two swept arc walls sharing their planes fail their union (plan/upstream-issues/WR-407, plan/findings/surface.surface_p3--cover-refuses-a-folded-continuation.md). The unit's own difftest is unchanged (no case sweeps along a planar path whose start tangent is +y). CO-PORTED in sweep.api_brep (PR #110): SmSweepOptions -> solidcore::primitive::primitive_creation::SweepOptions (crates/solidcore/src/primitive/primitive_creation.rs, parent module of p1..p3); 8 fns; largest: SmPrimitiveCreation::CreateCurveSweep, sm_CreateRuledSurfaceFromOffsetCurve, SmPrimitiveCreation::CreateLinearSweep, SmPrimitiveCreation::CreateRotationalSweep; 60 upstream test entry points reach this unit; PR #233: all eight owned functions ported through PrimitiveAccess/SweepAccess, retaining full tails after unavailable calls. Review #233 after main 95b823ed and dependency heads #213 92005b59 / #222 86c7eb33: difftest 296 cases, 285 bit-identical passes (including finite zero/negative-tolerance helper comparisons and the empty swung return with a negative unused tolerance), 10 topology.brep_p8 deferrals (including zero/negative curve-sweep, skin and swung tolerances), 1 UB-78 rejection, 0 failures; no absolute floors. Native ruled-surface values and three mutated curve states are compared; curve-sweep preparation/scaling, face skinning, cap/axis/stitch/topology tails are not certified. Swung scaling and the curve-sweep scale reference keep original Curve dispatch; three exact Rust regressions distinguish analytic lines from their cached NURBs. Path/profile/scale-curve copies remain where upstream explicitly constructs them. Native derived construction remains deferred; real SmLine/SmCircle fixtures follow when it becomes comparable. The swung builder mirrors virtual GetOrCreateGwNurbPointer in section/trajectory order, materializing only missing analytic caches with caller owner/context; two additional Rust regressions cover lazy profile/path/both and preservation of an existing two-ULP cache. Review 2026-10-20 integrates canonical main 95b823ed, retaining both findings sections. Both DoStitching adapters now invoke landed Stitch::do_stitching with a shared B-rep-qualified sweep callback and their upstream option sets; its Notify dependency remains topology.brep_p2. Added negative skin/swung tolerance fixtures (including unused tolerance with no profiles) and Rust callback/state-restoration regressions. Available p5 and face-p3 defaults call their ports; intersector deletion is a required scoped caller adapter. Caller must supply a concrete PrimitiveAccess resolver with notification state. Scaling sampling bounded to 1000000 points; reused sweep engine bounds repetitions to 4096. Legacy sweep APIs now identify their earlier B-rep-constructor blocker. See fixtures/primitive.primitive_creation_p3/README.md and plan/findings.md. PR #233 face-box refresh (canonical main e5f3e441): PrimitiveAccess resolves caller BrepId/FaceId and invokes query.face_p1::calculate_bounding_box with tight=false; nonzero-face/foreign-owner Rust regression covers this adapter, not completed native rotational construction. Current #213/#222 contracts, caller notifications and retained HCR services are integrated; edge blend uses the current same-Brep form and HCR visibility receives mutable Kernel. After the landed pre-edit notification, the general sweep default reaches query.brep::CalculateBoundingBox and the empty linear-cap stitch succeeds; both regressions check flag restoration, while successful nonempty native stitching stays uncertified. Integration in PR #233 (2026-10-21, main 100535f4): forward the caller Kernel through primitive p1/p3, sweep, extrusion linearity and their runner evaluations after #133; is_linear_after_ends and ruled_surface_from_offset take that same Kernel; after the landed brep_p6 MakeFaceTopology, curve-owner and primitive detailed/trimmed-face constructors forward the same mutable Kernel, including cylindrical boxes. Existing formulas, ordering, tolerances, partial coverage and ready state are retained. Production-adapter follow-up (main 54f5865ee): the runner now uses the existing PrimitiveModel with real p8 face constructors; 296 cases yield 294 passes, 1 DeleteFaces deferral in partial_rotation_line (boolean.topology_intersector_p2), 1 unchanged UB-78 rejection, 0 failures. All 286 former pass records and Rust digests were unchanged by the adapter substitution, with every native digest unchanged. Construction records retain the original six fields and now append owning-list face/edge/vertex counts; successful calls compare vertex positions, edge intervals/five evaluations and face domains/nine evaluations with native virtual dispatch. All 294 comparable final native/Rust digests are identical. Eight restored fixtures, including zero/negative tolerances, require successful nonempty geometry in a native regression. No tolerance, fixture guard, status or negative case was removed. Final caller-keyed DeleteFaces follow-up: production rotational cleanup now invokes the existing context-only intersector through actual model notification records/attributes/key_of; 296 cases, 295 exact comparable passes, 0 deferrals/failures, 1 unchanged UB-78 rejection. All 295 native/Rust full-output digests agree; all 294 preceding pass records/digests and every native digest are unchanged. Nine successful nonempty construction regressions include the partial rotational face and public FFI buffer retry. A cross-Brep regression deletes only the selected body's face/edges/vertices despite overlapping stable FaceIds. The adjacent revolution API now detaches its actual first caller-owned surface rather than filtering with unrelated owner keys or copying metadata; native API sampling validates it in sweep.api_surfaces. Integrated current main shared PrimitiveAccess defaults (model duplicate face constructors removed), retaining native geometry comparisons and actual model-key intersector deletion. Wire (2026-10-23): the PrimitiveAccess face services (topology.brep_p8 CreatePlanarFace(s)With3DCurves / CreateFace(s)FromSurface, topology.brep_p3 DeleteFace(face, FALSE, TRUE)) are real trait defaults over SweepAccess::with_brep_mut (PrimitiveModel's identical overrides removed), and axis_inside_face is a default over the SweepStore classifier (query.face_p2 SmFace::CurveOnClassify; PrimitiveModel no longer returns Unported for it); the runner adapter keeps a tag store, untagged curves and deletes faces through KernelManifoldIntersector::delete_faces_with_keys; entry records add the B-rep's face/edge/vertex counts. Difftest 296 cases: 295 bit-identical passes, 0 deferred, 1 UB-78 rejection, 0 failures -> green. 2026-10-31, PR #1775 / complete #483 audit: Ruled/taper pivot callers use the kernel-aware status policy, including nearest-corner selection. Inventory and regressions: plan/findings/general--status-audit-483.md. Default-off flags preserve the pinned C++ behavior; no tolerance or native case waived. Validation at d54dfd462: native difftest 330 cases, 329 pass, 0 failed/deferred, 1 existing rejected; perturb SENSITIVE on every accepted case. Full 280-unit exact-base gate passed.
Goldens
This is committed inventory, not a runtime result or a correctness proof. A golden records what solidcore produced when blessed. Current results require the canonical CI gate, not these counts.
- Golden records
- 330
- Stored error outcomes
- 0
- Stored deferrals
- 0
- Stored harness rejections
- 0
- Known-failure entries
- 0
Metadata counts describe fields in the stored records; they are not passes or live failures.
Source at f9704ee3b:
golden JSONL ·
known-failure list.
Dependencies
Depends on: curve.composite_curve_p1 green curve.curve_p2 green geom.a_object green geom.axis2_placement green geom.extent1d green geom.extent2d green geom.extent3d green geom.geom_utility_p1 green geom.object green geom.solution_array green geom.tol green geom.vector3d green nurbs.b_spline_curve_n_lib green nurbs.b_spline_curve_p1 green nurbs.b_spline_curve_p2 green nurbs.b_spline_surface_n_lib_p1 green primitive.primitive_creation_p1 green sweep.topology_sweep green topology.brep_p1 green topology.brep_p5 green topology.brep_p8 green topology.face_p2 partial
Soft dependencies: boolean.topology_intersector_p2 green curve.composite_curve_p2 green curve.curve_p1 green curve.curve_p3 partial curve.curve_p5 partial curve.curve_p6 green curve.curve_p7 green curve.ellipse_p1 green geom.context green heal.stitch_p1 green heal.stitch_p2 green intersect.curve_class_p1 green intersect.curve_class_p4 green intersect.point_class green nurbs.b_spline_curve_p3 green nurbs.b_spline_surface_n_lib_p2 green nurbs.b_spline_surface_p1 green query.face_p1 green query.face_p2 green surface.surf_of_revolution_p2 green surface.surface_p2 partial surface.surface_p5 green surface.surface_p7 green sweep.rotational_sweep_geometry green sweep.trans_sweep_geometry green topology.brep_p3 partial topology.face_p3 green topology.face_p4 green topology.shell green
Dependents: primitive.primitive_creation_p2 green sweep.api_brep partial
Soft dependents: primitive.api_primitives green sweep.api_surfaces green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmPrimitiveCreation::CreateLinearSweep | SmPrimitiveCreation.cpp:1853 | 217 | [PrimitiveCreation::create_repeated_linear_sweep] |
SmPrimitiveCreation::CreateRotationalSweep | SmPrimitiveCreation.cpp:2618 | 208 | [PrimitiveCreation::create_rotational_sweep] |
SmPrimitiveCreation::CreateRotationalSweep | SmPrimitiveCreation.cpp:2852 | 210 | [PrimitiveCreation::create_rotational_sweep] |
SmPrimitiveCreation::CreateSwungPrimitive | SmPrimitiveCreation.cpp:3069 | 46 | [PrimitiveCreation::create_swung_primitive] |
sm_CreateRuledSurfaceFromOffsetCurve | SmPrimitiveCreation.cpp:3346 | 260 | [ruled_surface_from_offset] |
SmPrimitiveCreation::CreateCurveSweep | SmPrimitiveCreation.cpp:4935 | 587 | [PrimitiveCreation::create_curve_sweep] |
SmPrimitiveCreation::CreateSkinFromFaces | SmPrimitiveCreation.cpp:6764 | 136 | [PrimitiveCreation::create_skin_from_faces], [PrimitiveCreation::create_skin_from_faces_traced] |
SmPrimitiveCreation::CreateBlendPrimitive | SmPrimitiveCreation.cpp:7395 | 169 | [PrimitiveCreation::create_blend_primitive] |
Module file-header table (8 rows)
| Rust | Upstream |
|---|---|
[PrimitiveCreation::create_repeated_linear_sweep] | repeated CreateLinearSweep |
[PrimitiveCreation::create_rotational_sweep] | full CreateRotationalSweep |
[PrimitiveCreation::create_partial_rotational_sweep] | partial CreateRotationalSweep |
[PrimitiveCreation::create_swung_primitive] | CreateSwungPrimitive |
[PrimitiveCreation::create_curve_sweep] | CreateCurveSweep |
[PrimitiveCreation::create_skin_from_faces], [PrimitiveCreation::create_skin_from_faces_traced] | CreateSkinFromFaces |
[PrimitiveCreation::create_blend_primitive] | CreateBlendPrimitive |
[ruled_surface_from_offset] | sm_CreateRuledSurfaceFromOffsetCurve |
Upstream tests reaching this unit
SM_API_test:TestSmCreateSwungPrimitive, SM_API_test:TestSmCreateSkinFromFaces, SM_API_test:TestSmCreateSkinPrimitive, SM_API_test:TestSmCurveSweep, SM_API_test:TestSmPipeSweep, SM_API_test:TestSmCurveSweepFromFaces