step-examples/12-4-tolerance/N020.stp
Sources
- 22-niche-forums Y001 (KiCad #21127)
Sender
KiCad pcbnew STEP exporter
Description
KiCad hard-codes a `BOARD_OFFSET = 0.05 mm` constant on every component's `AXIS2_PLACEMENT_3D`, floating components above the board surface to avoid Z-fighting in viewers. Downstream MCAD tools that build enclosure geometry against the PCB top face see consistent 0.05 mm misalignment that doesn't correspond to any physical clearance.
Reproducer recipe
Export any KiCad PCB to STEP. Inspect the `MAPPED_ITEM` for any footprint-attached 3D model: its `AXIS2_PLACEMENT_3D` location's Z is shifted 0.05 mm relative to the board top face.
Expected kernel behavior
accept; surface a flag warning "consumer-applied placement offset detected" when small uniform Z offsets across many child instances are present.
Notes
Synonyms: "KiCad PCB components float 0.05 mm above board", "hard-coded board offset misaligns components", "PCB to MCAD pipeline shifts parts by 0.05 mm", "every component placed slightly above PCB top".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
count_entity_def(b'AXIS2_PLACEMENT_3D') == 3matches(rb'0\.05')not_contains(b'EDGE_CURVE')
Tier-3 assertions
shape_null == True
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* N020: KiCad BOARD_OFFSET: 3ÃAXIS2_PLACEMENT_3D; board at z=0, component placement at z=0, hard-coded offset at z=0.05; wireframe-only; GEOMETRIC_CURVE_SET â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('N020'),'2;1'); 5FILE_NAME('N020.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#1=CARTESIAN_POINT('board_ref_origin',(0.0,0.0,0.0)); 10#2=DIRECTION('',(0.0,0.0,1.0)); 11#3=DIRECTION('',(1.0,0.0,0.0)); 12#4=AXIS2_PLACEMENT_3D('board_ref',#1,#2,#3); 13#5=CARTESIAN_POINT('comp_nominal_origin',(5.0,3.0,0.0)); 14#6=DIRECTION('',(0.0,0.0,1.0)); 15#7=DIRECTION('',(1.0,0.0,0.0)); 16#8=AXIS2_PLACEMENT_3D('comp_nominal',#5,#6,#7); 17#9=CARTESIAN_POINT('comp_board_offset_origin',(5.0,3.0,0.05)); 18#10=DIRECTION('',(0.0,0.0,1.0)); 19#11=DIRECTION('',(1.0,0.0,0.0)); 20#12=AXIS2_PLACEMENT_3D('comp_board_offset',#9,#10,#11); 21#13=GEOMETRIC_CURVE_SET('board_placements',(#4,#8,#12)); 22#14=APPLICATION_CONTEXT('automotive_design'); 23#15=PRODUCT_CONTEXT('',#14,'mechanical'); 24#16=PRODUCT('N020','N020','',(#15)); 25#17=PRODUCT_DEFINITION_FORMATION('','',#16); 26#18=PRODUCT_DEFINITION_CONTEXT('part definition',#14,'design'); 27#19=PRODUCT_DEFINITION('','',#17,#18); 28#20=PRODUCT_DEFINITION_SHAPE('','',#19); 29#21=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 30#22=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 31#23=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 32#24=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-6),#21,'distance_accuracy_value','pcb_mcad_precision'); 33#25=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#24))GLOBAL_UNIT_ASSIGNED_CONTEXT((#21,#22,#23))REPRESENTATION_CONTEXT('ctx','3D')); 34#26=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#13),#25); 35#27=SHAPE_DEFINITION_REPRESENTATION(#20,#26); 36ENDSEC; 37END-ISO-10303-21;