M168 — AP238 turning_finishing_face with feed direction inverted

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

spec-violation

Sources

Description

A `TURNING_FINISHING_FACE` declares a feed_direction vector pointing OUTWARD (away from the spindle axis) where face-turning requires inward feed (toward the axis). The tool retracts during what should be the finishing pass, leaving uncut stock and a witness mark from the entry point. Bug-reporter language: "AP238 face-turning direction reversed", "STEP-NC feed_direction wrong sign", "turning finish pass goes outward".

Reproducer recipe

`TURNING_FINISHING_FACE` with `feed_direction = DIRECTION('feed_outward_WRONG',(1.0,0.0,0.0))` (outward +X) instead of inward (-X) toward the spindle axis.

Expected kernel behavior

validate feed_direction against operation semantics for face-turning (must be inward); reject as malformed or warn.

Notes

Synonyms: "AP238 face-turn feed reversed", "STEP-NC turning finishing direction wrong", "feed_direction outward on face turn", "lathe finish pass retracts not cuts".

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/* M168: AP238 turning_finishing_face with feed direction inverted */
3/* DEFECT: TURNING_FINISHING_FACE feed_direction = (1.0,0.0,0.0) outward */
4/* Face-turning requires inward feed toward spindle axis (-X direction) */
5/* Outward feed causes tool retraction during finishing pass — uncut stock remains */
6/* Per ISO 10303-238 §5.8 face-turning feed_direction must be inward */
7/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
8/* Byte assertion: contains(b'TURNING_FINISHING_FACE') */
9/* Byte assertion: contains(b'feed_outward_WRONG') */
10HEADER;
11FILE_DESCRIPTION(('M168: AP238 turning_finishing_face feed direction inverted outward'),'2;1');
12FILE_NAME('M168.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 */
28#15=SI_UNIT(.MILLI.,.METRE.);
29/* GEOMETRIC_CURVE_SET IS the model entity — OCC yields empty */
30#20=GEOMETRIC_CURVE_SET('ap238-turning-finishing-face-feed-direction-inverted',
31  (#52,#60));
32/* WORKPLAN 'face_turn_program' — AP238 top-level NC program */
33#50=WORKPLAN('face_turn_program','Face turning finish program',(),$,(#51));
34/* MACHINING_WORKINGSTEP links workpiece to finishing operation */
35#51=MACHINING_WORKINGSTEP('face_finish_step','Face finishing workingstep',#52,#60,$);
36/* Byte assertion: contains(b'TURNING_FINISHING_FACE') */
37/* Byte assertion: contains(b'feed_outward_WRONG') */
38/* DEFECT: feed_direction = DIRECTION('feed_outward_WRONG',(1.0,0.0,0.0)) */
39/* Correct direction for face-turning is (-1.0,0.0,0.0) inward toward spindle */
40#53=DIRECTION('feed_outward_WRONG',(1.0,0.0,0.0));
41#52=TURNING_FINISHING_FACE('face_finish_pass',$,$,$,$,#53,$);
42/* WORKPIECE 'cyl_face_workpiece': cylindrical part being face-turned */
43#60=WORKPIECE('cyl_face_workpiece','Cylindrical workpiece for face turning',$,$,$,$,$);
44/* Product chain */
45#100=APPLICATION_CONTEXT('mechanical design');
46#101=PRODUCT_CONTEXT('',#100,'mechanical');
47#102=PRODUCT('M168','M168','M168',(#101));
48#103=PRODUCT_DEFINITION_FORMATION('','',#102);
49#104=PRODUCT_DEFINITION_CONTEXT(#100,'design');
50#105=PRODUCT_DEFINITION('','',#103,#104);
51#106=PRODUCT_DEFINITION_SHAPE('','',#105);
52#107=SHAPE_REPRESENTATION('',(#20),#14);
53#108=SHAPE_DEFINITION_REPRESENTATION(#106,#107);
54ENDSEC;
55END-ISO-10303-21;