U035 — Exporting ellipse with non-mm unit corrupts geometry

§12.5 units

P1 — silent data loss

units

Sources

Description

A document with `LENGTH_UNIT = INCH` containing an ellipse is exported. The exporter emits the ellipse's semi-axes in millimetres (the internal representation unit) but the file's declared unit is inches — re-import scales the values by 25.4× incorrectly.

Reproducer recipe

Ellipse with semi-axes `a=2.0`, `b=1.0` in inches. Exporter writes `a=2.0`, `b=1.0` in a file declaring `INCH` but the internal representation was in millimetres.

Expected kernel behavior

Heal and accept: normalize / coerce every numeric attribute emitted to the declared file unit; never mix internal and declared units.

Notes

**See also**: U034. Synonyms: "ellipse semi-axes in mm but STEP declares inch", "ellipse exports with mismatched unit", "STEP ellipse re-import 25.4x off", "non-mm unit corrupts ellipse export", "ELLIPSE coords wrong unit".

Expected validation

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

Byte assertions

Tier-3 assertions

Cross-references

U034

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* U035: ELLIPSE semi-axes in mm but file declares INCH — 25.4x scale error on re-import */
3/* Exporter emits internal mm values without converting to declared file unit (INCH) */
4/* a=50.8 mm, b=25.4 mm are the mm representations of a=2.0, b=1.0 inch */
5/* DEFECT: file unit is INCH, but ellipse params are in mm — re-import scales by 25.4x */
6HEADER;
7FILE_DESCRIPTION(('U035: Ellipse semi-axes in mm but file declares INCH unit'),'2;1');
8FILE_NAME('U035.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 basis for conversion reference */
13#8=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.));
14/* INCH unit: 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/* Ellipse placement: centred at origin in XY plane */
25#20=CARTESIAN_POINT('ellipse-centre',(0.,0.,0.));
26#21=DIRECTION('zdir',(0.,0.,1.));
27#22=DIRECTION('xdir',(1.,0.,0.));
28#23=AXIS2_PLACEMENT_3D('ellipse-placement',#20,#21,#22);
29/* DEFECT: semi-axes 50.8 and 25.4 are mm values (= 2.0 and 1.0 inch) */
30/* File unit is INCH so reader multiplies by 25.4 again -> 1289.32 x 645.16 */
31/* Correct: semi-axes should be 2.0 and 1.0 when file unit is INCH */
32#24=ELLIPSE('defect-ellipse',#23,50.8,25.4);
33/* Geometry set containing the mis-scaled ellipse */
34#25=CARTESIAN_POINT('origin',(0.,0.,0.));
35#26=CARTESIAN_POINT('ref-point',(2.0,1.0,0.));
36#30=GEOMETRIC_CURVE_SET('ellipse-wrong-unit',(#24,#25,#26));
37ENDSEC;
38END-ISO-10303-21;