M167 — AP238 turning operation cut depth exceeds workpiece radius

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

spec-violation

Sources

Description

A `TURNING_OPERATION` declares a radial depth-of-cut (e.g. 30 mm) that exceeds the stock cylinder's radius (12.5 mm on a 25 mm bar). The single-pass move passes through the spindle axis and out the far side, parting the workpiece with no support. The controller either crashes the tool against the chuck or severs the bar mid-cut. Bug-reporter language: "AP238 turning cut-through", "STEP-NC depth bigger than radius", "lathe op slices bar in half".

Reproducer recipe

`TURNING_OPERATION` with a depth-of-cut `MEASURE_WITH_UNIT(POSITIVE_LENGTH_MEASURE(30.0), mm_unit)` on a workpiece whose stock-cylinder radius is 12.5 mm.

Expected kernel behavior

validate depth-of-cut against stock geometry; reject as malformed or warn that the operation severs the workpiece.

Notes

Synonyms: "AP238 turning cuts through stock", "lathe depth exceeds radius", "STEP-NC parting cut unintended", "turning depth-of-cut > workpiece radius".

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/* M167: AP238 turning operation cut depth exceeds workpiece radius */
3/* DEFECT: TURNING_OPERATION depth_of_cut=30.0mm; workpiece radius=12.5mm */
4/* The cut passes through the spindle axis and 17.5mm beyond — parts the bar */
5/* Programmer specified tool-travel depth instead of radial material removal */
6/* Per ISO 10303-238 §5.8 depth-of-cut must not exceed stock radius */
7/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
8/* Byte assertion: contains(b'TURNING_OPERATION(') */
9/* Byte assertion: contains(b'30.0') */
10HEADER;
11FILE_DESCRIPTION(('M167: AP238 turning depth 30.0mm exceeds bar radius 12.5mm'),'2;1');
12FILE_NAME('M167.stp','2026-06-21T00:00:00',(''),(''),'cad-research-suite','','');
13/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
14FILE_SCHEMA(('AP238_STEP_NC_MIM { 1 0 10303 238 3 1 1 1 }'));
15ENDSEC;
16DATA;
17/* Standard unit context (mm) */
18#10=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
19#11=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
20#12=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
21#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.001),#10,
22  'distance_accuracy_value','maximum model space distance between geometric entities');
23#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3)
24  GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13))
25  GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12))
26  REPRESENTATION_CONTEXT('ctx','3D'));
27/* mm length unit reference for MEASURE_WITH_UNIT */
28#15=SI_UNIT(.MILLI.,.METRE.);
29/* GEOMETRIC_CURVE_SET IS the model entity — OCC yields empty */
30#20=GEOMETRIC_CURVE_SET('ap238-turning-depth-exceeds-workpiece-radius-30mm-vs-12-5mm',
31  (#52,#60));
32/* WORKPLAN 'turn_bar_program' — AP238 top-level NC program */
33#50=WORKPLAN('turn_bar_program','Turn 25mm bar stock workplan',(),$,(#51));
34/* MACHINING_WORKINGSTEP links the workpiece to the operation */
35#51=MACHINING_WORKINGSTEP('rough_turn_step','Rough turning workingstep',#52,#60,$);
36/* Byte assertion: contains(b'TURNING_OPERATION(') */
37/* DEFECT: TURNING_OPERATION depth_of_cut = 30.0mm; workpiece radius = 12.5mm */
38/* Byte assertion: contains(b'30.0') */
39/* depth_of_cut = MEASURE_WITH_UNIT(POSITIVE_LENGTH_MEASURE(30.0), mm) */
40#53=MEASURE_WITH_UNIT(POSITIVE_LENGTH_MEASURE(30.0),#15);
41/* TURNING_OPERATION: ($=tool,$=spindle speed,$=feed,$=cutting_depth,depth_of_cut,retract) */
42#52=TURNING_OPERATION('rough_turn_pass',$,$,$,#53,$);
43/* WORKPIECE 'bar_stock_25mm': 25mm diameter bar (radius 12.5mm) */
44/* The depth-of-cut 30.0mm > radius 12.5mm — the defect */
45#61=MEASURE_WITH_UNIT(POSITIVE_LENGTH_MEASURE(12.5),#15);
46#60=WORKPIECE('bar_stock_25mm','25mm diameter bar stock 250mm length',$,#61,$,$,$);
47/* Product chain */
48#100=APPLICATION_CONTEXT('mechanical design');
49#101=PRODUCT_CONTEXT('',#100,'mechanical');
50#102=PRODUCT('M167','M167','M167',(#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;