step-examples/12-3b-wires/Twi142.stp
Sources
- synthesized — no external source cited
Description
ShapeFix_Wire.FixDegenerated insertion at index 0
Reproducer recipe
Expected kernel behavior
The loop's first entry is a zero-length edge: its two distinct vertex instances both sit at (0,0,0). Handle removal at index 0 exactly as at any other index — drop the edge, merge the two coincident vertices into one, and re-close the ring so the last edge's end becomes the new first edge's start, remembering that index 0's predecessor is the last edge and not index -1 — leaving a four-edge closed square. An implementation that special-cases only interior positions leaves a dangling vertex or reads out of range; the fourth edge must also be rejected, since its `LINE` along (0,-1,0) from (10,10,0) never reaches its declared end vertex (0,10,0).
Notes
RUNTIME-VERIFIED 2026-08-08 — the recorded crash comes from this file's straight-line direction argument, which references a plain direction where the schema declares a vector carrying a magnitude; repairing that one reference makes the file load, so the titled condition is never reached. See BACKLOG (M).
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/* Twi142 - ShapeFix_Wire.FixDegenerated insertion at index 0 3 * Defect: wire's degenerate edge is at the start (position 0); FixDegenerated's 4 * index logic doesn't handle position-0 special case, causing incorrect insertion 5 * or index-out-of-bounds when attempting to insert at index 0. 6 */ 7HEADER; 8FILE_DESCRIPTION(('Twi142 test case','ShapeFix_Wire.FixDegenerated insertion at index 0'),'2;1'); 9FILE_NAME('Twi142.stp','2026-06-15T00:00:00',(''),(''),'cad-research-suite','',''); 10FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }')); 11ENDSEC; 12DATA; 13#1=APPLICATION_CONTEXT('automotive_design'); 14#2=APPLICATION_PROTOCOL_DEFINITION('international standard','automotive_design',2000,#1); 15#10=CARTESIAN_POINT('',(0.0,0.0,0.0)); 16#11=DIRECTION('',(0.0,0.0,1.0)); 17#12=DIRECTION('',(1.0,0.0,0.0)); 18#13=AXIS2_PLACEMENT_3D('',#10,#11,#12); 19 20#20=PLANE('',#13); 21/* Wire with degenerate edge (zero-length) at position 0 */ 22#100=CARTESIAN_POINT('',(0.0,0.0,0.0)); 23#101=VERTEX_POINT('',#100); 24#102=CARTESIAN_POINT('',(0.0,0.0,0.0)); 25#103=VERTEX_POINT('',#102); 26 27/* Degenerate edge at position 0: zero-length edge */ 28#110=LINE('',#100,#12); 29#111=EDGE_CURVE('',#101,#103,#110,.T.); 30 31/* Normal edges following the degenerate */ 32#120=CARTESIAN_POINT('',(10.0,0.0,0.0)); 33#121=VERTEX_POINT('',#120); 34#122=LINE('',#100,#12); 35#123=EDGE_CURVE('',#103,#121,#122,.T.); 36 37#130=CARTESIAN_POINT('',(10.0,10.0,0.0)); 38#131=VERTEX_POINT('',#130); 39#132=DIRECTION('',(0.0,1.0,0.0)); 40#133=LINE('',#120,#132); 41#134=EDGE_CURVE('',#121,#131,#133,.T.); 42 43#140=CARTESIAN_POINT('',(0.0,10.0,0.0)); 44#141=VERTEX_POINT('',#140); 45#142=DIRECTION('',(0.0,-1.0,0.0)); 46#143=LINE('',#130,#142); 47#144=EDGE_CURVE('',#131,#141,#143,.T.); 48 49#150=DIRECTION('',(0.0,-1.0,0.0)); 50#151=LINE('',#140,#150); 51#152=EDGE_CURVE('',#141,#101,#151,.T.); 52 53/* Edge loop: degenerate at index 0 */ 54#160=ORIENTED_EDGE('',*,*,#111,.T.); 55#161=ORIENTED_EDGE('',*,*,#123,.T.); 56#162=ORIENTED_EDGE('',*,*,#134,.T.); 57#163=ORIENTED_EDGE('',*,*,#144,.T.); 58#164=ORIENTED_EDGE('',*,*,#152,.T.); 59#165=EDGE_LOOP('',(#160,#161,#162,#163,#164)); 60#166=FACE_OUTER_BOUND('',#165,.T.); 61#167=ADVANCED_FACE('',(#166),#20,.T.); 62#8000=OPEN_SHELL('',(#167)); 63 64/* PRODUCT CHAIN - Mandatory */ 65#9000=PRODUCT_CONTEXT('',#1,'mechanical'); 66#9001=PRODUCT('Twi142','Twi142','',(#9000)); 67#9002=PRODUCT_DEFINITION_FORMATION('','',#9001); 68#9003=PRODUCT_DEFINITION_CONTEXT('part definition',#1,'design'); 69#9004=PRODUCT_DEFINITION('','',#9002,#9003); 70#9005=PRODUCT_DEFINITION_SHAPE('','',#9004); 71#9006=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 72#9007=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 73#9008=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 74#9009=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9006,'distance_accuracy_value',''); 75#9010=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9009))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9006,#9007,#9008))REPRESENTATION_CONTEXT('','3D')); 76#9021=SHELL_BASED_SURFACE_MODEL('sbsm',(#8000)); 77#9022=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#9021),#9010); 78#9023=SHAPE_DEFINITION_REPRESENTATION(#9005,#9022); 79ENDSEC; 80END-ISO-10303-21;