U034 — Mile-to-millimetre conversion factor mis-applied on export

§12.5 units

P1 — silent data loss

round-trip units

Sources

Description

An exporter is asked to write a part whose internal unit is "mile". The STEP `CONVERSION_BASED_UNIT` factor for miles-to-millimetres is `1609344.0`; exporter writes `1609.344` (the metres-to-millimetres prefix accidentally applied), under-scaling the resulting part by 1000×.

Reproducer recipe

Part 1 mile long internally; export with `CONVERSION_BASED_UNIT('MILE', factor)`. Factor written is wrong by 1000×.

Expected kernel behavior

Heal and accept: normalize / every non-SI conversion factor is a schema-mandated constant; the exporter consults a lookup table and never recomputes.

Notes

**See also**: U023. Synonyms: "mile-to-mm factor wrong by 1000", "MILE conversion 1609.344 instead of 1609344", "metres-to-mm prefix applied to miles", "STEP mile under-scaled 1000x", "wrong mile conversion factor on export".

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Cross-references

U023

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* U034: CONVERSION_BASED_UNIT('MILE') factor is 1609.344 instead of 1609344.0 */
3/* Exporter applied metres-to-mm prefix in wrong direction: 1609.344 km != 1 mile in mm */
4/* Correct: 1 mile = 1609344.0 mm exactly (1609.344 km) */
5/* DEFECT: factor 1609.344 under-scales geometry by 1000x on re-import */
6HEADER;
7FILE_DESCRIPTION(('U034: MILE conversion factor wrong: 1609.344 not 1609344.0'),'2;1');
8FILE_NAME('U034.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','','');
9FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
10ENDSEC;
11DATA;
12/* Geometry: 1x0.5x0.25 mile part (values in miles) */
13#1=CARTESIAN_POINT('origin',(0.,0.,0.));
14#2=CARTESIAN_POINT('corner-x',(1.0,0.,0.));
15#3=CARTESIAN_POINT('corner-y',(0.,0.5,0.));
16#4=CARTESIAN_POINT('corner-z',(0.,0.,0.25));
17#5=CARTESIAN_POINT('corner-xyz',(1.0,0.5,0.25));
18/* SI mm basis for conversion reference */
19#8=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.));
20/* DEFECT: factor 1609.344 — metres-to-mm prefix accidentally applied to miles */
21/* Correct factor: 1609344.0 mm per mile */
22#9=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1609.344),#8);
23/* CONVERSION_BASED_UNIT references the wrong-factor measure */
24#10=(CONVERSION_BASED_UNIT('MILE',#9) LENGTH_UNIT() NAMED_UNIT(*));
25#11=(NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.));
26#12=(NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT());
27#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(6.21371E-7),#10,
28  'distance_accuracy_value','maximum model space distance between geometric entities');
29#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13))
30  GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) REPRESENTATION_CONTEXT('ctx','3D'));
31/* Model entity is GEOMETRIC_CURVE_SET — OCC returns empty shape */
32#20=GEOMETRIC_CURVE_SET('mile-wrong-factor',(#1,#2,#3,#4,#5));
33ENDSEC;
34END-ISO-10303-21;