N055 — ShapeFix_ShapeTolerance.LimitTolerance boundary ambiguity

§12.4 (sub-class: equality-boundary-undefined)

spec-violation

Sources

Description

LimitTolerance permits tmax >= tmin, allowing equality case tmax == tmin. When bounds are equal, newtol selection logic becomes nondeterministic: clamping to tmin vs tmax yields identical result but the invariant tmin < tmax (strict ordering) is violated. Downstream code assumes strict ordering; equality case creates ambiguity in tolerance domain membership.

Reproducer recipe

Load `N055.stp` then call `ShapeFix_ShapeTolerance st; st.LimitTolerance(shape, 0.002, 0.002, TopAbs_VERTEX);` with the loaded shape. Condition (tmax >= tmin) is satisfied; newtol selection at lines 47-50 cannot decide whether to clamp to tmin or tmax (they are equal). Expected: validation error for tmin >= tmax.

Expected kernel behavior

require strict ordering (tmin < tmax); reject or error on tmin == tmax; enforce at API boundary before tolerance selection

Notes

The `N055.stp` fixture provides the input shape but the bug is in the `LimitTolerance` API's parameter validation — only a runtime caller passing `tmin == tmax` will exercise the buggy clamp logic. The catalog entry's "Reproducer recipe" line is the canonical paired test. **See also**: N052.

Expected validation

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

Tier-3 assertions

Cross-references

N052

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1ISO-10303-21;
2/* N055: LimitTolerance input: single vertex at origin; tmin == tmax == 0.002; equality boundary makes newtol clamp nondeterministic; GEOMETRIC_CURVE_SET — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('N055'),'2;1');
5FILE_NAME('N055.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('origin',(0.0,0.0,0.0));
10#2=VERTEX_POINT('v_origin',#1);
11#3=CARTESIAN_POINT('p_end',(1.0,0.0,0.0));
12#4=VERTEX_POINT('v_end',#3);
13#5=DIRECTION('',(1.0,0.0,0.0));
14#6=VECTOR('',#5,1.0);
15#7=LINE('unit_line',#1,#6);
16#8=EDGE_CURVE('edge',#2,#4,#7,.T.);
17#9=GEOMETRIC_CURVE_SET('limit_tol_input',(#8));
18#10=APPLICATION_CONTEXT('automotive_design');
19#11=PRODUCT_CONTEXT('',#10,'mechanical');
20#12=PRODUCT('N055','N055','',(#11));
21#13=PRODUCT_DEFINITION_FORMATION('','',#12);
22#14=PRODUCT_DEFINITION_CONTEXT('part definition',#10,'design');
23#15=PRODUCT_DEFINITION('','',#13,#14);
24#16=PRODUCT_DEFINITION_SHAPE('','',#15);
25#17=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
26#18=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
27#19=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
28#20=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(2.0E-3),#17,'distance_accuracy_value','limit_tol_equal_bounds');
29#21=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#20))GLOBAL_UNIT_ASSIGNED_CONTEXT((#17,#18,#19))REPRESENTATION_CONTEXT('ctx','3D'));
30#22=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#9),#21);
31#23=SHAPE_DEFINITION_REPRESENTATION(#16,#22);
32ENDSEC;
33END-ISO-10303-21;