solidcore

Units / query

query.brep green

Layer
48
Upstream lines
517
Functions
17
Rust module
query::brep

Status history

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

Source: crates/solidcore/src/query/brep.rs

Upstream: source/SMLib/inc/SmPolyDecimate.h, source/SMLib/src/SmBrep.cpp, source/SMLib/src/SmPolyDecimate.cpp, source/SM_API/src/SmApiSurfaces.cpp

Port-plan notes

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

2026-10-30 (box and classify: the Rust side now builds its B-rep itself, query_face_p1::own_model: crate::own_builder for shim-built sources, the Rust .smb reader for files, renumbered into the shim's order; it no longer imports the C++ export, no longer defers sources the export flattened (inexact) and no longer gives unowned geometry an owner, own_arena_geometry): the previous GREEN below rested on Rust-side inputs imported from the C++ build for every box and classify case, so its box and classify counts compared the C++ B-rep with itself; counts to be re-measured. PR #1328 (2026-10-27), pinned v1.0.1: PASS query.brep cases=1172 passed=1172 failed=0 deferred=0 with_values=1172 max_rel_err=0. Shared face-bearing B-rep boundary solves use the retained owner-preserving classifier copy and live face-aware cache services; shared targets without faces keep the read-only path. main CI e33985411 (2026-10-23): PARTIAL query.brep cases=1172 passed=1115 failed=0 deferred=57 blocked_by=topology.edgeuse_p3(2),topology.face_p2(55). PARTIAL (PR #329, takeover of #101 with 0xlillith's permission; #332's runner fixes applied): all 17 fns in query::brep. difftest 1172 cases (572 fixture + 600 generated), 925 pass bit-identical, 0 fail, 247 deferred (geom.tol 74: SmTol::GetZoneTol3d(const SmObject*) on ray hits; topology.face_p2 45; surface.cone_p1 49 / surface.sphere 18 / surface.surf_of_extrusion_p2 41 / harness:analytic-geometry-export 20: analytic geometry the shared export flattens); perturb 923/923; max_rel_err 0. Shared B-rep fixture kinds 7 (SmApiCreateBox solid) and 8 (points and wire segments at given tolerances, up to 600/150) added. Point3DClassify is BrepQuery::point_3d_classify (lazy SM_OC_BREP cache, BrepIdentity) and BrepClassifier (on a private copy for shared B-reps). Back-edges wired: CalculateBoundingBox/Tight/Lock/UnLock (topology.brep_p1/p2/p5/p6/p9/p10, topology.brep_cache, topology.shell, heal.stitch_p1/p2, blend.hcr, mass.integrator, query.api_queries, boolean.merge_p1 SmTemporaryBrepTransform), Point3DClassify (boolean.merge_p1/p4/p5, query.api_queries, topology.proto_topology_p3 through ProtoBrep::brep_point_3d_classify), RayFire (topology.brep_p9 FindInfiniteRegion), LocalCurveSector (topology.shell sector). Remaining DISPATCH GAPs (callee ported, caller API cannot reach it; follow-ups in findings): topology.brep_p10 merge-curves world (topology.brep_p2 API), geom.object SmShape over B-rep keys. topology.brep_p6 stops at an OMITTED marker for its own TestClosureSplitRegion remainder after the real box. UPDATE 2026-10-23 (claude/face-p1-hooks): SmFace::Point3DClassify wired in SmTLSPointFace::SolveIt (topology_solver p1, on a copy of the B-rep TopologyObjects::face_entity names): the 29 query.face_p1 deferrals are gone; cases=1172 passed=1115 failed=0 deferred=57 (curve.curve_p2 9, topology.edgeuse_p3 2, topology.face_p2 46), max_rel_err 0 (Mac Studio run; Linux CI is the gate). UPDATE PR #613 after #616/#618: single-pass mutable geometry services for production shell rays and the region-nesting B-rep ray entry of #619; cache-first face classification and explicit construction identities. Other #619 entrypoints remain separate. Local C9 difftest: 1172 cases, 1115 pass bit-identical, 0 fail, 57 deferred; topology.shell: 911 cases, 907 pass, 0 fail, 4 deferred. Generic read-only fallback retains bounded preparation/restarts (findings.md). UPDATE (owning-face caches for the topology solver's point/face solve): the point/face global point solve goes through the live objects' surface context, so 26 of the topology.face_p2 deferrals compare and pass: PARTIAL query.brep cases=1172 passed=1169 failed=0 deferred=3 blocked_by=topology.face_p2(3) (the 3 are SimpleCoincidenceChecker's point solve inside GlobalLineIntersect, which takes no context yet). GREEN (owning-face caches in GlobalLineIntersect's coincidence check): SimpleCoincidenceChecker's point solve gets the caller's surface context, so the 3 ray cases left compare. PASS query.brep cases=1172 passed=1172 failed=0 deferred=0.

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
1,172
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: geom.attribute green geom.extent3d green geom.object green geom.solution_array green geom.vector3d green intersect.point_class green topology.brep_p1 green topology.brep_p2 green

Soft dependencies: geom.extent2d green geom.tol green intersect.topology_solver_p2 green query.edge green query.face_p1 green query.face_p3 green surface.surface_p1 green surface.surface_p2 partial surface.surface_p7 green topology.edge green topology.face_p2 partial topology.vertex green

Dependents: query.api_queries green topology.brep_cutting partial

Soft dependents: blend.hcr green boolean.merge_p1 green boolean.merge_p4 green boolean.merge_p5 green heal.stitch_p1 green heal.stitch_p2 green sweep.topology_sweep green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmDecimateVertexAttr::SmDecimateVertexAttrSmPolyDecimate.h:8012[decimate_vertex_attribute], [DecimateVertexData]
SmDecimateVertexAttr::~SmDecimateVertexAttrSmPolyDecimate.h:978
SmQuadricVertexAttr::SmQuadricVertexAttrSmPolyDecimate.h:15313[quadric_vertex_attribute], [QuadricVertexData]
SmQuadricVertexAttr::~SmQuadricVertexAttrSmPolyDecimate.h:1711
SmQuadricEdgeAttr::SmQuadricEdgeAttrSmPolyDecimate.h:2499[quadric_edge_attribute], [QuadricEdgeData]
SmQuadricEdgeAttr::~SmQuadricEdgeAttrSmPolyDecimate.h:2631
SmBrep::CalculateBoundingBoxSmBrep.cpp:1009118[calculate_bounding_box], [BoundingBoxOptions]
SmBrep::CalculateTightBoundingBoxSmBrep.cpp:114650[calculate_tight_bounding_box]
SmBrep::LockBoundingBoxSmBrep.cpp:121822[lock_bounding_box]
SmBrep::UnLockBoundingBoxSmBrep.cpp:124612[unlock_bounding_box]
SmBrep::Point3DClassifySmBrep.cpp:24960155[BrepQuery::point_3d_classify]
SmQuadricVertexAttr::MakeCopySmPolyDecimate.cpp:42113[Attribute::make_copy] (data cloned)
SmQuadricEdgeAttr::MakeCopySmPolyDecimate.cpp:44112[QuadricEdgeData::make_copy]
SmDecimateVertexAttr::MakeCopySmPolyDecimate.cpp:46013[DecimateVertexData::make_copy]
SmApiEvaluateSurfacePointSmApiSurfaces.cpp:55024[evaluate_surface_point]
SmApiEvaluateSurfaceNormalSmApiSurfaces.cpp:58124[evaluate_surface_normal]
SmApiEvaluateSurfaceDerivativesSmApiSurfaces.cpp:61130[evaluate_surface_derivatives]
Module file-header table (20 rows)
RustUpstream
[calculate_bounding_box], [BoundingBoxOptions]SmBrep::CalculateBoundingBox
[calculate_tight_bounding_box]SmBrep::CalculateTightBoundingBox
[lock_bounding_box]SmBrep::LockBoundingBox
[unlock_bounding_box]SmBrep::UnLockBoundingBox
[BrepQuery::point_3d_classify]SmBrep::Point3DClassify
[BrepQuery::first_face_hit], [Ray], [FaceRayHit](none: the first face a ray meets, on SmBrep::RayFire's solve)
[face_hits], [FaceHit](none: every face a ray meets, on SmApiIntersectCurveFace per face)
[BrepQuery], [BrepIdentity]the B-rep's SM_OC_BREP cache (CacheMakeOrValidate) and pointer identities
[LazyBrep]the this of the const box methods, which may edit the B-rep
[BrepClassifier]Point3DClassify on a B-rep held const (its lazily made UV trim curves on a copy)
[evaluate_surface_point]SmApiEvaluateSurfacePoint
[evaluate_surface_normal]SmApiEvaluateSurfaceNormal
[evaluate_surface_derivatives]SmApiEvaluateSurfaceDerivatives
[PolyVertexClass]SmPolyVertexClass (SmPoly.h)
[decimate_vertex_attribute], [DecimateVertexData]SmDecimateVertexAttr::SmDecimateVertexAttr (~ is Drop)
[DecimateVertexData::make_copy]SmDecimateVertexAttr::MakeCopy
[quadric_vertex_attribute], [QuadricVertexData]SmQuadricVertexAttr::SmQuadricVertexAttr (~ is Drop)
[Attribute::make_copy] (data cloned)SmQuadricVertexAttr::MakeCopy
[quadric_edge_attribute], [QuadricEdgeData]SmQuadricEdgeAttr::SmQuadricEdgeAttr (~ is Drop)
[QuadricEdgeData::make_copy]SmQuadricEdgeAttr::MakeCopy

Upstream tests reaching this unit

prog_test:my_test_surface_closest_point, prog_test:my_test_drop_point, prog_test:my_test_matrix, prog_test:my_test_reversed_line_join, SM_API_test:TestSmCreateRectangle, SM_API_test:TestSmCreateRegularPolygon