solidcore

Units / primitive

primitive.primitive_creation_p2 green

Layer
58
Upstream lines
2,258
Functions
12
Rust module
primitive::primitive_creation::p2

Status history

Oct 12Nov 25
  1. todo 2,258 lines
  2. partial 2,258 lines
  3. green 2,258 lines

Source: crates/solidcore/src/primitive/primitive_creation/p2.rs

Upstream: source/SMLib/src/SmPrimitiveCreation.cpp

Port-plan notes

These notes preserve historical port measurements and limitations, not current CI results.

UB-215 guard exact (2026-10-26): the FFI evaluates SweepEdgeHigh's native refusal (IsDegenerateCurve over its 13 samples, IsDegeneratePoint on the control net, N_ConicData turn normalisation) for partial cone lines and torus minor circles below the zone tolerance, with a 1e-6 relative + 1e-13 * size margin (plan/upstream-issues/UB-215--addendum-2026-10-26-exact-refusal-predicate.md); the generator keeps both earlier guards; ub215_exact_guard_accepted.json adds 30 compared cases, two of which needed the lazy SurfOfExtrusion NURB made as upstream (surface/surface/p6.rs iso curves, sweep/topology_sweep/engine.rs): PASS primitive.primitive_creation_p2 cases=374 passed=354 failed=0 deferred=0 max_rel_err=0e0 with_values=354 no_values=0 vacuous=0 rejected=20. UB-215 guard narrowed (2026-10-26): the FFI refuses partial-cone side/base/top lines from 0.9999e-6 to 1e-5 only (shorter lines fail SweepEdgeHigh's IsDegenerateCurve first, SM_ERR_INVALID_INPUT; the axis line sweeps to no face); the generator keeps the earlier guard for its redraws; ub215_degenerate_faces.json adds 16 compared cases: PASS primitive.primitive_creation_p2 cases=344 passed=324 failed=0 deferred=0 max_rel_err=0e0 with_values=324 no_values=0 vacuous=0 rejected=20 (plan/upstream-issues/UB-215--addendum-2026-10-26-cone-crash-range.md). GREEN (2026-10-25, after PR #884 resolved the last 8 planar-path union known mismatches): PASS primitive.primitive_creation_p2 cases=328 passed=308 failed=0 deferred=0 max_rel_err=0e0 with_values=308 no_values=0 vacuous=0 rejected=20; --perturb SENSITIVE 308/308. 2026-10-25 (PR #890, line/curve intersections and drop traces keep the face's cache; DeleteTopologicalVertex curve intervals): PARTIAL primitive.primitive_creation_p2 cases=328 passed=300 failed=0 deferred=0 rejected=20 known_mismatch=8 after merging main 1cd31cf03 (faces_to_delete LiveBrepObjects world, below): the last surface.trim_srf_cache deferrals run; the unit stays partial for its 8 known mismatches. 2026-10-25 (wire: SolveOperands natural domains in global solvers): the 2 surface.surface_p2 GetNaturalUVDomain deferrals pass. UPDATE (faces_to_delete LiveBrepObjects world, 2026-10-25): gen0071 clears its surface.trim_srf_cache deferral in ProjectAndTrim and joins the 1e4-1e6 planar-path union known-mismatch family (known_mismatch 7 -> 8, deferred 14 -> 13: PARTIAL primitive.primitive_creation_p2 cases=328 passed=287 failed=0 deferred=13 rejected=20 known_mismatch=8). UPDATE (MergeCurvesOnSurface world, 2026-10-25): the 21 planar-path cases deferred at the merge's classification world: 3 pass (gen0092, gen0189, gen0226), 11 defer later (TrimSrfCache face-owned surface, SmCurve::GetNaturalInterval, SmFace::PointClassify), 7 are known mismatches (plan/findings.md: planar-path sweeps at 1e4-1e6 scale fail their union after ProjectAndTrim). 2026-10-24 (wire: SmMerge::SmMerge and SmBrep::ProjectAndTrim in the primitive model): PARTIAL primitive.primitive_creation_p2 cases=328 passed=252 failed=0 deferred=56 rejected=20 blocked_by=surface.trim_srf_cache(22),topology.edgeuse_p3(22),query.face_p2(7),topology.face_p2(5) (main: boolean.merge_p2 34, topology.brep_p10 22); the 34 taper merge cases now run the merges and defer later (read-only GetOrCreateUVTrimCurve, the topology solver's CurveOnClassify, SmFace::GetTolerance), the 22 ProjectAndTrim cases defer inside CreateParallelProjectionCurves. main CI e33985411 (2026-10-23): PARTIAL primitive.primitive_creation_p2 cases=328 passed=195 failed=0 deferred=113 rejected=20 blocked_by=boolean.merge_p2(34),surface.trim_srf_cache(57),topology.face_p2(8),topology.face_p4(14). 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); 12 fns; largest: SmPrimitiveCreation::CreateTaperExtrude, SmPrimitiveCreation::CreateSweepAlongPlanarPath, sm_CreateSkinPrimitiveInternal, SmPrimitiveCreation::CreateCone; 45 upstream test entry points reach this unit; PR #250: all twelve owned functions ported through PrimitiveCreationAccess (extends p3's PrimitiveAccess; Unported defaults for B-rep services of unported units), with full tails after unavailable calls. Difftest 328 cases: 129 bit-identical passes (entry-point early exits: cone height/turn/side/axis with the editing flag left on, degenerate sphere/torus radii, full turns through p1, skins of fewer than two profiles with their cleared lists and ownership report, curve sweeps of nothing), 179 deferrals (topology.brep_p3 81, topology.brep_p8 78, topology.brep_p1 20), 20 guarded rejections (UB-215, HANG-35, UB-50, UB-247), 0 failures; no absolute floors; perturb 129/129; fuzz 1000 clean. PR #250 review (2026-10-20): the taper's FFI guard replays FixChainCurvesList (both input passes; the reversed pass only where upstream may take it; with caps 2/3, where upstream may reverse, a closed chain whose short curve meets one over 100 times longer at a corner sharper than 3e-5 rad is refused for the offset end cap's double free, UB-50; with caps 1/3 curves that close a loop while an end meets no other end or more than one, UB-247); review_duplicate_curves.json keeps 31 tapers that run natively; ComputeCrvsNormal failures zero the normal as upstream; api_primitives' sphere/cone/torus stubs wired to their next unported call (topology.brep_p3) and the blend retagged to topology.brep_p8. Construction tails (partial sweeps, taper, pipe, planar path, skin faces, blend) are not certified. PR #250 second review (2026-10-21): SmBrep::SetTolerance, IsManifoldSolid and SmMerge::BooleanTrees wired (topology.brep_p2, boolean.merge_p3); merged #233 f810c60a and main ca3bbd2b. New upstream issues UB-215, HANG-35, WR-191, UB-247. Caller must supply a concrete PrimitiveCreationAccess. See fixtures/primitive.primitive_creation_p2/README.md and plan/findings.md. PrimitiveAccess forwards caller notifications into the shared SweepStore constructor/merge services. Wire (2026-10-23, with primitive.primitive_creation_p3): PrimitiveAccess's B-rep face services and axis classification are real defaults; the runner adapter keeps a tag store and untagged curves. Difftest 328 cases: 196 bit-identical passes (was 146), 0 failed, 112 deferred (was 162; topology.brep_p8 71 -> 0, now topology.brep_p3 81, topology.face_p4 14, surface.trim_srf_cache 6, topology.face_p2 5, curve.curve_p2 3, query.face_p1 3), 20 rejected. Runner on the production adapter (2026-10-23): entry points run through primitive::primitive_creation::model::PrimitiveModel (scratch B-reps, face copies, production face keys) instead of a one-B-rep fixture. Difftest 328 cases: 194 bit-identical passes, 0 failed, 114 deferred (surface.trim_srf_cache 51, boolean.merge_p2 34 via PrimitiveModel::new_merge, topology.face_p4 14, curve.curve_p2 7, topology.face_p2 5, query.face_p1 3), 20 rejected; 10 cases that waited for SmBrep::SmBrep now pass, 12 earlier passes relied on fixture face keys the B-rep caches cannot resolve and now defer (plan/findings.md). KNOWN MISMATCH (stacked merge of #613 with main): skin_concentric_loops runs once #613's shell ray face preparation and #639's forwarded face hooks combine, and its region nesting differs from C++; listed in known_mismatches.toml (findings.md: Region nesting once shell ray face preparation meets the forwarded face hooks). UPDATE (IsInnerShell on the B-rep itself): skin_concentric_loops, gen0201 and gen0214 now defer at surface.trim_srf_cache (TrimSrfCache::build_tree_with_face for a face-owned surface) once IsInnerShell keeps its UV trims; known-mismatch entry removed. UPDATE (CreateFacesFromSurface resets its output): skin_concentric_loops matches C++ once PrimitiveAccess::surface_faces resets its list as upstream's ReSet (CreateSkinFromFaces no longer re-reports the first layer's side faces into the caps); known-mismatch entry removed. 328 cases, 237 pass, 0 failed, 71 deferred, 20 rejected (findings.md: Skin annular caps: CreateFacesFromSurface resets its output list). 2026-10-31, PR #1775 / complete #483 audit: planar_path_sweep_statuses checks mandatory sweep operations and cleans all owned scratch B-reps on error. A plane normal is computed only at a mitre; independent optional cutting-line recovery retained. 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 374 cases, 354 pass, 0 failed/deferred, 20 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
374
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.axis2_placement green geom.extent1d green geom.extent3d green geom.solution_array green geom.tol green geom.vector3d green nurbs.b_spline_curve_p1 green primitive.primitive_creation_p1 green primitive.primitive_creation_p3 green topology.brep_p1 green topology.brep_p4 green topology.brep_p5 green topology.brep_p8 green topology.edge green

Soft dependencies: boolean.merge_p2 green boolean.merge_p3 green boolean.merge_p4 green curve.composite_curve_p2 green curve.curve_p3 partial curve.curve_p4 green curve.curve_p5 partial curve.curve_p6 green curve.curve_p9 green curve.ellipse_p1 green geom.a_object green geom.context green geom.extent2d green geom.object green nurbs.b_spline_curve_n_lib green nurbs.b_spline_curve_p2 green nurbs.b_spline_curve_p3 green nurbs.b_spline_surface_p1 green surface.surface_p2 partial surface.surface_p5 green surface.surface_p7 green topology.brep_p10 green topology.brep_p2 green topology.brep_p3 partial topology.brep_p7 green topology.face_p2 partial topology.face_p3 green topology.face_p4 green topology.shell green topology.vertex green

Dependents: primitive.api_primitives green sweep.api_brep partial

Soft dependents: offset.offset_executive_p1 partial sweep.api_surfaces green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmPrimitiveCreation::CreateConeSmPrimitiveCreation.cpp:785109[PrimitiveCreation::create_partial_cone]
SmPrimitiveCreation::CreateSphereSmPrimitiveCreation.cpp:94191[PrimitiveCreation::create_partial_sphere]
SmPrimitiveCreation::CreateTorusSmPrimitiveCreation.cpp:1085101[PrimitiveCreation::create_partial_torus]
SmPrimitiveCreation::CreateTaperExtrudeSmPrimitiveCreation.cpp:3657879[PrimitiveCreation::create_taper_extrude]
SmPrimitiveCreation::CreateCurveSweepFromEdgesSmPrimitiveCreation.cpp:482931[PrimitiveCreation::create_curve_sweep_from_edges]
SmPrimitiveCreation::CreateCurveSweepFromFacesSmPrimitiveCreation.cpp:487040[PrimitiveCreation::create_curve_sweep_from_faces]
SweepProfilesAlongPathSmPrimitiveCreation.cpp:569350sweep_profiles_along_path (private)
SmPrimitiveCreation::CreateSweepAlongPlanarPathSmPrimitiveCreation.cpp:5775523[PrimitiveCreation::create_sweep_along_planar_path]
SmPrimitiveCreation::CreateSkinPrimitiveSmPrimitiveCreation.cpp:637624[PrimitiveCreation::create_skin_primitive]
sm_CreateSkinPrimitiveInternalSmPrimitiveCreation.cpp:6410323skin_primitive_internal (private)
SmPrimitiveCreation::CreatePipeSweepSmPrimitiveCreation.cpp:690648[PrimitiveCreation::create_pipe_sweep]
SmPrimitiveCreation::CreateBlendPrimitiveSmPrimitiveCreation.cpp:758639[PrimitiveCreation::create_blend_primitive_between_faces]
Module file-header table (13 rows)
RustUpstream
[PrimitiveCreation::create_partial_cone]six-argument CreateCone
[PrimitiveCreation::create_partial_sphere]four-argument CreateSphere
[PrimitiveCreation::create_partial_torus]five-argument CreateTorus
[PrimitiveCreation::create_taper_extrude]CreateTaperExtrude
[PrimitiveCreation::create_curve_sweep_from_edges]CreateCurveSweepFromEdges
[PrimitiveCreation::create_curve_sweep_from_faces]CreateCurveSweepFromFaces
[PrimitiveCreation::create_pipe_sweep]CreatePipeSweep
[PrimitiveCreation::create_sweep_along_planar_path]eight-argument static CreateSweepAlongPlanarPath
sweep_profiles_along_path (private)SweepProfilesAlongPath
[PrimitiveCreation::create_skin_primitive]nine-argument CreateSkinPrimitive
skin_primitive_internal (private)sm_CreateSkinPrimitiveInternal
[PrimitiveCreation::create_blend_primitive_between_faces]face/edge CreateBlendPrimitive
[PrimitiveCreationAccess]B-rep services these entry points call

Upstream tests reaching this unit

SM_API_test:TestSmCreateSkinPrimitive, SM_API_test:TestSmPipeSweep, SM_API_test:TestSmCurveSweepFromFaces, SM_API_test:TestSmCurveSweepFailureCleanup, SM_API_test:TestSmCreateDraftSweep, SM_API_test:TestSmTaperExtrude