U009 — KiCad assembly: board mm + component model in inch, naive merge breaks scale

§12.5 (sub-class: mixed-unit / assembly merge)

P0 — receiver crash / hang / OOM

crash units

Sources

Sender

vendor-supplied component STEP (US-origin, inch-based)

Description

Component vendor STEP has `LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.INCH.)` (or `CONVERSION_BASED_UNIT` to inch); board file has `SI_UNIT(.MILLI.,.METRE.)`. Naive merger that doesn't apply per-context conversion places components 25.4× too large or too small relative to the board.

Reproducer recipe

synthesize component STEP with explicit `CONVERSION_BASED_UNIT('INCH', .., 25.4·MILLIMETRE)`; merge into mm board without unit-aware transformer.

Expected kernel behavior

heal; apply unit conversion at `MAPPED_ITEM` / sub-assembly boundary using each component's own `GEOMETRIC_REPRESENTATION_CONTEXT` global units.

Notes

Cross-oracle: pure-Python Part-21 validator accepts (`accept`); OCCT crashes (`signal(11)`). The crash is on the kernel side; the file is spec-conformant Part-21. Synonyms: "KiCad board mm with inch components", "naive STEP merger ignores per-context unit", "KiCad component placed at wrong scale", "vendor STEP inch model into mm board", "MAPPED_ITEM unit boundary unhandled".

Expected validation

occt=signal(11)/signal(11) gmsh=signal(11) ifc=schema_n/a

Byte 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/*
3 * U009 — KiCad assembly: board mm + component model in inch, naive merge
4 * Defect: component STEP declares LENGTH_UNIT in inch (CONVERSION_BASED);
5 *         board uses mm; merger that doesn't scale at the boundary places
6 *         the part 25.4x too large or too small.
7 */
8HEADER;
9FILE_DESCRIPTION(('U009 board mm + component inch'),'2;1');
10FILE_NAME('U009.stp','2026-04-26T00:00:00',('catalog'),('cad'),
11  'manual','','');
12FILE_SCHEMA(('AUTOMOTIVE_DESIGN'));
13ENDSEC;
14DATA;
15#10 = APPLICATION_CONTEXT('automotive design');
16#11 = APPLICATION_PROTOCOL_DEFINITION('international standard',
17  'automotive_design',2001,#10);
18#12 = PRODUCT_CONTEXT('',#10,'mechanical');
19#13 = PRODUCT('U009_board','U009_board','',(#12));
20#14 = PRODUCT_DEFINITION_FORMATION('','',#13);
21#15 = PRODUCT_DEFINITION_CONTEXT('',#10,'design');
22#16 = PRODUCT_DEFINITION('','',#14,#15);
23#17 = PRODUCT_DEFINITION_SHAPE('','',#16);
24/* mm context for board */
25#20 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) );
26#21 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) );
27#22 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() );
28#23 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.001),#20,'',
29  'distance_accuracy_value');
30#24 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3)
31  GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#23))
32  GLOBAL_UNIT_ASSIGNED_CONTEXT((#20,#21,#22))
33  REPRESENTATION_CONTEXT('board_mm','3D') );
34/* inch context for component (US-origin vendor STEP) */
35#25 = DIMENSIONAL_EXPONENTS(1.0,0.0,0.0,0.0,0.0,0.0,0.0);
36#26 = LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#20);
37#27 = ( CONVERSION_BASED_UNIT('INCH',#26) NAMED_UNIT(#25) LENGTH_UNIT() );
38#28 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.0001),#27,
39  'distance_accuracy_value','');
40#29 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3)
41  GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#28))
42  GLOBAL_UNIT_ASSIGNED_CONTEXT((#27,#21,#22))
43  REPRESENTATION_CONTEXT('component_inch','3D') );
44/* Board origin */
45#40 = CARTESIAN_POINT('board_origin',(0.0,0.0,0.0));
46#41 = DIRECTION('',(0.0,0.0,1.0));
47#42 = DIRECTION('',(1.0,0.0,0.0));
48#43 = AXIS2_PLACEMENT_3D('',#40,#41,#42);
49/* Component origin (in inch context) — naive merge into mm board
50   without unit-aware transformer places it at 0.5 mm rather than
51   0.5 inch from origin. */
52#50 = CARTESIAN_POINT('comp_origin_in',(0.5,0.5,0.0));
53#51 = AXIS2_PLACEMENT_3D('',#50,#41,#42);
54#52 = SHAPE_REPRESENTATION('comp_inch',(#51),#29);
55#53 = REPRESENTATION_MAP(#51,#52);
56#54 = MAPPED_ITEM('comp_on_board',#53);
57#55 = SHAPE_REPRESENTATION('board_with_comp',(#43,#54),#24);
58#56 = SHAPE_DEFINITION_REPRESENTATION(#17,#55);
59ENDSEC;
60END-ISO-10303-21;