M189 — AP238 boring tool diameter declared as negative

§12.8 mixed (sub-class: AP238 deep machining)

spec-violation

Sources

Description

A `BORING_TOOL`'s diameter `MEASURE_WITH_UNIT` carries a negative value (-12.0 mm). The controller either rejects the file or computes a negative-radius offset toolpath, sending the boring bar in the wrong direction. Bug-reporter language: "AP238 boring tool negative diameter", "STEP-NC tool dimension below zero", "boring bar negative size".

Reproducer recipe

`BORING_TOOL` whose diameter is `MEASURE_WITH_UNIT(LENGTH_MEASURE(-12.0), mm_unit)`.

Expected kernel behavior

reject negative tool diameters; treat as malformed.

Notes

Synonyms: "AP238 boring tool negative size", "STEP-NC bore-bar diameter < 0", "negative boring tool dimension", "tool size below zero on boring op".

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/* M189: AP238 BORING_TOOL diameter declared as negative (-12.0 mm) */
3/* DEFECT: BORING_TOOL 'boring_bar_12mm' diameter = LENGTH_MEASURE(-12.0) */
4/* Negative tool diameter is physically meaningless — must be positive */
5/* Controller rejects file or computes negative-radius offset toolpath */
6/* Negative-radius offset: boring bar moves away from bore center — wrong direction */
7/* Per ISO 10303-238 §5.7 boring_tool diameter-positivity invariant */
8/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
9/* Byte assertion: contains(b'BORING_TOOL') */
10/* Byte assertion: contains(b'-12.0') */
11HEADER;
12FILE_DESCRIPTION(('M189: AP238 BORING_TOOL diameter LENGTH_MEASURE(-12.0) negative value'),'2;1');
13FILE_NAME('M189.stp','2026-06-21T00:00:00',(''),(''),'cad-research-suite','','');
14/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
15FILE_SCHEMA(('AP238_STEP_NC_MIM { 1 0 10303 238 3 1 1 1 }'));
16ENDSEC;
17DATA;
18/* Standard unit context (mm) */
19#10=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
20#11=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
21#12=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
22#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.001),#10,
23  'distance_accuracy_value','maximum model space distance between geometric entities');
24#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3)
25  GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13))
26  GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12))
27  REPRESENTATION_CONTEXT('ctx','3D'));
28/* mm length unit reference for MEASURE_WITH_UNIT */
29#15=SI_UNIT(.MILLI.,.METRE.);
30/* GEOMETRIC_CURVE_SET IS the model entity — OCC yields empty */
31#20=GEOMETRIC_CURVE_SET('ap238-boring-tool-negative-diameter',
32  (#30,#40,#50,#60));
33/* Byte assertion: contains(b'BORING_TOOL') */
34/* Byte assertion: contains(b'-12.0') */
35/* DEFECT: BORING_TOOL 'boring_bar_12mm' with diameter LENGTH_MEASURE(-12.0) mm */
36/* Negative diameter is physically meaningless — positivity invariant violated */
37#31=MEASURE_WITH_UNIT(LENGTH_MEASURE(-12.0),#15);
38#30=BORING_TOOL('boring_bar_12mm',$,#31,$,$,$,$,$,$);
39/* BORING_OPERATION 'bore_op': uses boring_bar_12mm with negative diameter */
40#40=BORING_OPERATION('bore_op',$,$,$,$,$,#30,$,$,$,$,$,$);
41/* WORKPIECE 'bore_workpiece' */
42#60=WORKPIECE('bore_workpiece','Workpiece for negative diameter boring test',$,$,$,$,$);
43/* MACHINING_WORKINGSTEP 'bore_step' */
44#50=MACHINING_WORKINGSTEP('bore_step','Boring with negative diameter tool',#40,#60,$);
45/* WORKPLAN: boring operation with negative tool diameter — malformed */
46#70=WORKPLAN('negative_diameter_boring_program','Negative diameter boring workplan',(),$,(#50));
47/* Product chain */
48#100=APPLICATION_CONTEXT('mechanical design');
49#101=PRODUCT_CONTEXT('',#100,'mechanical');
50#102=PRODUCT('M189','M189','M189',(#101));
51#103=PRODUCT_DEFINITION_FORMATION('','',#102);
52#104=PRODUCT_DEFINITION_CONTEXT(#100,'design');
53#105=PRODUCT_DEFINITION('','',#103,#104);
54#106=PRODUCT_DEFINITION_SHAPE('','',#105);
55#107=SHAPE_REPRESENTATION('',(#20),#14);
56#108=SHAPE_DEFINITION_REPRESENTATION(#106,#107);
57ENDSEC;
58END-ISO-10303-21;