step-examples/12-12-cross-product/Xp002.stp
Sources
- synthesized cross-product.
Description
A face on a closed `CYLINDRICAL_SURFACE` is bounded by a wire whose 3D endpoints meet but whose 2D pcurves are missing entirely (`SURFACE_CURVE.associated_geometry` carries no `PCURVE` entry). The containing `GEOMETRIC_REPRESENTATION_CONTEXT` declares `SI_UNIT(.MILLI., .METRE.)` while coordinate magnitudes are 25.4× too large (i.e., authored in inches but tagged as mm). Three independent invariants are violated and three healing strategies (synthesize pcurve, close UV seam, scale consistently with declared unit) interact.
Reproducer recipe
`CYLINDRICAL_SURFACE` of radius 1.0 on Z-axis, bounded by an `EDGE_LOOP` of two `EDGE_CURVE`s whose 3D endpoints share vertices but whose `SURFACE_CURVE` has empty `associated_geometry`. `GEOMETRIC_REPRESENTATION_CONTEXT` units = mm; coordinates suggest inch authorship (radius emitted as 25.4).
Expected kernel behavior
Each invariant addressed independently. A kernel may synthesize pcurves, close the UV seam, and elect a unit-policy (honor declaration, infer from magnitudes, or warn).
Notes
Cross-oracle: pure-Python Part-21 validator accepts (`accept`); OCCT crashes (`signal(11)`). The crash is on the kernel side; the file is spec-conformant Part-21.
Expected validation
occt=signal(11)/signal(11) gmsh=signal(11) ifc=schema_n/a
Byte assertions
contains(b'FILE_SCHEMA')contains(b'EDGE_CURVE')contains(b'ADVANCED_FACE')
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Xp002 - Cross-product: periodic-surface seam gap + missing pcurve + 3 * unit-context magnitude disagreement. 4 * Builds on Twi-XX (UV seam shift) + Gp001 (missing pcurve) + U001 5 * (unit-vs-magnitude mismatch). 6 * Defect 1: face on a closed CYLINDRICAL_SURFACE; the wire's 3D endpoints 7 * meet, but UV pcurves (if they existed) would differ by 2pi - the 8 * wire is open in UV. 9 * Defect 2: SURFACE_CURVE.associated_geometry is empty (no PCURVE). 10 * Defect 3: GEOMETRIC_REPRESENTATION_CONTEXT declares mm but coordinates 11 * are sized for inch authorship (radius emitted as 25.4). */ 12HEADER; 13FILE_DESCRIPTION(('Xp002 cross-product','periodic seam x missing pcurve x unit mismatch'),'2;1'); 14FILE_NAME('Xp002.stp','2026-04-26T00:00:00',(''),(''),'cad-research-suite','',''); 15FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }')); 16ENDSEC; 17DATA; 18#1=APPLICATION_CONTEXT('automotive_design'); 19#2=APPLICATION_PROTOCOL_DEFINITION('international standard','automotive_design',2000,#1); 20/* Defect 3: declared mm */ 21#10=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 22#11=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 23#12=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 24#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-6),#10,'distance_accuracy_value',''); 25#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) 26 GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 27 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) 28 REPRESENTATION_CONTEXT('part','3D')); 29/* Defect 3 continued: radius 25.4 = 1 inch but tagged as mm */ 30#20=CARTESIAN_POINT('',(0.0,0.0,0.0)); 31#21=DIRECTION('',(0.0,0.0,1.0)); 32#22=DIRECTION('',(1.0,0.0,0.0)); 33#23=AXIS2_PLACEMENT_3D('',#20,#21,#22); 34#24=CYLINDRICAL_SURFACE('',#23,25.4); 35/* Two vertices on the cylinder at angles 0 and 0 (same 3D point but two ends) */ 36#30=CARTESIAN_POINT('',(25.4,0.0,0.0)); 37#31=CARTESIAN_POINT('',(25.4,0.0,10.0)); 38#32=VERTEX_POINT('',#30); 39#33=VERTEX_POINT('',#31); 40/* 3D curves: vertical line at u=0 and u=2pi (same 3D ray) */ 41#40=DIRECTION('',(0.0,0.0,1.0)); 42#41=VECTOR('',#40,10.0); 43#42=LINE('',#30,#41); 44#43=LINE('',#31,#41); 45/* SURFACE_CURVEs with EMPTY associated_geometry - Defect 2 */ 46#50=SURFACE_CURVE('',#42,(),.PCURVE_S1.); 47#51=SURFACE_CURVE('',#43,(),.PCURVE_S1.); 48#60=EDGE_CURVE('',#32,#33,#50,.T.); 49#61=EDGE_CURVE('',#33,#32,#51,.T.); 50/* Defect 1: 3D wire is closed (V-Z-V'-V back to start), but UV pcurves 51 * would run at u=0 forward then u=2pi backward - open in UV. */ 52#70=ORIENTED_EDGE('',*,*,#60,.T.); 53#71=ORIENTED_EDGE('',*,*,#61,.T.); 54#80=EDGE_LOOP('',(#70,#71)); 55#81=FACE_OUTER_BOUND('',#80,.T.); 56#82=ADVANCED_FACE('cyl_face',(#81),#24,.T.); 57#90=SHAPE_REPRESENTATION('',(#82),#14); 58ENDSEC; 59END-ISO-10303-21;