step-examples/12-3a-shells/Tsh073.stp
Sources
- OCCT_HEAL_COVERAGE_V3.md (Perform_at102)
Description
CLOSED_SHELL with 5 faces (base quad + 4 apex triangles). Face 2 has intentionally reversed orientation requiring a fix. ShapeFix_Shell.Perform at line 102 checks if Context() is null and creates a new context only on first call. If Perform() is called twice without context reset, the second call reuses the stale ShapeBuild_ReShape, causing accumulated reshape operations to apply twice, resulting in double-fixed faces and inconsistent orientation state.
Reproducer recipe
Load Tsh073.stp; invoke OCCT fixer Perform() on the shell; then invoke Perform() again without resetting context; observe that Face 2 is orientation-fixed twice, leaving the shell in an inconsistent state.
Expected kernel behavior
Kernel should either automatically reset context between calls or throw an error on second Perform() without explicit context clear; currently double-fix silently corrupts orientation.
Expected validation
occt=shape(1)/shape(1) gmsh=shape(18) ifc=schema_n/a
Tier-3 assertions
n_faces_total == 5
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* Tsh073: CLOSED_SHELL with 5 ADVANCED_FACEs (square base + 4 triangular sides forming pyramid); Face 2 (first triangular side) IS wired with same_sense=False (inward normal); reversed-orientation Face 2 IS the context-accumulation target; ShapeFix_Shell.Perform at line 102 creates context only when null; second Perform() call reuses stale ShapeBuild_ReShape; double-fix silently re-reverses Face 2 back to inward orientation; fix: reset Context() to null before each Perform() call; or raise E_STALE_CONTEXT when called twice without reset */ 3HEADER; 4FILE_DESCRIPTION(('Tsh073'),'2;1'); 5FILE_NAME('Tsh073.stp','2026-06-17T00: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('',(1.0,0.0,0.0)); 12#3=CARTESIAN_POINT('',(1.0,1.0,0.0)); 13#4=CARTESIAN_POINT('',(0.0,1.0,0.0)); 14#5=CARTESIAN_POINT('',(0.5,0.5,1.0)); 15#6=VERTEX_POINT('',#1); 16#7=VERTEX_POINT('',#2); 17#8=VERTEX_POINT('',#3); 18#9=VERTEX_POINT('',#4); 19#10=VERTEX_POINT('',#5); 20#11=DIRECTION('',(0.0,0.0,-1.0)); 21#12=DIRECTION('',(1.0,0.0,0.0)); 22#13=AXIS2_PLACEMENT_3D('',#1,#11,#12); 23#14=PLANE('',#13); 24#15=DIRECTION('',(1.0,0.0,0.0)); 25#16=VECTOR('',#15,1.0); 26#17=LINE('',#1,#16); 27#18=EDGE_CURVE('',#6,#7,#17,.T.); 28#19=DIRECTION('',(0.0,1.0,0.0)); 29#20=VECTOR('',#19,1.0); 30#21=LINE('',#2,#20); 31#22=EDGE_CURVE('',#7,#8,#21,.T.); 32#23=DIRECTION('',(-1.0,0.0,0.0)); 33#24=VECTOR('',#23,1.0); 34#25=LINE('',#3,#24); 35#26=EDGE_CURVE('',#8,#9,#25,.T.); 36#27=DIRECTION('',(0.0,-1.0,0.0)); 37#28=VECTOR('',#27,1.0); 38#29=LINE('',#4,#28); 39#30=EDGE_CURVE('',#9,#6,#29,.T.); 40#31=ORIENTED_EDGE('',$,$,#18,.T.); 41#32=ORIENTED_EDGE('',$,$,#22,.T.); 42#33=ORIENTED_EDGE('',$,$,#26,.T.); 43#34=ORIENTED_EDGE('',$,$,#30,.T.); 44#35=EDGE_LOOP('',(#31,#32,#33,#34)); 45#36=FACE_OUTER_BOUND('',#35,.T.); 46#37=ADVANCED_FACE('',(#36),#14,.T.); 47#38=DIRECTION('',(0.5,0.5,1.0)); 48#39=VECTOR('',#38,1.0); 49#40=LINE('',#1,#39); 50#41=EDGE_CURVE('',#6,#10,#40,.T.); 51#42=DIRECTION('',(-0.5,0.5,1.0)); 52#43=VECTOR('',#42,1.0); 53#44=LINE('',#2,#43); 54#45=EDGE_CURVE('',#7,#10,#44,.T.); 55#46=DIRECTION('',(-0.5,-0.5,1.0)); 56#47=VECTOR('',#46,1.0); 57#48=LINE('',#3,#47); 58#49=EDGE_CURVE('',#8,#10,#48,.T.); 59#50=DIRECTION('',(0.5,-0.5,1.0)); 60#51=VECTOR('',#50,1.0); 61#52=LINE('',#4,#51); 62#53=EDGE_CURVE('',#9,#10,#52,.T.); 63#54=CARTESIAN_POINT('',(0.0,0.0,0.0)); 64#55=DIRECTION('',(0.0,-1.0,0.0)); 65#56=DIRECTION('',(1.0,0.0,0.0)); 66#57=AXIS2_PLACEMENT_3D('',#54,#55,#56); 67#58=PLANE('',#57); 68#59=ORIENTED_EDGE('',$,$,#18,.F.); 69#60=ORIENTED_EDGE('',$,$,#45,.T.); 70#61=ORIENTED_EDGE('',$,$,#41,.F.); 71#62=EDGE_LOOP('',(#59,#60,#61)); 72#63=FACE_OUTER_BOUND('',#62,.T.); 73#64=ADVANCED_FACE('',(#63),#58,.F.); 74#65=CARTESIAN_POINT('',(1.0,0.0,0.0)); 75#66=DIRECTION('',(1.0,0.0,0.0)); 76#67=DIRECTION('',(0.0,0.0,1.0)); 77#68=AXIS2_PLACEMENT_3D('',#65,#66,#67); 78#69=PLANE('',#68); 79#70=ORIENTED_EDGE('',$,$,#22,.F.); 80#71=ORIENTED_EDGE('',$,$,#49,.T.); 81#72=ORIENTED_EDGE('',$,$,#45,.F.); 82#73=EDGE_LOOP('',(#70,#71,#72)); 83#74=FACE_OUTER_BOUND('',#73,.T.); 84#75=ADVANCED_FACE('',(#74),#69,.T.); 85#76=CARTESIAN_POINT('',(1.0,1.0,0.0)); 86#77=DIRECTION('',(0.0,1.0,0.0)); 87#78=DIRECTION('',(1.0,0.0,0.0)); 88#79=AXIS2_PLACEMENT_3D('',#76,#77,#78); 89#80=PLANE('',#79); 90#81=ORIENTED_EDGE('',$,$,#26,.F.); 91#82=ORIENTED_EDGE('',$,$,#53,.T.); 92#83=ORIENTED_EDGE('',$,$,#49,.F.); 93#84=EDGE_LOOP('',(#81,#82,#83)); 94#85=FACE_OUTER_BOUND('',#84,.T.); 95#86=ADVANCED_FACE('',(#85),#80,.T.); 96#87=CARTESIAN_POINT('',(0.0,1.0,0.0)); 97#88=DIRECTION('',(-1.0,0.0,0.0)); 98#89=DIRECTION('',(0.0,0.0,1.0)); 99#90=AXIS2_PLACEMENT_3D('',#87,#88,#89); 100#91=PLANE('',#90); 101#92=ORIENTED_EDGE('',$,$,#30,.F.); 102#93=ORIENTED_EDGE('',$,$,#41,.T.); 103#94=ORIENTED_EDGE('',$,$,#53,.F.); 104#95=EDGE_LOOP('',(#92,#93,#94)); 105#96=FACE_OUTER_BOUND('',#95,.T.); 106#97=ADVANCED_FACE('',(#96),#91,.T.); 107#98=CLOSED_SHELL('',(#37,#64,#75,#86,#97)); 108#99=SHELL_BASED_SURFACE_MODEL('',(#98)); 109#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 110#9051=PRODUCT('Tsh073','Tsh073','',(#9050)); 111#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 112#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 113#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 114#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 115#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 116#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 117#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 118#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 119#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 120#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#99),#9060); 121#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 122ENDSEC; 123END-ISO-10303-21;