step-examples/12-2c-surfaces/Gs138.stp
Sources
- OCCT/ShapeAnalysis (see fixture)
Description
Surface defined by 4 corner control points only (no interior patches or knot structure) passes IsDegenerated correctly as non-degenerate, but the surface itself is barely defined—derivative evaluation is unreliable, and trimming or intersection operations assume richer surface.
Reproducer recipe
Expected kernel behavior
This file's surface entity does not match its schema definition — the control points are a flat list where a grid of rows is required, and the knot and multiplicity attributes are absent — and the edge's 3D `LINE` supplies a point where a direction vector belongs. Validate every entity's attribute count and attribute types against the schema before constructing geometry from it, and reject offending entities individually with diagnostics naming them while the rest of the model is still built: a partially-initialised surface or curve must never be constructed, and a malformed entity must never terminate the read.
Notes
RUNTIME-VERIFIED 2026-08-08 by minimal reproducer — of the two anomalies named in the title, only the missing attributes cause the abort. Built a correct 13-attribute surface (loads), then introduced each defect alone: a flat control-point list where a grid is required LOADS; knot multiplicities written as reals LOAD; a control-point count contradicting the multiplicities LOADS; **omitting the four attributes, which shifts every later argument into the wrong slot, aborts**. Debugger on the minimal case lands at the same converter entry point and fault address as this fixture. So the flat list is a real byte-level anomaly but is NOT part of the crash mechanism.
Expected validation
occt=signal(11)/signal(11) gmsh=signal(11) ifc=schema_n/a
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* Gs138 - ShapeAnalysis_Surface.IsDegenerated bounded-surface-with-only-corner-points 3 * 4 * Defect: Surface defined by 4 corner control points only (no interior patches 5 * or knot structure) passes IsDegenerated correctly as non-degenerate, but the 6 * surface itself is barely definedâderivative evaluation is unreliable, and 7 * trimming or intersection operations assume richer surface structure. 8 * 9 * Reproducer: Minimal B-spline surface with a 2x2 control-point grid and 10 * degree (1,1)âtechnically valid bilinear patch but minimal and fragile. 11 * 12 * Expected kernel behavior: 13 * heal - flag minimal surfaces; add robustness check for evaluation at 14 * interior points; consider elevation to higher degree or add validation 15 * warning during healing audit. */ 16HEADER; 17FILE_DESCRIPTION(('Gs138 test case','Minimal bilinear surface (4 corners only)'),'2;1'); 18FILE_NAME('Gs138.stp','2026-06-15T00:00:00',(''),(''),'auto-generated','',''); 19FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 20ENDSEC; 21DATA; 22#1=APPLICATION_CONTEXT('automotive_design'); 23#2=APPLICATION_PROTOCOL_DEFINITION('international standard','automotive_design',2000,#1); 24/* Base coordinate system */ 25#10=CARTESIAN_POINT('',(0.0,0.0,0.0)); 26#11=DIRECTION('',(0.0,0.0,1.0)); 27#12=DIRECTION('',(1.0,0.0,0.0)); 28#13=AXIS2_PLACEMENT_3D('',#10,#11,#12); 29/* Four corner points only - minimal 2x2 bilinear surface */ 30#20=CARTESIAN_POINT('',(0.0,0.0,0.0)); 31#21=CARTESIAN_POINT('',(4.0,0.0,0.1)); 32#22=CARTESIAN_POINT('',(0.0,4.0,0.2)); 33#23=CARTESIAN_POINT('',(4.0,4.0,0.3)); 34/* Degree (1,1) B-spline surface - bilinear patch */ 35#50=B_SPLINE_SURFACE_WITH_KNOTS('',1,1,(#20,#21,#22,#23), 36 ((0.0,0.0,1.0,1.0),(0.0,0.0,1.0,1.0)), 37 ((1.0,1.0),(1.0,1.0)),.F.,.F.,.F.); 38/* Vertices at corners */ 39#60=CARTESIAN_POINT('',(0.0,0.0,0.0)); 40#61=VERTEX_POINT('',#60); 41#62=CARTESIAN_POINT('',(4.0,0.0,0.1)); 42#63=VERTEX_POINT('',#62); 43/* Degenerate edge */ 44#70=LINE('',#60,#60); 45#71=EDGE_CURVE('',#61,#63,#70,.T.); 46#72=ORIENTED_EDGE('',*,*,#71,.T.); 47#80=EDGE_LOOP('',(#72)); 48#81=FACE_OUTER_BOUND('',#80,.T.); 49#82=ADVANCED_FACE('',(#81),#50,.T.); 50/* PRODUCT chain */ 51#9000=PRODUCT_CONTEXT('',#1,'mechanical'); 52#9001=PRODUCT('Gs138','Gs138','',(#9000)); 53#9002=PRODUCT_DEFINITION_FORMATION('','',#9001); 54#9003=PRODUCT_DEFINITION_CONTEXT('part definition',#1,'design'); 55#9004=PRODUCT_DEFINITION('','',#9002,#9003); 56#9005=PRODUCT_DEFINITION_SHAPE('','',#9004); 57#9006=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 58#9007=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 59#9008=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 60#9009=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9006,'distance_accuracy_value',''); 61#9010=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9009))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9006,#9007,#9008))REPRESENTATION_CONTEXT('','3D')); 62#9022=GEOMETRICALLY_BOUNDED_SURFACE_SHAPE_REPRESENTATION('',(#82),#9010); 63#9023=SHAPE_DEFINITION_REPRESENTATION(#9005,#9022); 64ENDSEC; 65END-ISO-10303-21;