N043 — Shape-to-shape distance reports nonzero gap for clearly intersecting parts

§12.4 (sub-class: working precision / extrema)

P1 — silent data loss

topology

Sources

Description

For two shapes that demonstrably intersect (their volumes clearly overlap), the minimum-distance query returns a small but nonzero value (e.g. 6e-5 or 0.083) instead of zero. The distance algorithm samples corner points and edge endpoints but does not verify true intersection, so a transverse intersection between two interior surfaces is missed.

Reproducer recipe

4 cylinders intersecting a main part; compute pairwise minimum distance.

Expected kernel behavior

Heal and accept: a minimum-distance query between two intersecting bodies must return zero (or a value smaller than the kernel's working precision); when sampling reports a near-zero distance, the kernel should fall back to a true intersection test rather than reporting the sample value.

Notes

Synonyms: "distance query says gap but parts overlap", "shapes overlap but distance is nonzero", "distance algorithm misses interior intersection", "min distance returns 6e-5 for clearly intersecting solids".

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* N043: distance query: 1 CYLINDRICAL_SURFACE intersects main part but returns 6.3E-5 or 8.3E-2 nonzero gap; 3×UNCERTAINTY_MEASURE_WITH_UNIT; GEOMETRIC_CURVE_SET — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('N043'),'2;1');
5FILE_NAME('N043.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
7ENDSEC;
8DATA;
9#1=CARTESIAN_POINT('cyl_orig',(0.0,0.0,0.0));
10#2=DIRECTION('',(0.0,0.0,1.0));
11#3=DIRECTION('',(1.0,0.0,0.0));
12#4=AXIS2_PLACEMENT_3D('',#1,#2,#3);
13#5=CYLINDRICAL_SURFACE('cyl',#4,5.0);
14#6=CARTESIAN_POINT('p0',(0.0,0.0,0.0));
15#7=CARTESIAN_POINT('p1',(10.0,0.0,0.0));
16#8=VERTEX_POINT('v0',#6);
17#9=VERTEX_POINT('v1',#7);
18#10=DIRECTION('',(1.0,0.0,0.0));
19#11=VECTOR('',#10,10.0);
20#12=LINE('',#6,#11);
21#13=EDGE_CURVE('main_edge',#8,#9,#12,.T.);
22#14=GEOMETRIC_CURVE_SET('dist_query',(#5,#13));
23#15=APPLICATION_CONTEXT('automotive_design');
24#16=PRODUCT_CONTEXT('',#15,'mechanical');
25#17=PRODUCT('N043','N043','',(#16));
26#18=PRODUCT_DEFINITION_FORMATION('','',#17);
27#19=PRODUCT_DEFINITION_CONTEXT('part definition',#15,'design');
28#20=PRODUCT_DEFINITION('','',#18,#19);
29#21=PRODUCT_DEFINITION_SHAPE('','',#20);
30#22=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
31#23=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
32#24=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
33#25=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-6),#22,'distance_accuracy_value','model_precision');
34#26=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(6.3E-5),#22,'distance_accuracy_value','sampled_gap_type_A');
35#27=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(8.3E-2),#22,'distance_accuracy_value','sampled_gap_type_B');
36#28=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#25,#26,#27))GLOBAL_UNIT_ASSIGNED_CONTEXT((#22,#23,#24))REPRESENTATION_CONTEXT('ctx','3D'));
37#29=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#14),#28);
38#30=SHAPE_DEFINITION_REPRESENTATION(#21,#29);
39ENDSEC;
40END-ISO-10303-21;