step-examples/12-4-tolerance/N027.stp
Sources
- 22-niche-forums Y012 (gmsh #3288, #2571)
Description
gmsh user sets `Geometry.OCCTargetUnit = "M"`, but a STEP `CYLINDRICAL_SURFACE` of r=1 h=10 in MILLI-METRE units gets imported as r=1000 h=10000 (the ×1000 scaling is applied unexpectedly). Common signature: a small 1 mm-radius cylinder with vertex coordinates like (0, 0.001, 0) and declared `UNCERTAINTY_MEASURE_WITH_UNIT` 1e-6 mm; relative precision is at the working-tolerance boundary, so any unit conversion glitch is immediately visible. The setting is honored when the file enters via `importShapes` but skipped when via `importShapesNativePointer`. Different geometries from the same producer require different `OCCTargetUnit` values to mesh.
Reproducer recipe
STEP with `LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)`; load via OCC C++ then hand to gmsh via pointer interface.
Expected kernel behavior
heal; always apply target-unit conversion at the OCC→consumer boundary, regardless of the entry path.
Notes
Synonyms: "gmsh OCCTargetUnit silently ignored", "small mm cylinder imported with x1000 scale", "different geometries need different OCCTargetUnit settings", "importShapesNativePointer skips unit conversion".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'CYLINDRICAL_SURFACE')contains(b'.MILLI.')contains(b'1.0E-6')
Tier-3 assertions
shape_null == True
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* N027: small CYLINDRICAL_SURFACE r=1 h=10 mm; unit .MILLI.; OCCTargetUnit=M path skips conversion giving r=1000 instead of 0.001; tol 1.0E-6; GEOMETRIC_CURVE_SET â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('N027'),'2;1'); 5FILE_NAME('N027.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('cyl_orig',(0.0,0.0,0.0)); 10#2=DIRECTION('',(0.0,0.0,1.0)); 11#3=DIRECTION('',(1.0,0.0,0.0)); 12#4=AXIS2_PLACEMENT_3D('',#1,#2,#3); 13#5=CYLINDRICAL_SURFACE('small_cyl',#4,1.0); 14#6=CARTESIAN_POINT('p0_seam_bot',(1.0,0.0,0.0)); 15#7=CARTESIAN_POINT('p1_seam_top',(1.0,0.0,10.0)); 16#8=VERTEX_POINT('v0',#6); 17#9=VERTEX_POINT('v1',#7); 18#10=DIRECTION('',(0.0,0.0,1.0)); 19#11=VECTOR('',#10,10.0); 20#12=LINE('seam_line',#6,#11); 21#13=EDGE_CURVE('seam_edge',#8,#9,#12,.T.); 22#14=GEOMETRIC_CURVE_SET('cyl_set',(#5,#13)); 23#15=APPLICATION_CONTEXT('automotive_design'); 24#16=PRODUCT_CONTEXT('',#15,'mechanical'); 25#17=PRODUCT('N027','N027','',(#16)); 26#18=PRODUCT_DEFINITION_FORMATION('','',#17); 27#19=PRODUCT_DEFINITION_CONTEXT('part definition',#15,'design'); 28#20=PRODUCT_DEFINITION('','',#18,#19); 29#21=PRODUCT_DEFINITION_SHAPE('','',#20); 30#22=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 31#23=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 32#24=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 33#25=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-6),#22,'distance_accuracy_value','precision_at_working_tol_boundary'); 34#26=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#25))GLOBAL_UNIT_ASSIGNED_CONTEXT((#22,#23,#24))REPRESENTATION_CONTEXT('ctx','3D')); 35#27=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#14),#26); 36#28=SHAPE_DEFINITION_REPRESENTATION(#21,#27); 37ENDSEC; 38END-ISO-10303-21;