solidcore

Units / topology

topology.shell green

Layer
36
Upstream lines
1,085
Functions
38
Rust module
topology::shell

Status history

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

Source: crates/solidcore/src/topology/shell.rs

Upstream: source/SMLib/inc/SmRegion.h, source/SMLib/inc/SmShell.h, source/SMLib/src/SmRegion.cpp, source/SMLib/src/SmShell.cpp

Port-plan notes

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

2026-10-30 (the Rust side reads an .smb fixture with the Rust reader, crate::own_reader::brep_in_order under Conventions::EDGEUSE_GRAPH, renumbered into the shim's traversal order, instead of importing topology.edgeuse_p1's graph export; shim-built sources were already built in Rust): the GREEN below rested on Rust-side .smb B-reps imported from the C++ export, so it overstated what was verified for the file cases; counts on the Rust-read inputs follow this change's difftest run, and any new mismatch gets a finding with its case IDs. #1419 WP2 / #1473 (PR #1472): SmShell::IsInnerShellOf -> topology::shell::is_inner_shell_of (opt-in Kernel::fixes.shell_inner_shell_of_statuses, WR-497); difftest 944 cases, 944 passed, 0 deferred (33 new IsInnerShellOf cases on box/sphere bodies with voids and islands at three scales). GREEN topology.shell: difftest 911 cases, 911 passed, 0 failed, 0 deferred (cases_total = 911, cases_passed = 911, cases_failed = 0, cases_deferred = 0). Previously: PR #639 (2026-10-23, WithMadeTrimCurves pass-through): difftest 911 cases, 909 pass, 0 failed, 2 deferred (topology.face_p2 GetTolerance; was 905 / 6). PARTIAL (port by @0xlillith in PR #80, finished in PR #154): difftest 911 cases, 892 pass bit-identical, 0 failed, 19 deferred (query.brep 11: SmBrep::CalculateBoundingBox, and the 8 ray_closed_* cases whose boundary-face shape needs the cached B-rep (harness-limited, below); query.face_p1 4: SmFace::CalculateBoundingBox; topology.face_p3 4: SmFace::CreateUVTrimCurves reached through SmTopologyTraverser::IsInnerShell (was topology.face_p1 CalculateUVDomainFromUVTrimCurves before PR #148 wired it)), max_rel_err 0, no absolute floors; --perturb SENSITIVE 892/892; probe (--seeds 3000) 3895 cases, 0 failed, no crash. PR #80: RegionRef/RegionLookup resolve native region identities against the live arenas (geom.attribute green, geom.a_object region propagation compared), ordered wire traversal, child transfer with literal face-use sibling links, RayFire, degeneracy, OrderShells. PR #154 (after merging main): the shell calls its owners on main (topology::edge::{vertices, edgeuses, is_wire}, topology::vertex::edges, topology_traverser::is_inner_shell, so Shell::is_inner_shell / order_region_shells take &mut Kernel); wired UNPORTED(topology.shell) in mass::integrator (SmRegion::IsVoid) and topology_traverser (RemoveShell -> transfer_children, FaceuseShellReplacement -> shell::move_faceuse: 7 traverser cases now compared); the topology.vertexuse-style difftest importers (vertexuse, vertex, edge, face_p2, and through them traverser, trimming_tools, heal.gap, heal.heal_data_p2) now read the shared version-3 shell state block (sc_topology_fixture::append_shell_state, appended by every export: infinite region, region void flags, wire/vertex shell heads, vertex-use lists, face-use next/last links) instead of inferring those fields; the walks register SmBrep::GetEdges and the vertex-use lists first. Stubs left: UNPORTED(query.face_p1) SmFace::CalculateBoundingBox, UNPORTED(query.brep) SmBrep::CalculateBoundingBox, UNPORTED(topology.brep_p2) SmBrep::LocalCurveSector. CO-PORTED: SmOwningTopology::Remove/PostInsert of a face use on the typed face-use list (topology::shell::move_faceuse; the topology.proto_topology_p1 version works on ObjectKey records), SmBrep::GetEdges (no filter) as topology::shell::brep_get_edges = the B-rep edge arena in insertion order (topology.brep_p1; valid for importers that register GetEdges first, as every fixture walk now does), minimum default-tight CalculateBoundingBox branches (query.face_p1). Plan notes: 37 fns; largest: SmShell::RayFire, SmShell::TransferChildrenTo, SmShell::GetWireEdges, SmRegion::OrderShells; cycle back-edges (call into later units; stub or co-port): topology.edge(5), query.face_p1(2), topology.brep_p1(2), query.brep(1), topology.brep_p2(1), topology.topology_traverser(1), topology.vertex(1), topology.vertexuse(1); unit-SCC #22 (220 units); 319 upstream test entry points reach this unit; CO-PORTED in topology.edgeuse_p1 (PR #55): SmRegion (m_pListOwner != NULL only) -> topology::Region, SmShell::m_pListOwner -> topology::Shell::region; SmShell::GetRegion, GetBrep -> topology::edgeuse::p1::{shell_region, shell_brep}. Review round (PR #154): the generator now draws random operations over vertex/face/network/.smb/mixed fixtures (TransferChildrenTo with any shell pair, NULL/duplicate candidates and preceding transfers, arbitrary SM_TYPE codes, ray, degeneracy, ordering, filtering); a new native fixture kind mixed (a face plus N wire networks in one B-rep) and pre transfers reach face->wire, wire->face, mixed->empty and wire->wire; the transfer shim rejects exactly the inputs that crash C++ (NULL candidate on a reading branch, GetWireEdges on a wire shell without head) and both sides then return rejected_input. RayFire is compared only on the empty-shape branch (EmptyRayWorld): solution selection, parameter filtering, LoadFromIntersection and line segments need a real TopologyObjects world over the imported B-rep (topology::brep_cache::BrepObjects over a built BrepCache = query.brep, plus SmBrep::LocalCurveSector = topology.brep_p2). The 8 ray_closed_* cases are recorded as harness-limited: EmptyRayWorld::shell_ray_shape defers any non-empty boundary-face shape as UNPORTED(query.brep), so they stay deferred (never FAIL) when query.face_p1 lands; swap in BrepObjects when query.brep and topology.brep_p2 are ported. Review round 2 (PR #154): GetWireEdges, GetMatedShells and RayFire now claim and lock a context mark like SmNewMarkAndLock (geom::context::with_mark_lock, ALL_MARKS) and mark through topology_traverser::Marks (new Entity::Shell), so wire_edges / Shell::mated_shells / ray_fire / transfer_children / remove_shell / the degeneracy functions take &mut Kernel; the difftest compares per call how far each of the 5 context mark counters advanced and that none stays locked (topology.shell wires, query, transfer and ray outputs, shim MarkSnap). The ray shim guard rejects non-finite start/direction/tolerance/radius only when a shell has boundary faces (it reaches the solver there); empty-shape runs compare them (generator draws nan/inf). SmRegion::Remove is not used by merge_p1 any more (see boolean.merge_p1); region_remove_shell stays as the CO-PORT of SmOwningTopology::Remove (also recorded in topology.proto_topology_p1). Missing region context in the geom.attribute / geom.a_object handlers is Unported(topology.shell), not InvalidInput. Face-use sibling links, once Some, win over Shell::members (documented in shell.rs). UPDATE (PR #145, topology.brep_p1): the SmBrep::GetEdges co-port topology::shell::brep_get_edges is replaced by the owner's port topology::brep::p1::edges (list order); report unchanged (911 cases, 892 pass, 0 failed, 19 deferred). [topology.face_p3 wired (PR #139): 911 cases, 892 pass, 0 failed, 19 deferred (query.brep 11, query.face_p1 4, topology.face_p4 4: the 4 CreateUVTrimCurves deferrals now defer inside it at SmFace::GetUpwardLoopuses)] Re-run in PR #238 (query.face_p1): shell_bounds_for_degeneracy / region_bounds_for_degeneracy call query::face::p1 (co-port removed); 911 cases, 896 pass, 0 failed, 15 deferred (query.brep 11, topology.face_p3 4); after merging main with #139: 911 cases, 896 pass, 0 failed, 15 deferred (query.brep 11, topology.face_p4 4). UPDATE after topology.brep_p2 (PR #149): the ShellRayWorld::shell_ray_sector default (UNPORTED(topology.brep_p2) SmBrep::LocalCurveSector) is retagged UNPORTED(query.brep): the generic default has neither the B-rep nor an entity classification; the world over the B-rep cache (query.brep) overrides it with topology::brep::p2::local_curve_sector. Unreachable today (EmptyRayWorld defers at the shape first); report unchanged (911 cases, 892 pass, 19 deferred). CO-PORTED in topology.brep_p3 (PR #204): SmOwningTopology::PostInsert of a shell into a region -> topology::shell::region_post_insert_shell; SmOwningTopology::Remove / PostInsert of a single face use -> topology::shell::shell_remove_faceuse / shell_post_insert_faceuse (Remove's SM_ERR as SolidError::sm_err; PostInsert, unchecked upstream, refuses a member some list still holds); SmShell::GetSize -> topology::shell::shell_list_size made pub. Wired from topology::brep::p3 (DeleteFace, MergeBrep / copy constructors, SqueezeEdge, MakeWireEdge via brep::p2). Report after those co-ports unchanged case by case (911 cases, 892 pass, 19 deferred). UPDATE (PR #526): RayFire runs through a production ShellRayWorld (query::brep::BrepQuery: BrepObjects view of the B-rep without its cache, built from &Brep for the shape solve only); the runner uses it instead of EmptyRayWorld and gives its graph import the arena-identity geometry owners upstream file B-reps have (SmSurface::GetFace). SmShape::SmShape's SmNewMarkAndLock now advances the context mark (geom.object). Re-run: 911 cases, 903 pass, 0 fail, 8 deferred (curve.crv_on_surf 4, geom.tol 4: SmTol::GetZoneTol3d(const SmObject*) in the point-face ray solve).

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
944
Stored error outcomes
9
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.extent3d green geom.object green geom.solution_array green geom.vector3d green topology.edgeuse_p1 green topology.proto_topology_p1 green topology.topology green

Soft dependencies: geom.context green geom.tol green intersect.point_class green intersect.topology_solver_p2 green nurbs.b_spline_curve_p1 green

Dependents: blend.fillet_executive_p1 green boolean.merge_p1 green boolean.merge_p4 green offset.offset_executive_p2 partial query.face_p1 green sweep.topology_sweep green topology.brep_constructor green topology.brep_p1 green topology.brep_p10 green topology.brep_p2 green topology.brep_p3 partial topology.brep_p4 green topology.brep_p5 green topology.brep_p6 green topology.brep_p7 green topology.brep_p9 green

Soft dependents: blend.fillet_geom_p1 green blend.fillet_solver_p1 green blend.hcr green boolean.merge_p2 green boolean.merge_p3 green boolean.merge_p5 green heal.heal_data_p1 green heal.heal_data_p3 green mass.integrator partial primitive.primitive_creation_p1 green primitive.primitive_creation_p2 green primitive.primitive_creation_p3 green query.api_queries green topology.edge green topology.face_p4 green topology.loopuse green topology.topology_traverser green topology.trimming_tools green topology.vertex green topology.vertexuse green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmRegion::SmRegionSmRegion.h:436
SmRegion::~SmRegionSmRegion.h:505
SmRegion::IsVoidSmRegion.h:1191[Region::get_shells], [Region::is_void], [Region::set_is_void]
SmRegion::GetClassStringSmRegion.h:1461
SmRegion::GetTypeSmRegion.h:1461
SmRegion::GetTypeStringSmRegion.h:1461
SmRegion::GetShellsSmRegion.h:1579[Region::get_shells], [Region::is_void], [Region::set_is_void]
SmRegion::GetBrepSmRegion.h:1725[shell_region], [shell_brep]
SmShell::GetClassStringSmShell.h:1371
SmShell::GetTypeSmShell.h:1371
SmShell::GetTypeStringSmShell.h:1371
SmRegion::IsDegenerateSmRegion.cpp:27316[shell_is_degenerate], [region_is_degenerate]
SmRegion::IsInfiniteRegionSmRegion.cpp:2966[Region::is_infinite_region]
SmRegion::SetIsVoidSmRegion.cpp:3086[Region::get_shells], [Region::is_void], [Region::set_is_void]
SmRegion::OrderShellsSmRegion.cpp:32463[Shell::is_inner_shell], [order_region_shells]
SmRegion::IsKindOfSmRegion.cpp:5204
SmShell::SmShellSmShell.cpp:338
SmShell::~SmShellSmShell.cpp:4713
SmShell::GetWireEdgesSmShell.cpp:130100[wire_edges]
SmShell::TransferChildrenToSmShell.cpp:364160[transfer_children]
SmShell::GetMatedShellsSmShell.cpp:53644[Shell::is_closed], [Shell::mated_shells]
SmShell::RayFireSmShell.cpp:592183[ray_fire]
SmShell::IsInnerShellSmShell.cpp:79311[Shell::is_inner_shell], [order_region_shells]
SmShell::IsInnerShellOfSmShell.cpp:827335[is_inner_shell_of], [SM_TRUE], [SM_FALSE], [SM_UNSURE]
SmShell::IsDegenerateSmShell.cpp:116820[shell_is_degenerate], [region_is_degenerate]
SmShell::IsClosedSmShell.cpp:120022[Shell::is_closed], [Shell::mated_shells]
SmShell::GetWireEdgeSmShell.cpp:137911[Shell::wire_edge], [Shell::vertex]
SmShell::GetRegionSmShell.cpp:14094[shell_region], [shell_brep]
SmShell::GetBrepSmShell.cpp:14194[shell_region], [shell_brep]
SmShell::GetFaceusesSmShell.cpp:14299[Shell::get_faceuses], [Shell::first_faceuse]
SmShell::IsVertexShellSmShell.cpp:14442
SmShell::IsWireShellSmShell.cpp:14522
SmShell::IsFaceuseShellSmShell.cpp:14602
SmShell::IsUnknownShellSmShell.cpp:14682
SmShell::SetShellTypeSmShell.cpp:14762
SmShell::GetVertexSmShell.cpp:148411[Shell::wire_edge], [Shell::vertex]
SmShell::GetFirstFaceuseSmShell.cpp:15019[Shell::get_faceuses], [Shell::first_faceuse]
SmShell::IsKindOfSmShell.cpp:18844
Module file-header table (25 rows)
RustUpstream
[ShellType], [ShellMembers]m_tShellType, typed m_pList contents
[Shell::new], [Region::new], implicit Dropconstructors, destructors
[Shell::type_string], [Shell::class_string], [Shell::is_kind_of], [Region::type_string], [Region::class_string], [Region::is_kind_of]SM_COMMON names and full base-class chain
[Shell::get_faceuses], [Shell::first_faceuse]GetFaceuses, GetFirstFaceuse
[Shell::wire_edge], [Shell::vertex]GetWireEdge, GetVertex
[Shell::is_closed], [Shell::mated_shells]IsClosed, GetMatedShells
[shell_region], [shell_brep]GetRegion, GetBrep
[RegionLookup], [RegionRef]caller-supplied resolution of implicit native region pointers
[wire_edges]SmShell::GetWireEdges
[ray_fire]SmShell::RayFire (partial output state retained)
[transfer_children]SmShell::TransferChildrenTo
[move_faceuse]SmOwningTopology::Remove + PostInsert of a face use (typed list)
[post_insert_faceuse]SmOwningTopology::PostInsert of a new face use (typed list)
[shell_is_degenerate], [region_is_degenerate]IsDegenerate (native default tolerance)
shell_bounds_for_degeneracy, region_bounds_for_degeneracydefault-tight CalculateBoundingBox (query::face::p1), status kept beside the partial box
[faceuse_sibling_links]typed SmTopology::GetNext / GetLast for face uses
topology::edge::{vertices, edgeuses, is_wire}, topology::vertex::edgesSmEdge::GetVertices, GetEdgeuses, IsWire, SmVertex::GetEdges (callees, no filters)
[Region::get_shells], [Region::is_void], [Region::set_is_void]GetShells, IsVoid, SetIsVoid
[Region::is_infinite_region]IsInfiniteRegion
[Shell::is_inner_shell], [order_region_shells]IsInnerShell, OrderShells
[region_remove_shell]SmOwningTopology::Remove of a shell from its region
[region_post_insert_shell]SmOwningTopology::PostInsert of a shell into a region (CO-PORTED, topology.brep_p3)
[shell_remove_faceuse], [shell_post_insert_faceuse]SmOwningTopology::Remove / PostInsert of one face use (CO-PORTED, topology.brep_p3)
[shell_list_size]SmShell::GetSize (m_lListSize; CO-PORTED, topology.brep_p3)
[is_inner_shell_of], [SM_TRUE], [SM_FALSE], [SM_UNSURE]SmShell::IsInnerShellOf (its SmBoolean)

Upstream tests reaching this unit

prog_test:my_test_extent3d, prog_test:my_test_vector2d, 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