step-examples/12-3a-shells/Tsh254.stp
Sources
- occt-coverage PARTIAL audit, work packet A4 item `stp-nm-shared-entity-reuse`, `exchange/problems.json` `stp-nm-shared-entity-reuse` (`StepToTopoDS_TranslateEdge::Init`, `StepToTopoDS_TranslateEdge.cxx:223-232` — `NMTool.IsActive() && NMTool.IsBound(EC)` reuse-with-reversal branch). Existing fixture M045 hits more than one raw candidate only incidentally (an unrelated attribute-loss demonstration) and its shells were independently grep-verified to each carry their OWN `EDGE_CURVE` entities — no genuine cross-shell entity sharing.
Description
Two hinge-like `ADVANCED_FACE`s — `face_a` on the `z=0` plane, `face_b` on the `x=5` plane — each wrapped in its own `OPEN_SHELL`/`SHELL_BASED_SURFACE_MODEL`, listed as two SEPARATE items (not merged into one SBSM) directly inside one `NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION`. Both faces' `EDGE_LOOP` reference the SAME `EDGE_CURVE` entity (`#16`, named `shared_hinge_edge`, running `(5,0,0)`→`(5,1,0)`) for their common boundary — `face_a` traverses it forward (`.T.`), `face_b` traverses it in reverse (`.F.`) — a genuine single-entity, cross-item, opposite-orientation reuse, distinct from M045's per-shell entity duplication.
Reproducer recipe
`face_a`: unit-rectangle-ish plane `(0,0,0)-(5,0,0)-(5,1,0)-(0,1,0)`, `z=0`, whose second boundary edge is `EDGE_CURVE('shared_hinge_edge',#8,#9,#15,.T.)` (`#16`). `face_b`: plane `x=5`, boundary `(5,1,0)-(5,0,0)-(5,0,1)-(5,1,1)`, whose FIRST boundary edge is `ORIENTED_EDGE('',*,*,#16,.F.)` — the identical `#16` entity, reversed. Each face in its own `OPEN_SHELL`/`SHELL_BASED_SURFACE_MODEL`; both SBSM items listed together as `NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#41,#66),#9060)`.
Expected kernel behavior
when non-manifold reading is active, the second (and subsequent) reference to an already-translated `EDGE_CURVE` resolves to the identical previously-built edge, with orientation reversed to match the new context's `ORIENTED_EDGE` sense, rather than being independently re-translated into a geometrically-coincident but topologically-distinct duplicate edge.
Notes
**Empirical finding (live-verified, decisive, this worktree's OCP/OCCT 7.8.1)**: verified directly against the non-manifold-mode entity cache's actual scoping — a `SHELL_BASED_SURFACE_MODEL` item creates one shared per-item translation cache for ALL shells it directly contains (so shells merged into one SBSM would hit the generic already-bound-entity reuse path instead, NOT the cited NM-specific branch); listing the two SBSMs as separate top-level items of one `NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION` gives each its own fresh per-item cache while sharing the SAME non-manifold-mode entity map across items — exactly the scoping the cited branch requires. Confirmed via a direct reader load with non-manifold reading enabled: a shape-traversal map over the resulting shape shows exactly one edge shared by both faces (`n_faces_total=2`, edges drop from the unmerged 8 to 7, vertices from 16(raw)/8(distinct) to 6 distinct) — the identical edge object, not a coincidentally-equal duplicate. With non-manifold reading left at its default (off, as used by this corpus's standard tier-3 harness), the NM-specific reuse path is inactive and each face independently re-translates `#16`'s geometry into its own edge (8 edges, no sharing) — the Tier-3 fields below describe this DEFAULT read; the cross-item reuse is a supplementary, explicitly-enabled-mode finding, consistent with this corpus's established convention for non-manifold-mode-gated mechanisms (see Tsh248-250). Synonyms: "shared EDGE_CURVE across shells", "non-manifold entity identity reuse", "cross-shell edge dedup with orientation reversal", "already-bound edge reused under non-manifold mode", "hinge edge shared by two independent shells". Provenance tier: bytes-sufficient.
Expected validation
occt=shape(1)/shape(1) gmsh=shape(15) ifc=schema_n/a
Byte assertions
contains(b'shared_hinge_edge')count_entity_def(b'EDGE_CURVE') >= 7contains(b'NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION')count_entity_def(b'SHELL_BASED_SURFACE_MODEL') == 2
Tier-3 assertions
shape_null == Falsen_faces_total == 2n_edges_total == 8n_vertices_total == 16face[0].surface_type == "plane"face[1].surface_type == "plane"brepcheck.valid == True
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Tsh254: TEST - shared EDGE_CURVE across two SHELL_BASED_SURFACE_MODEL items directly listed inside one NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION */ 3HEADER; 4FILE_DESCRIPTION(('Tsh254'),'2;1'); 5FILE_NAME('Tsh254.stp','2026-07-13T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#9000=APPLICATION_CONTEXT('mechanical design'); 10#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 11#2=CARTESIAN_POINT('',(5.0,0.0,0.0)); 12#3=CARTESIAN_POINT('',(5.0,1.0,0.0)); 13#4=CARTESIAN_POINT('',(0.0,1.0,0.0)); 14#5=CARTESIAN_POINT('',(5.0,0.0,1.0)); 15#6=CARTESIAN_POINT('',(5.0,1.0,1.0)); 16#7=VERTEX_POINT('',#1); 17#8=VERTEX_POINT('',#2); 18#9=VERTEX_POINT('',#3); 19#10=VERTEX_POINT('',#4); 20#11=VERTEX_POINT('',#5); 21#12=VERTEX_POINT('',#6); 22#13=DIRECTION('',(0.0,1.0,0.0)); 23#14=VECTOR('',#13,1.0); 24#15=LINE('',#2,#14); 25#16=EDGE_CURVE('shared_hinge_edge',#8,#9,#15,.T.); 26#17=DIRECTION('',(1.0,0.0,0.0)); 27#18=VECTOR('',#17,5.0); 28#19=LINE('',#1,#18); 29#20=EDGE_CURVE('',#7,#8,#19,.T.); 30#21=DIRECTION('',(-1.0,0.0,0.0)); 31#22=VECTOR('',#21,5.0); 32#23=LINE('',#3,#22); 33#24=EDGE_CURVE('',#9,#10,#23,.T.); 34#25=DIRECTION('',(0.0,-1.0,0.0)); 35#26=VECTOR('',#25,1.0); 36#27=LINE('',#4,#26); 37#28=EDGE_CURVE('',#10,#7,#27,.T.); 38#29=ORIENTED_EDGE('',*,*,#20,.T.); 39#30=ORIENTED_EDGE('',*,*,#16,.T.); 40#31=ORIENTED_EDGE('',*,*,#24,.T.); 41#32=ORIENTED_EDGE('',*,*,#28,.T.); 42#33=EDGE_LOOP('',(#29,#30,#31,#32)); 43#34=DIRECTION('',(0.0,0.0,1.0)); 44#35=DIRECTION('',(1.0,0.0,0.0)); 45#36=AXIS2_PLACEMENT_3D('',#1,#34,#35); 46#37=PLANE('',#36); 47#38=FACE_OUTER_BOUND('',#33,.T.); 48#39=ADVANCED_FACE('face_a',(#38),#37,.T.); 49#40=OPEN_SHELL('shell_a',(#39)); 50#41=SHELL_BASED_SURFACE_MODEL('sbsm_a',(#40)); 51#42=DIRECTION('',(0.0,0.0,1.0)); 52#43=VECTOR('',#42,1.0); 53#44=LINE('',#2,#43); 54#45=EDGE_CURVE('',#8,#11,#44,.T.); 55#46=DIRECTION('',(0.0,1.0,0.0)); 56#47=VECTOR('',#46,1.0); 57#48=LINE('',#5,#47); 58#49=EDGE_CURVE('',#11,#12,#48,.T.); 59#50=DIRECTION('',(0.0,0.0,-1.0)); 60#51=VECTOR('',#50,1.0); 61#52=LINE('',#6,#51); 62#53=EDGE_CURVE('',#12,#9,#52,.T.); 63#54=ORIENTED_EDGE('',*,*,#16,.F.); 64#55=ORIENTED_EDGE('',*,*,#45,.T.); 65#56=ORIENTED_EDGE('',*,*,#49,.T.); 66#57=ORIENTED_EDGE('',*,*,#53,.T.); 67#58=EDGE_LOOP('',(#54,#55,#56,#57)); 68#59=DIRECTION('',(1.0,0.0,0.0)); 69#60=DIRECTION('',(0.0,1.0,0.0)); 70#61=AXIS2_PLACEMENT_3D('',#2,#59,#60); 71#62=PLANE('',#61); 72#63=FACE_OUTER_BOUND('',#58,.T.); 73#64=ADVANCED_FACE('face_b',(#63),#62,.T.); 74#65=OPEN_SHELL('shell_b',(#64)); 75#66=SHELL_BASED_SURFACE_MODEL('sbsm_b',(#65)); 76#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 77#9051=PRODUCT('Tsh254','Tsh254','',(#9050)); 78#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 79#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 80#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 81#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 82#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 83#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 84#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 85#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 86#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 87#9061=NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#41,#66),#9060); 88#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 89ENDSEC; 90END-ISO-10303-21;