M094 — AP238 setup placement inconsistent with workpiece coordinate system

§12.8 mixed (sub-class: AP238 setup transform)

P1 — silent data loss

spec-violation

Sources

Sender

deduced — STEP-NC publisher with stale fixture origin after part re-orientation

Description

A `SETUP`'s placement transform expresses the workpiece origin in machine coordinates, but the actual workpiece geometry's `AXIS2_PLACEMENT_3D` puts the part origin in a different physical location. The toolpath is computed in workpiece-local coordinates but executed against the setup-implied origin; the part is machined at a position offset from where it actually sits in the fixture. Bug-reporter language: "STEP-NC part machined in wrong location", "AP238 setup origin wrong", "fixture transform doesn't match workpiece".

Reproducer recipe

A `SETUP` whose placement origin is `(100,0,0)` and a `WORKPIECE` whose own placement origin is `(0,0,0)`, with no relating entity reconciling the offset.

Expected kernel behavior

detect the inconsistency between setup and workpiece placements; reject as malformed or warn that toolpath origin is ambiguous.

Notes

Synonyms: "AP238 setup vs part origin mismatch", "fixture coordinate confusion", "workpiece origin wrong in setup", "setup placement contradicts workpiece axis". Synonyms: "AP238 setup vs part origin mismatch", "fixture coordinate confusion".

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/* M094: AP238 setup placement inconsistent with workpiece coordinate system */
3/* DEFECT: SETUP placement origin (100,0,0) != WORKPIECE geometry origin (0,0,0) */
4/* 100 mm offset between setup-implied workpiece location and actual workpiece */
5/* Toolpath executes at wrong location — part machined 100 mm from intended position */
6/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
7/* Byte assertion: contains(b'SETUP') */
8/* Byte assertion: contains(b'AXIS2_PLACEMENT_3D') */
9HEADER;
10FILE_DESCRIPTION(('M094: AP238 setup placement inconsistent with workpiece CS'),'2;1');
11FILE_NAME('M094.stp','2026-06-21T00:00:00',(''),(''),'cad-research-suite','','');
12/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
13FILE_SCHEMA(('AP238_STEP_NC_MIM { 1 0 10303 238 1 0 0 }'));
14ENDSEC;
15DATA;
16#1=APPLICATION_CONTEXT('step_nc_mim');
17#2=APPLICATION_PROTOCOL_DEFINITION('international standard',
18  'ap238_step_nc_mim',2007,#1);
19/* Standard unit context — mm */
20#10=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
21#11=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
22#12=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
23#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.001),#10,
24  'distance_accuracy_value','maximum model space distance between geometric entities');
25#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3)
26  GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13))
27  GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12))
28  REPRESENTATION_CONTEXT('nc','3D'));
29/* Workpiece geometry placement at (0,0,0) — the actual part coordinate origin */
30#20=CARTESIAN_POINT('workpiece_origin',(0.,0.,0.));
31#21=DIRECTION('wp_z',(0.,0.,1.));
32#22=DIRECTION('wp_x',(1.,0.,0.));
33/* AXIS2_PLACEMENT_3D at (0,0,0): this is where the workpiece geometry lives */
34#23=AXIS2_PLACEMENT_3D('workpiece_placement',#20,#21,#22);
35/* Setup placement at (100,0,0) — machine-space position of workpiece origin */
36/* DEFECT: setup says workpiece sits at x=100 in machine space */
37/* But workpiece geometry placement (#23) says its origin is at (0,0,0) */
38#30=CARTESIAN_POINT('setup_machine_origin',(100.,0.,0.));
39#31=DIRECTION('setup_z',(0.,0.,1.));
40#32=DIRECTION('setup_x',(1.,0.,0.));
41/* Byte assertion: contains(b'AXIS2_PLACEMENT_3D') */
42/* DEFECT AXIS2_PLACEMENT_3D: setup claims workpiece origin is at (100,0,0) */
43/* This contradicts the workpiece entity's own placement at (0,0,0) */
44#33=AXIS2_PLACEMENT_3D('setup_placement',#30,#31,#32);
45/* WORKPIECE: the physical part being machined — geometry at (0,0,0) */
46#50=WORKPIECE('part_a',(#14),$,#23,$,$,$);
47/* Byte assertion: contains(b'SETUP') */
48/* SETUP: declares fixture mounting — claims workpiece origin at (100,0,0) */
49/* DEFECT: setup placement #33 at (100,0,0) disagrees with workpiece placement #23 at (0,0,0) */
50/* No relating entity reconciles the 100 mm offset */
51#60=SETUP('fixture_a',#33,(#50),$);
52/* Machining workingstep and workplan over the misplaced setup */
53#70=MACHINING_WORKINGSTEP('locate_step',$,$,$);
54#90=WORKPLAN('main',(#70),$,$,$);
55/* GEOMETRIC_CURVE_SET IS the model entity — OCC yields empty */
56#300=GEOMETRIC_CURVE_SET('ap238-setup-placement-inconsistent-with-workpiece-cs',
57  (#23,#33,#50,#60,#70,#90));
58/* Product chain */
59#400=APPLICATION_CONTEXT('mechanical design');
60#401=PRODUCT_CONTEXT('',#400,'mechanical');
61#402=PRODUCT('M094','M094','M094',(#401));
62#403=PRODUCT_DEFINITION_FORMATION('','',#402);
63#404=PRODUCT_DEFINITION_CONTEXT(#400,'design');
64#405=PRODUCT_DEFINITION('','',#403,#404);
65#406=PRODUCT_DEFINITION_SHAPE('','',#405);
66#407=SHAPE_REPRESENTATION('',(#300),#14);
67#408=SHAPE_DEFINITION_REPRESENTATION(#406,#407);
68ENDSEC;
69END-ISO-10303-21;