step-examples/12-5-units/U003.stp
Sources
- 10-vendor-kbs.md V003 (forum.onshape.com discussion 6658)
Sender
Onshape (workspace inches)
Description
A part modelled in Onshape with inch units exports to STEP whose `LENGTH_UNIT` is metric (millimetres); but coordinates are exact inch-to-mm conversions like 25.4 (1 in) and 63.5 (2.5 in). Geometry is preserved but the display-unit choice is lost: the file looks like an inch part rewritten as mm without scaling. Receivers display in mm with mm display tolerances.
Reproducer recipe
Onshape workspace=inch; export STEP; result file declares metric SI unit although authoring was in inches.
Expected kernel behavior
round-trip authored display unit through `CONVERSION_BASED_UNIT` for inch; do not coerce to base SI on export.
Notes
**See also**: U001. Synonyms: "Onshape inch workspace exports mm STEP", "STEP coordinates 25.4 instead of 1", "inch workspace lost in metric STEP", "display unit lost on Onshape export", "inch model with mm declaration".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'SI_UNIT(.MILLI.,.METRE.)') or contains(b'SI_UNIT(.MILLI., .METRE.)')matches(rb'25\.4|63\.5')
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/* U003: Onshape inch workspace exports mm STEP â display unit dropped */ 3/* Authored as 1 in x 2.5 in part; Onshape forces LENGTH_UNIT to mm on export */ 4/* Coordinates are inch-to-mm conversions: 1 in = 25.4, 2.5 in = 63.5 */ 5/* The file looks like a mm part but the authoring intent was in inches */ 6HEADER; 7FILE_DESCRIPTION(('U003: Onshape inch workspace export with mm LENGTH_UNIT context'),'2;1'); 8FILE_NAME('U003.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','',''); 9FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 10ENDSEC; 11DATA; 12/* Geometry: 1 in x 2.5 in part; coordinates are inch-to-mm conversions */ 13/* 1 inch = 25.4 mm, 2.5 inches = 63.5 mm */ 14#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 15#2=CARTESIAN_POINT('corner-x',(25.4,0.,0.)); 16#3=CARTESIAN_POINT('corner-y',(0.,63.5,0.)); 17#4=CARTESIAN_POINT('corner-z',(0.,0.,25.4)); 18#5=CARTESIAN_POINT('corner-xyz',(25.4,63.5,25.4)); 19#6=DIRECTION('xdir',(1.,0.,0.)); 20#7=DIRECTION('zdir',(0.,0.,1.)); 21/* DEFECT: SI_UNIT(.MILLI.,.METRE.) but coordinates are inch-valued (25.4, 63.5) */ 22/* Kernel should have preserved CONVERSION_BASED_UNIT for inch round-trip */ 23#10=(LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.)); 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.001),#10, 27 'distance_accuracy_value','maximum model space distance between geometric entities'); 28#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 29 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) REPRESENTATION_CONTEXT('ctx','3D')); 30/* Model entity is GEOMETRIC_CURVE_SET â OCC returns empty shape */ 31#20=GEOMETRIC_CURVE_SET('onshape-inch-in-mm-context',(#1,#2,#3,#4,#5)); 32ENDSEC; 33END-ISO-10303-21;