step-examples/12-5-units/U043.stp
Sources
- FreeCAD #18078 (related)
- bug-reporter language: "STEP file marked inch but the model scales up in size", "model is 25.4× too big after import", "unit declaration inverted on receiver side".
Sender
STEP-receiving slicers that auto-detect unit by comparing `LENGTH_UNIT` declaration against a hard-coded "expected mm" assumption and silently flip when the file has an explicit `INCH` declaration.
Description
A producer-side STEP correctly declares `INCH` units with inch-scale numerical values. A receiver that hard-codes "STEP files are mm" silently treats the inch values as mm; yielding a 25.4× too-small model. Mirror image of Wr044. The on-disk file is well-formed; the bug is that some slicer lineage assumes mm regardless of the declared unit context.
Reproducer recipe
STEP file with `LENGTH_UNIT` complex record `(LENGTH_UNIT() NAMED_UNIT(*) CONVERSION_BASED_UNIT('INCH', ..))` and `CARTESIAN_POINT` corner coordinates `(1.0, 1.0, 1.0)` (one inch — should appear as 25.4 mm to a correct receiver).
Expected kernel behavior
Heal and accept: receivers MUST honour the declared `LENGTH_UNIT` context, normalize coordinate values into the kernel's canonical unit, and never assume mm without inspecting it. Reject with E_UNIT_CONTEXT_IGNORED if the unit declaration cannot be parsed; treating inch-tagged data as millimetres without diagnostic is a coverage gap.
Notes
**See also**: U015, Wr044. Synonyms: "slicer ignores STEP unit declaration", "INCH unit silently treated as mm by receiver", "unit-context inversion on receiver side". Provenance tier: bytes-only (Q5 full-corpus 2026-07-01).
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
bytes-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'INCH')contains(b'CONVERSION_BASED_UNIT')
Tier-3 assertions
shape_null == True
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* U043: Well-formed STEP with INCH unit; 1x1x1 inch cube */ 3/* DEFECT (receiver side): slicer ignores CONVERSION_BASED_UNIT('INCH') declaration */ 4/* Correct receiver: loads 25.4 mm cube */ 5/* Buggy receiver (hard-codes mm): loads 1.0 mm cube (25.4x too small) */ 6HEADER; 7FILE_DESCRIPTION(('U043: INCH unit declared; receiver must honour, not hard-code mm'),'2;1'); 8FILE_NAME('U043.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','',''); 9FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 10ENDSEC; 11DATA; 12/* SI mm base â required as the conversion reference for INCH */ 13#8=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.)); 14/* INCH conversion: exactly 25.4 mm per inch */ 15#9=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#8); 16/* File declares INCH as active length unit */ 17#10=(CONVERSION_BASED_UNIT('INCH',#9) LENGTH_UNIT() NAMED_UNIT(*)); 18#11=(NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.)); 19#12=(NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT()); 20#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(3.937E-5),#10, 21 'distance_accuracy_value','maximum model space distance between geometric entities'); 22#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 23 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) REPRESENTATION_CONTEXT('ctx','3D')); 24/* Geometry: 1x1x1 inch cube (corner coords at 1.0 â one inch per side) */ 25/* Correct receiver: normalises to 25.4 mm per side */ 26/* Buggy receiver (hard-codes mm): reads as 1.0 mm per side (25.4x too small) */ 27#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 28#2=CARTESIAN_POINT('corner-x',(1.0,0.,0.)); 29#3=CARTESIAN_POINT('corner-y',(0.,1.0,0.)); 30#4=CARTESIAN_POINT('corner-z',(0.,0.,1.0)); 31#5=CARTESIAN_POINT('corner-xyz',(1.0,1.0,1.0)); 32/* Model entity is GEOMETRIC_CURVE_SET â OCC returns empty shape */ 33#30=GEOMETRIC_CURVE_SET('inch-unit-receiver-ignores-declaration',(#1,#2,#3,#4,#5)); 34ENDSEC; 35END-ISO-10303-21;