solidcore

Units / primitive

primitive.primitive_creation_p1 green

Layer
49
Upstream lines
2,367
Functions
21
Rust module
primitive::primitive_creation::p1

Status history

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

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

Upstream: source/SMLib/inc/SmPrimitiveCreation.h, source/SMLib/src/SmPrimitiveCreation.cpp

Port-plan notes

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

2026-10-29 (SM_API 1.0.1 parity, S4): ports static SmPrimitiveCreation::OffsetProfile as primitive_creation::p1::offset_profile (new file p1/offset_profile.rs); difftested through primitive.api_primitives' offset_profile cases. UPDATE (Boolean2D cover face context): both CoverCoincidentSurface passes run on the faces' own surfaces under a BrepFaceServices solve context (SmFace::PointClassify in GlobalPointSolve, RemoveUVTrimCurves per face in call order); the 10 coplanar Boolean2D cases now compare: GREEN cases=773 passed=764 failed=0 deferred=0 rejected=9. PR #738: Boolean2D's IntersectInsertRelate, GetCommonEdges/Vertices, Relate, GetOtherMate/GetBrepMate and DeleteFaces run on merge p4's KernelManifoldIntersector; the op-6 runner builds real CreateFaceFromSurface faces in SmBrep(SM_USE_DEFAULT) operands and compares a successful result's counts and geometry. The 10 coplanar cases now defer earlier, in CoverCoincidentSurface: STEPInversion of a face-owned surface reaches GlobalPointSolve's trimmed-cache point test (SmFace::PointClassify, no face context there, surface/surface/p4.rs). PARTIAL cases=773 passed=754 failed=0 deferred=10 rejected=9. main CI e33985411 (2026-10-23): PARTIAL primitive.primitive_creation_p1 cases=773 passed=740 failed=0 deferred=24 rejected=9 blocked_by=boolean.topology_intersector_p2(10),surface.trim_srf_cache(8),topology.edgeuse_p3(2),topology.face_p2(4). PARTIAL (PR #213 review, 2026-10-20, canonical main e5f3e441): 773 cases, 689 passed, 0 failed, 75 deferred (boolean.topology_intersector_p2 10, topology.brep_p3 6, topology.brep_p8 59), 9 rejected, max_rel_err=0, no absolute floors. Both MakeFaceWithCurves adapters now call topology::brep::p7 with caller region/domain, loops, 3D/UV curves and orientations. Constructors now forward caller NotifyEnv records/attributes/keys required by current p7; the primitive fixture creates a real infinite region for current p9 validation. StitchAndOrient, Transform (scale=None, scale_tolerances=true), and RemoveTopologicalEdgesAndVertices (no keep lists, caller NotifyEnv forwarded) call topology::brep::p5. IntersectInsertRelate and DeleteFaces still require a retained session adapting Boolean2D to merge_p4 ArenaPair: common-pair identities, relations, and operand-qualified notifications must survive both stages; their downstream mutations are not certified. Boolean2D uses EFF_ZERO_DEG (0.0001 degrees); kernel tests pin angular rejection/state restoration and plane-domain coverage before intersection. 32 new boolean cases compare non-planar/offset/tilted rejection and empty paths; 10 valid coplanar cases defer at IntersectInsertRelate. Four rear-X-tilt cone inputs and 44 nonempty line/circle/arc/skew-line sweeps defer at face construction, using both B-spline and real analytic generators. Four negative full-circle sweeps are rejected by an exact cylinder-branch preflight after a native nontermination was confirmed in AdjustSTEPUVDomain (plan/upstream-issues.md); negative line/open-arc sweeps remain accepted. Bottom cylindrical-box points preserve signed zero. Primitive topology, caps and downstream boolean mutations remain uncertified. 19 fns; largest: SmPrimitiveCreation::Boolean2D, SmPrimitiveCreation::CreateLinearSweep, SmPrimitiveCreation::CreateSphereNoPole, sm_CreateAnalyticRotationalSweep; cycle back-edges (call into later units; stub or co-port): boolean.topology_intersector_p1(5), sweep.topology_sweep(4), boolean.topology_intersector_p2(3); unit-SCC #22 (220 units); 131 upstream test entry points reach this unit; 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; the type comes from SmPrimitiveCreation.h) Review integration (PR #213): merge_p3 BooleanLists delegates planar operations to PrimitiveCreation::boolean_2d with fresh operand marks and caller notifications. Boolean2D still needs a retained ArenaPair intersector/relations session with an operand-qualified notification/key namespace for both Breps; its primary-only NotifyEnv and typed common-pair lists are not that adapter. The existing merge_p4 ArenaPair adapter is present, not missing. Failed circle construction maps non-Unported geometry errors to SM_ERR. API UPDATED in primitive.primitive_creation_p3 (PR #233), after main 4db3d660: create_cylindrical_box, create_sphere_no_pole and boolean_2d take caller NotifyEnv for their p7 face-construction tails; notification key_of supplies face identities. UPDATE 2026-10-23 (branch claude/edge-handles): the 4 curve.curve_p2 GetNaturalInterval deferrals resolve (curve-solver ParameterDomains); two of them (linear_circle_cap1_distance0, linear_analytic_circle_cap1_distance0) then compared face counts from the B-rep arena (4, including two face records with no face use) against the shim's SmBrep::GetFaces (2); the runner now counts faces, edges and vertices through topology::brep::p1::faces/edges/vertices as the shim does (findings.md). PARTIAL primitive.primitive_creation_p1 cases=773 passed=740 failed=0 deferred=24 max_rel_err=0e0 with_values=740 no_values=0 vacuous=0 rejected=9 blocked_by=boolean.topology_intersector_p2(10),surface.trim_srf_cache(8),topology.edgeuse_p3(2),topology.face_p2(4). UPDATE PR #613: use caller notification identities consistently in cylindrical-box and pole-free-sphere faces and final region nesting. Geometry records now compare sampled curves/surfaces, tolerances and per-edge stored trims: 773 cases, 754 pass bit-identical, 0 fail, 10 deferred (boolean.topology_intersector_p2), 9 native rejections; local macOS C9 reference. 2026-10-31, PR #1775 / complete #483 audit: Kernel-aware pivot and extension variants use primitive_path_curve_statuses. Placement-status policy now includes boxes, normals, angles and path evaluation; legacy signatures/defaults 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 773 cases, 768 pass, 0 failed/deferred, 5 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
773
Stored error outcomes
11
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.curve_p2 green curve.line green geom.axis2_placement green geom.context 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_p1 green nurbs.b_spline_surface_p1 green nurbs.b_spline_surface_p2 green surface.cone_p1 green surface.plane_p1 partial surface.surf_of_extrusion_p1 green surface.surface_p2 partial topology.brep_p1 green topology.brep_p5 green topology.brep_p8 green topology.edge green topology.edgeuse_p1 green topology.face_p2 partial

