step-examples/12-4-tolerance/N029.stp
Sources
- 17-standards-bodies M020 (PrePoMax forum)
- 11-translator-vendors W030 (Spatial blog)
- 10-vendor-kbs V001, V006, V056
Sender
SolidWorks (inch units), Onshape (workspace inches)
Description
A STEP file written in inches is silently treated as millimetres because the `LENGTH_UNIT` declaration is parsed inconsistently. Many possibilities exist for declaring units (named units, conversion-based units, context-dependent units) and OpenCascade-based readers default to mm. Result: a 2 inch feature appears 50.8 mm in source vs 2 mm in target; a 25.4× error.
Reproducer recipe
SolidWorks STEP with `( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT($,.METRE.) )` plus a conversion-based wrapper for inches; receiver reads the wrapper as identity.
Expected kernel behavior
heal; resolve full unit-conversion chain to a single SI scale factor; reject if ambiguous; never default silently.
Notes
**See also**: U006. Synonyms: "inches silently treated as mm", "25.4x scale error on import", "inch model arrives 25.4 times too small", "LENGTH_UNIT inch parsed as default mm".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'CONVERSION_BASED_UNIT') or contains(b'.METRE.')matches(rb'0\.0254')contains(b'EDGE_CURVE')
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/* N029: inch units via CONVERSION_BASED_UNIT 0.0254 m; reader defaults to mm; 50.8mm feature arrives as 2mm â 25.4x scale error; GEOMETRIC_CURVE_SET â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('N029'),'2;1'); 5FILE_NAME('N029.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#1=CARTESIAN_POINT('p0',(0.0,0.0,0.0)); 10#2=CARTESIAN_POINT('p1_2_inches',(2.0,0.0,0.0)); 11#3=VERTEX_POINT('v0',#1); 12#4=VERTEX_POINT('v1',#2); 13#5=DIRECTION('',(1.0,0.0,0.0)); 14#6=VECTOR('',#5,2.0); 15#7=LINE('two_inch_line',#1,#6); 16#8=EDGE_CURVE('edge_2_inches',#3,#4,#7,.T.); 17#9=GEOMETRIC_CURVE_SET('edges',(#8)); 18#10=APPLICATION_CONTEXT('automotive_design'); 19#11=PRODUCT_CONTEXT('',#10,'mechanical'); 20#12=PRODUCT('N029','N029','',(#11)); 21#13=PRODUCT_DEFINITION_FORMATION('','',#12); 22#14=PRODUCT_DEFINITION_CONTEXT('part definition',#10,'design'); 23#15=PRODUCT_DEFINITION('','',#13,#14); 24#16=PRODUCT_DEFINITION_SHAPE('','',#15); 25#17=SI_UNIT(.MILLI.,.METRE.); 26#18=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.0254),#17); 27#19=(CONVERSION_BASED_UNIT('inch',#18)LENGTH_UNIT()NAMED_UNIT(*)); 28#20=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 29#21=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 30#22=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-6),#19,'distance_accuracy_value','inch_precision'); 31#23=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#22))GLOBAL_UNIT_ASSIGNED_CONTEXT((#19,#20,#21))REPRESENTATION_CONTEXT('ctx','3D')); 32#24=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#9),#23); 33#25=SHAPE_DEFINITION_REPRESENTATION(#16,#24); 34ENDSEC; 35END-ISO-10303-21;