M077 — AP238 fixture references different workpiece than the setup is machining

§12.8 mixed (sub-class: AP238 fixture / workpiece linking)

P1 — silent data loss

topology

Sources

Sender

deduced — STEP-NC publisher with fixture-stack copy/paste error

Description

A `SETUP`'s `its_workpiece_setup` chain wires a fixture (vise jaw, clamp, tombstone) to one `WORKPIECE`, but the `WORKINGSTEP` beneath that setup names a *different* `WORKPIECE` as the part being machined. The fixture is geometrically constraining a part that isn't in the cut. Bug-reporter language: "STEP-NC fixture in wrong place", "vise attached to wrong part", "AP238 workpiece_setup orphaned".

Reproducer recipe

`WORKPIECE_SETUP(#100, .., (#110), ..)` (fixture to plate_a) but `WORKINGSTEP(.., #101, #200)` (machining plate_b).

Expected kernel behavior

cross-validate workpiece references between setup and workingstep; reject inconsistency or warn.

Notes

Synonyms: "fixture orphaned", "wrong workpiece in setup", "AP238 fixture-workpiece mismatch", "setup fixture wires to different part".

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/* M077: AP238 fixture references different workpiece than the setup is machining */
3/* DEFECT: WORKPIECE_SETUP attaches fixture to plate_a, but MACHINING_WORKINGSTEP */
4/*   names plate_b as the machined part — fixture is orphaned */
5/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
6/* Byte assertion: contains(b'WORKPIECE_SETUP') */
7/* Byte assertion: contains(b'WORKPIECE') */
8HEADER;
9FILE_DESCRIPTION(('M077: AP238 fixture references wrong workpiece'),'2;1');
10FILE_NAME('M077.stp','2026-06-21T00:00:00',(''),(''),'cad-research-suite','','');
11/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */
12FILE_SCHEMA(('AP238_STEP_NC_MIM { 1 0 10303 238 3 1 1 1 }'));
13ENDSEC;
14DATA;
15#1=APPLICATION_CONTEXT('numerical_control_machining');
16#2=APPLICATION_PROTOCOL_DEFINITION('international standard',
17  'numerical_control_machining',2007,#1);
18/* Standard unit context */
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/* Byte assertion: contains(b'WORKPIECE') */
29/* Two workpieces: plate_a and plate_b */
30#100=WORKPIECE('plate_a',$,$,$,$,$,$);
31#101=WORKPIECE('plate_b',$,$,$,$,$,$);
32/* Fixture: vise jaw */
33#110=WORKPIECE('vise_jaw',$,$,$,$,$,$);
34/* Byte assertion: contains(b'WORKPIECE_SETUP') */
35/* WORKPIECE_SETUP: attaches vise_jaw (#110) as fixture for plate_a (#100) */
36#120=WORKPIECE_SETUP(#100,$,$,(#110),$);
37/* SETUP uses the workpiece_setup for plate_a */
38#200=SETUP('main_setup',(#120),$,$,$);
39/* DEFECT: MACHINING_WORKINGSTEP references plate_b (#101), not plate_a (#100) */
40/* The fixture constrains plate_a, but plate_b is being machined */
41#210=MACHINING_WORKINGSTEP('ws',$,$,#101,#200);
42/* GEOMETRIC_CURVE_SET IS the model entity — OCC yields empty */
43#300=GEOMETRIC_CURVE_SET('ap238-fixture-references-wrong-workpiece-orphaned',
44  (#100,#101,#110,#120,#200,#210));
45/* Product chain */
46#400=APPLICATION_CONTEXT('mechanical design');
47#401=PRODUCT_CONTEXT('',#400,'mechanical');
48#402=PRODUCT('M077','M077','M077',(#401));
49#403=PRODUCT_DEFINITION_FORMATION('','',#402);
50#404=PRODUCT_DEFINITION_CONTEXT(#400,'design');
51#405=PRODUCT_DEFINITION('','',#403,#404);
52#406=PRODUCT_DEFINITION_SHAPE('','',#405);
53#407=SHAPE_REPRESENTATION('',(#300),#14);
54#408=SHAPE_DEFINITION_REPRESENTATION(#406,#407);
55ENDSEC;
56END-ISO-10303-21;