step-examples/12-3a-shells/Ps004.stp
Sources
- deduced from AXIS2_PLACEMENT_3D semantics
- bug-report patterns "imported part is mirrored", "AXIS2_PLACEMENT mirror", "right-hand part appeared left-hand"
Description
An ADVANCED_BREP_SHAPE_REPRESENTATION includes a child AXIS2_PLACEMENT_3D whose axis and ref_direction, after Gram-Schmidt orthonormalization, induce a basis whose third (Y) vector points in the opposite of the right-hand-rule direction the producer assumed. AXIS2_PLACEMENT_3D only stores axis + ref_direction (the third basis vector is computed), so individual unit-and-orthogonality checks pass and no diagnostic fires. Kernel accepts the file silently; tier-3 introspection (det(basis) check on every placement) reveals a reflection masquerading as a rotation.
Reproducer recipe
A simple tetrahedral solid. Plus a separate AXIS2_PLACEMENT_3D with axis=(0,0,1) and ref_direction=(0,1,0) — this yields a computed Y_local = axis × ref_direction = (-1,0,0), which the producer downstream uses as if it were +X. Both placements appear in the SHAPE_REPRESENTATION's items list.
Expected kernel behavior
Compute the determinant of the basis formed by (ref_direction, axis × ref_direction, axis); reject or warn on negative determinant. A correct kernel should not silently propagate a reflection through downstream transforms.
Notes
Tier-3 metric: determinant of computed basis matrix. Should be +1 for a right-handed frame; this fixture has determinants both ways. Synonyms: "imported part is mirrored", "AXIS2_PLACEMENT mirror", "right-hand part appeared left-hand", "left-handed coordinate frame slipped through", "reflection masquerading as rotation".
Expected validation
occt=shape(1)/shape(1) gmsh=shape(15) ifc=schema_n/a
Tier-3 assertions
face[3].surface_type == "plane"n_edges_total >= 12face[0].surface_type == "plane"n_vertices_total >= 24
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* Ps004: AXIS2_PLACEMENT_3D with left-handed basis: axis=(0,0,1), ref_direction=(0,1,0) yields computed Y_local = axis à ref_direction = (-1,0,0) â reflection not rotation; individual unit/orthogonality checks pass; no diagnostic fires; tier-3: det([ref_dir, axisÃref_dir, axis]) = -1 reveals mirror; MANIFOLD_SOLID_BREP IS model entity â OCC yields shape(1) */ 3HEADER; 4FILE_DESCRIPTION(('Ps004'),'2;1'); 5FILE_NAME('Ps004.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('',(0.0,1.0,0.0)); 13#4=CARTESIAN_POINT('',(0.0,0.0,1.0)); 14#5=VERTEX_POINT('',#1); 15#6=VERTEX_POINT('',#2); 16#7=VERTEX_POINT('',#3); 17#8=VERTEX_POINT('',#4); 18#9=DIRECTION('',(1,0,0)); 19#10=VECTOR('',#9,1.0); 20#11=LINE('',#1,#10); 21#12=EDGE_CURVE('',#5,#6,#11,.T.); 22#13=DIRECTION('',(0,1,0)); 23#14=VECTOR('',#13,1.0); 24#15=LINE('',#1,#14); 25#16=EDGE_CURVE('',#5,#7,#15,.T.); 26#17=DIRECTION('',(0,0,1)); 27#18=VECTOR('',#17,1.0); 28#19=LINE('',#1,#18); 29#20=EDGE_CURVE('',#5,#8,#19,.T.); 30#21=DIRECTION('',(-0.707106781187,0.707106781187,0)); 31#22=VECTOR('',#21,1.41421356237); 32#23=LINE('',#2,#22); 33#24=EDGE_CURVE('',#6,#7,#23,.T.); 34#25=DIRECTION('',(-0.707106781187,0,0.707106781187)); 35#26=VECTOR('',#25,1.41421356237); 36#27=LINE('',#2,#26); 37#28=EDGE_CURVE('',#6,#8,#27,.T.); 38#29=DIRECTION('',(0,-0.707106781187,0.707106781187)); 39#30=VECTOR('',#29,1.41421356237); 40#31=LINE('',#3,#30); 41#32=EDGE_CURVE('',#7,#8,#31,.T.); 42#33=CARTESIAN_POINT('',(0,0,0)); 43#34=DIRECTION('',(0,0,-1)); 44#35=DIRECTION('',(1,0,0)); 45#36=AXIS2_PLACEMENT_3D('',#33,#34,#35); 46#37=PLANE('',#36); 47#38=CARTESIAN_POINT('',(0,0,0)); 48#39=DIRECTION('',(-1,0,0)); 49#40=DIRECTION('',(0,1,0)); 50#41=AXIS2_PLACEMENT_3D('',#38,#39,#40); 51#42=PLANE('',#41); 52#43=CARTESIAN_POINT('',(0,0,0)); 53#44=DIRECTION('',(0,-1,0)); 54#45=DIRECTION('',(1,0,0)); 55#46=AXIS2_PLACEMENT_3D('',#43,#44,#45); 56#47=PLANE('',#46); 57#48=CARTESIAN_POINT('',(1,0,0)); 58#49=DIRECTION('',(0.57735026919,0.57735026919,0.57735026919)); 59#50=DIRECTION('',(0.707106781187,-0.707106781187,0)); 60#51=AXIS2_PLACEMENT_3D('',#48,#49,#50); 61#52=PLANE('',#51); 62#53=ORIENTED_EDGE('',$,$,#12,.T.); 63#54=ORIENTED_EDGE('',$,$,#24,.T.); 64#55=ORIENTED_EDGE('',$,$,#16,.F.); 65#56=EDGE_LOOP('',(#53,#54,#55)); 66#57=FACE_OUTER_BOUND('',#56,.T.); 67#58=ADVANCED_FACE('',(#57),#37,.T.); 68#59=ORIENTED_EDGE('',$,$,#16,.T.); 69#60=ORIENTED_EDGE('',$,$,#32,.T.); 70#61=ORIENTED_EDGE('',$,$,#20,.F.); 71#62=EDGE_LOOP('',(#59,#60,#61)); 72#63=FACE_OUTER_BOUND('',#62,.T.); 73#64=ADVANCED_FACE('',(#63),#42,.T.); 74#65=ORIENTED_EDGE('',$,$,#12,.T.); 75#66=ORIENTED_EDGE('',$,$,#28,.T.); 76#67=ORIENTED_EDGE('',$,$,#20,.F.); 77#68=EDGE_LOOP('',(#65,#66,#67)); 78#69=FACE_OUTER_BOUND('',#68,.T.); 79#70=ADVANCED_FACE('',(#69),#47,.T.); 80#71=ORIENTED_EDGE('',$,$,#24,.T.); 81#72=ORIENTED_EDGE('',$,$,#32,.T.); 82#73=ORIENTED_EDGE('',$,$,#28,.F.); 83#74=EDGE_LOOP('',(#71,#72,#73)); 84#75=FACE_OUTER_BOUND('',#74,.T.); 85#76=ADVANCED_FACE('',(#75),#52,.T.); 86#77=CARTESIAN_POINT('',(0.0,0.0,0.0)); 87#78=DIRECTION('',(0.0,0.0,1.0)); 88#79=DIRECTION('',(1.0,0.0,0.0)); 89#80=AXIS2_PLACEMENT_3D('',#77,#78,#79); 90#81=CARTESIAN_POINT('',(2.0,0.0,0.0)); 91#82=DIRECTION('',(0.0,0.0,1.0)); 92#83=DIRECTION('',(0.0,1.0,0.0)); 93#84=AXIS2_PLACEMENT_3D('left_handed_placement',#81,#82,#83); 94#85=CLOSED_SHELL('ps004_tetra',(#58,#76,#64,#70)); 95#86=MANIFOLD_SOLID_BREP('ps004_tetra_solid',#85); 96#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 97#9051=PRODUCT('Ps004','Ps004','',(#9050)); 98#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 99#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 100#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 101#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 102#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 103#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 104#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 105#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 106#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 107#9061=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#86),#9060); 108#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 109ENDSEC; 110END-ISO-10303-21;