step-examples/12-5-units/U033.stp
Sources
- OCCT MANTIS#0033564
- OCCT MANTIS#0032748 (OCCT MANTIS tracker 502 as of 2026-05-02)
Description
A reader is configured with a default unit (`xstep.cascade.unit`). The file emits an explicit `LENGTH_UNIT` record. Reader assumes the configured default but the file's record overrides without warning; conversely, when the configured unit and the file's unit disagree, the reader may apply the conversion factor twice.
Reproducer recipe
STEP file with explicit `LENGTH_UNIT` of inches; reader configured with default `xstep.cascade.unit = MM`. Behaviour varies across versions (some apply file unit, some apply default, some apply both as conversion).
Expected kernel behavior
Warn and accept: file-declared units take precedence; the configured default applies only when the file omits the unit record; emit a diagnostic when the two disagree.
Notes
**See also**: U025, U028. Synonyms: "xstep.cascade.unit overridden by file unit", "default unit ignored when file declares unit", "configured default conflicts with STEP unit", "reader applies conversion twice", "STEP unit default vs file divergence".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b"CONVERSION_BASED_UNIT('INCH'")contains(b'INCH') and contains(b'25.4')
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/* U033: Explicit INCH unit in file conflicts with reader default MM setting */ 3/* xstep.cascade.unit = MM but file declares CONVERSION_BASED_UNIT('INCH',25.4) */ 4/* DEFECT: reader may silently apply default MM, apply file INCH, or double-convert */ 5/* Kernel must: use file-declared unit; warn when file and config disagree */ 6HEADER; 7FILE_DESCRIPTION(('U033: INCH file unit vs MM reader default â silent override defect'),'2;1'); 8FILE_NAME('U033.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','',''); 9FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 10ENDSEC; 11DATA; 12/* Geometry: 2x2x1 inch part; values are in inches */ 13#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 14#2=CARTESIAN_POINT('corner-x',(2.0,0.,0.)); 15#3=CARTESIAN_POINT('corner-y',(0.,2.0,0.)); 16#4=CARTESIAN_POINT('corner-z',(0.,0.,1.0)); 17#5=CARTESIAN_POINT('corner-xyz',(2.0,2.0,1.0)); 18/* SI mm basis for conversion reference */ 19#8=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.)); 20/* INCH conversion: 25.4 mm per inch (correct factor) */ 21#9=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#8); 22/* File declares INCH as the active length unit */ 23#10=(CONVERSION_BASED_UNIT('INCH',#9) LENGTH_UNIT() NAMED_UNIT(*)); 24#11=(NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.)); 25#12=(NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT()); 26#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.000393701),#10, 27 'distance_accuracy_value','maximum model space distance between geometric entities'); 28/* DEFECT: reader configured with MM default; file declares INCH */ 29/* Some readers apply default (ignoring file), some double-convert, some warn */ 30#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 31 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) REPRESENTATION_CONTEXT('ctx','3D')); 32/* Model entity is GEOMETRIC_CURVE_SET â OCC returns empty shape */ 33#20=GEOMETRIC_CURVE_SET('inch-vs-mm-default',(#1,#2,#3,#4,#5)); 34ENDSEC; 35END-ISO-10303-21;