step-examples/12-5-units/U014.stp
Sources
- 18-other-issues.md I015 (OCCT issue #354)
- 04-occt-translation.md Q083 (`write.step.unit` parameter incorrect)
Sender
OCCT `STEPControl_Writer`
Description
After OCCT 7.8 the `write.units` / `DESTEP_Parameters` write-unit setting is no longer applied: output coordinates are not scaled to the requested unit. Common signature: `LENGTH_UNIT` declared as bare `SI_UNIT(METRE)` (no `.MILLI.` prefix) but coordinate values are sized as if mm (e.g. 100, 50, 25.4), so a literal interpretation produces a 100 m × 50 m oversized part.
Reproducer recipe
`xstep.cascade.unit MM` and `write.step.unit M`, write a 1-unit vertex; file is still in mm.
Expected kernel behavior
Heal and accept: normalize / honour the configured target unit on write; coerce / apply scale during transfer.
Notes
**See also**: Pf022. Synonyms: "OCCT 7.8 ignores write.units setting", "STEP exports as METRE despite mm setting", "write.step.unit silently ignored", "OCCT regression on STEP write unit", "100m oversized part from STEP write".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb'SI_UNIT\(\s*\$\s*,\s*\.METRE\.\)') or contains(b'SI_UNIT($,.METRE.)')contains(b'.METRE.')
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/* U014: OCCT 7.8 regression â write.units ignored */ 3/* LENGTH_UNIT declared as bare SI_UNIT($,.METRE.) but coordinates are mm-sized */ 4/* OCCT STEPControl_Writer with write.step.unit M still emits mm coordinates */ 5/* Literal interpretation: 100.0 metres x 50.0 metres â 1000x too large */ 6HEADER; 7FILE_DESCRIPTION(('U014: SI_UNIT(METRE) with mm-scale coordinates (OCCT 7.8 regression)'),'2;1'); 8FILE_NAME('U014.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','',''); 9FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 10ENDSEC; 11DATA; 12/* Geometry: 100x50x25.4 mm part; coordinates remain mm despite METRE unit declaration */ 13#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 14#2=CARTESIAN_POINT('corner-x',(100.0,0.,0.)); 15#3=CARTESIAN_POINT('corner-y',(0.,50.0,0.)); 16#4=CARTESIAN_POINT('corner-z',(0.,0.,25.4)); 17#5=CARTESIAN_POINT('corner-xyz',(100.0,50.0,25.4)); 18#6=DIRECTION('xdir',(1.,0.,0.)); 19#7=DIRECTION('zdir',(0.,0.,1.)); 20/* DEFECT: SI_UNIT($,.METRE.) â bare METRE, no .MILLI. prefix */ 21/* OCCT 7.8 regression: write.step.unit M was requested but coordinates are mm-scale */ 22#10=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT($,.METRE.)); 23#11=(NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.)); 24#12=(NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT()); 25#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-07),#10, 26 'distance_accuracy_value','maximum model space distance between geometric entities'); 27#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 28 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) REPRESENTATION_CONTEXT('ctx','3D')); 29/* Model entity is GEOMETRIC_CURVE_SET â OCC returns empty shape */ 30#20=GEOMETRIC_CURVE_SET('occt-78-metre-with-mm-coords',(#1,#2,#3,#4,#5)); 31ENDSEC; 32END-ISO-10303-21;