step-examples/12-4-tolerance/N042.stp
Sources
- 08-occt-gitlog G015 (Mantis 0025823)
- 14-brlcad-rhino K007
Description
When OCCT computed a curve's bounding box for self-intersection detection, it used too few sampling points; near-tangent intersections were missed. step-g hits the inverse: sampling p-curves with <2 points produces degenerate trims. This fixture's two edges are exactly tangent (single point of contact at (5, 5.00025)) rather than crossing, so it demonstrates a wire that touches itself at one point without a topological self-intersection — a different, milder condition than the title's "self-intersecting" claim.
Reproducer recipe
STEP wire on planar face containing two near-tangent edges; bbox-based intersection test with default sample count misses the crossing.
Expected kernel behavior
heal; use density-of-discretization correlated with curve curvature for bbox; never rely on a fixed sample count; enforce minimum sample count ≥ 2 on degenerate inputs.
Notes
**See also**: Pf006. **OCC behavior**: the validity-checker does not flag the near-tangent edge intersections missed by coarse bbox sampling; tier-3 valid-flag should be ignored for this entry. The reader most likely silently fixes or ignores the missed self-intersection on import. Corrected 2026-08-07 (title-vs-bytes audit): retitled/redescribed — original claimed the two edges "actually cross" and a coarse bbox sampler misses that crossing; direct evaluation shows the pair is exactly tangent (one touch point, no sign change), not crossing, at any sample density. Synonyms: "self-intersection missed by sparse sampling", "coarse bounding box check misses near-tangent", "p-curves with too few samples cause degenerate trims", "near-tangent curves miss intersection due to undersample", "exact single-point tangency, not a crossing".
Expected validation
occt=shape(1)/shape(1) gmsh=shape(5) ifc=schema_n/a
Closure intent
sheet — the open shell is the intended final geometry; a solid-only kernel should cleanly refuse.
Tier-3 assertions
face[0].surface_type == "plane"n_edges_total >= 2n_vertices_total >= 4
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* N042: planar face outer wire has two near-tangent B_SPLINE_CURVE segments that cross at ~5e-4 mm inside the face; default bbox sampler with N=4 points misses the crossing â self-intersection undetected */ 3HEADER; 4FILE_DESCRIPTION(('N042'),'2;1'); 5FILE_NAME('N042.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('origin',(0.0,0.0,0.0)); 11#2=DIRECTION('z',(0.0,0.0,1.0)); 12#3=DIRECTION('x',(1.0,0.0,0.0)); 13#4=AXIS2_PLACEMENT_3D('plane_plc',#1,#2,#3); 14#5=PLANE('host_plane',#4); 15#6=CARTESIAN_POINT('a_p0',(0.0,5.0,0.0)); 16#7=CARTESIAN_POINT('a_p1',(5.0,5.0005,0.0)); 17#8=CARTESIAN_POINT('a_p2',(10.0,5.0,0.0)); 18#9=CARTESIAN_POINT('b_p0',(0.0,5.0005,0.0)); 19#10=CARTESIAN_POINT('b_p1',(5.0,5.0,0.0)); 20#11=CARTESIAN_POINT('b_p2',(10.0,5.0005,0.0)); 21#12=B_SPLINE_CURVE_WITH_KNOTS('curveA',2,(#6,#7,#8),.UNSPECIFIED.,.F.,.F.,(3,3),(0.0,1.0),.UNSPECIFIED.); 22#13=B_SPLINE_CURVE_WITH_KNOTS('curveB',2,(#9,#10,#11),.UNSPECIFIED.,.F.,.F.,(3,3),(0.0,1.0),.UNSPECIFIED.); 23#14=VERTEX_POINT('a_start',#6); 24#15=VERTEX_POINT('a_end',#8); 25#16=VERTEX_POINT('b_start',#9); 26#17=VERTEX_POINT('b_end',#11); 27#18=EDGE_CURVE('eA_near_tangent_xs',#14,#15,#12,.T.); 28#19=EDGE_CURVE('eB_near_tangent_xs',#16,#17,#13,.T.); 29#20=ORIENTED_EDGE('',$,$,#18,.T.); 30#21=ORIENTED_EDGE('',$,$,#19,.T.); 31#22=EDGE_LOOP('self_xs_loop_undetected_by_bbox',(#20,#21)); 32#23=FACE_OUTER_BOUND('',#22,.T.); 33#24=ADVANCED_FACE('coarse_bbox_self_xs_face',(#23),#5,.T.); 34#25=OPEN_SHELL('',(#24)); 35#26=SHELL_BASED_SURFACE_MODEL('',(#25)); 36#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 37#9051=PRODUCT('N042','N042','',(#9050)); 38#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 39#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 40#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 41#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 42#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 43#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 44#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 45#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.000000E-06),#9056,'distance_accuracy_value',''); 46#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 47#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#26),#9060); 48#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 49ENDSEC; 50END-ISO-10303-21;