step-examples/12-5-units/U016.stp
Sources
- 08-occt-gitlog.md G054 (OCCT 5290fb1
- Mantis 0030362)
Description
Writing dimensions in inches produces STEP files with invalid cross-references between dimension entities. Common signature: two separate `CONVERSION_BASED_UNIT('INCH', ..)` instances (different `#NNN` ids) both defined with the same conversion factor 25.4, with different `LENGTH_MEASURE_WITH_UNIT` records pointing at one or the other; duplicate unit definitions reused inconsistently across multiple measures.
Reproducer recipe
XCAF document with dimensions in inch units; export to STEP.
Expected kernel behavior
Heal and accept: normalize / maintain a single, consistent inch-unit measure entity referenced uniformly across all dimension entities.
Notes
**See also**: A025. Synonyms: "duplicate INCH CONVERSION_BASED_UNIT instances", "two #N for same INCH unit", "duplicate inch unit definitions in STEP", "dimension export uses inconsistent inch units", "redundant INCH conversion entities".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
count(b"CONVERSION_BASED_UNIT('INCH'") >= 2count(b"'INCH'") >= 2
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/* U016: Duplicate CONVERSION_BASED_UNIT('INCH') instances in dimension export */ 3/* OCCT XCAF inch dimension export creates two separate INCH unit entities */ 4/* Both carry conversion factor 25.4 but have different #NNN ids */ 5/* Dimension measures use one or the other inconsistently -- invalid cross-refs */ 6HEADER; 7FILE_DESCRIPTION(('U016: Duplicate INCH CONVERSION_BASED_UNIT in dimension export'),'2;1'); 8FILE_NAME('U016.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','',''); 9FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 10ENDSEC; 11DATA; 12/* Geometry: a simple 2-inch square part (coordinates in mm: 50.8 mm = 2 inches) */ 13#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 14#2=CARTESIAN_POINT('corner-x',(50.8,0.,0.)); 15#3=CARTESIAN_POINT('corner-y',(0.,50.8,0.)); 16#4=CARTESIAN_POINT('corner-z',(0.,0.,25.4)); 17#5=CARTESIAN_POINT('corner-xyz',(50.8,50.8,25.4)); 18#6=DIRECTION('xdir',(1.,0.,0.)); 19#7=DIRECTION('zdir',(0.,0.,1.)); 20/* SI mm basis for inch conversion */ 21#8=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.)); 22/* DEFECT: two separate LENGTH_MEASURE_WITH_UNIT records for the same 25.4 factor */ 23#9=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#8); 24#30=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#8); 25/* DEFECT: two separate CONVERSION_BASED_UNIT('INCH') instances with different ids */ 26#10=(CONVERSION_BASED_UNIT('INCH',#9) LENGTH_UNIT() NAMED_UNIT(*)); 27#31=(CONVERSION_BASED_UNIT('INCH',#30) LENGTH_UNIT() NAMED_UNIT(*)); 28#11=(NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.)); 29#12=(NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT()); 30#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.0254),#8, 31 'distance_accuracy_value','maximum model space distance between geometric entities'); 32#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 33 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) REPRESENTATION_CONTEXT('ctx','3D')); 34/* Dimension measures: each references a different INCH unit instance */ 35/* This is the signature of the OCCT dimension export bug */ 36#40=MEASURE_REPRESENTATION_ITEM('width',LENGTH_MEASURE(2.0),#10); 37#41=MEASURE_REPRESENTATION_ITEM('height',LENGTH_MEASURE(1.0),#31); 38/* Model entity is GEOMETRIC_CURVE_SET â OCC returns empty shape */ 39#20=GEOMETRIC_CURVE_SET('xcaf-dup-inch-unit',(#1,#2,#3,#4,#5)); 40ENDSEC; 41END-ISO-10303-21;