Soft dependencies: curve.curve_p3 partial curve.curve_p5 partial curve.curve_p6 green curve.curve_p8 green curve.ellipse_p1 green geom.vector2d green intersect.surface_drop_lib_p3 green nlib.crv_basic green nlib.crv_common green nlib.geom green nlib.srf_basic green nlib.srf_common green nlib.srf_nurb green nurbs.b_spline_curve_n_lib green nurbs.b_spline_curve_p2 green surface.sphere green surface.surface_p3 green surface.surface_p7 green surface.torus partial topology.brep_p3 partial topology.brep_p4 green topology.brep_p7 green topology.face_p4 green topology.shell green topology.topology green

Dependents: primitive.api_primitives green primitive.primitive_creation_p2 green primitive.primitive_creation_p3 green

Soft dependents: boolean.merge_p3 green offset.offset_executive_p1 partial sweep.api_brep partial sweep.api_surfaces green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmPrimitiveCreation::SmPrimitiveCreationSmPrimitiveCreation.h:1549[PrimitiveCreation]
SmPrimitiveCreation::~SmPrimitiveCreationSmPrimitiveCreation.h:1655
SmPrimitiveCreation::CreateRectangleSmPrimitiveCreation.cpp:4350
SmPrimitiveCreation::CreateCircleSmPrimitiveCreation.cpp:14952
SmPrimitiveCreation::CreateBoxSmPrimitiveCreation.cpp:270121
SmPrimitiveCreation::CreateCylindricalBoxSmPrimitiveCreation.cpp:424216
sm_CreateConicSolidSmPrimitiveCreation.cpp:64757
SmPrimitiveCreation::CreateConeSmPrimitiveCreation.cpp:71120
SmPrimitiveCreation::CreateCylinderSmPrimitiveCreation.cpp:73731
SmPrimitiveCreation::CreateSphereSmPrimitiveCreation.cpp:90125
SmPrimitiveCreation::CreateTorusSmPrimitiveCreation.cpp:103931
SmPrimitiveCreation::CreateLinearSweepSmPrimitiveCreation.cpp:1197345
sm_CreateAnalyticRotationalSweepSmPrimitiveCreation.cpp:2280309
sm_FindPivotPointSmPrimitiveCreation.cpp:329540[find_pivot_point]
ExtendPathCurvesSmPrimitiveCreation.cpp:552861[extend_path_curves]
PositionProfileCurvesSmPrimitiveCreation.cpp:559687[position_profile_curves]
SmPrimitiveCreation::CreateSphereNoPoleSmPrimitiveCreation.cpp:6964314
SmPrimitiveCreation::CreateConeEllipticEndsSmPrimitiveCreation.cpp:728880
SmPrimitiveCreation::Boolean2DSmPrimitiveCreation.cpp:7641500
SmPrimitiveCreation::InitEntityMapsSmPrimitiveCreation.cpp:81477[PrimitiveCreation::init_entity_maps]
SmPrimitiveCreation::CopyEntityMapsSmPrimitiveCreation.cpp:81617[PrimitiveCreation::copy_entity_maps]
Module file-header table (8 rows)
RustUpstream
[PrimitiveCreation]SmPrimitiveCreation
[EntityMaps]the four m_vMap* members
[PrimitiveCreation::init_entity_maps]InitEntityMaps
[PrimitiveCreation::copy_entity_maps]CopyEntityMaps
[find_pivot_point]sm_FindPivotPoint
[extend_path_curves]ExtendPathCurves
[position_profile_curves]PositionProfileCurves
[offset_profile]static OffsetProfile

Upstream tests reaching this unit

SM_API_test:TestSmCreatePlanarCircle, SM_API_test:TestSmCreatePlane, SM_API_test:TestSmCreateSwungPrimitive, prog_test:my_test_tracks_nested_geometry_and_resets, SM_API_test:TestSmAdvancedStitch, SM_API_test:TestSmEdgeCurveOwnership