Theory
A STEP, IGES or STL file stores plain coordinates. A STEP file usually also declares a unit in its header, but the CAD reader (the OpenCASCADE kernel inside Gmsh) does not apply it: the coordinates are read as written, so two STEP files that both declare millimetres can be read with bounding boxes 1000 times apart. An STL file carries no unit at all. A wrong unit scales every length by a factor of 10 to 1000, and with it the velocity resulting from a flow rate, the Reynolds number and the acoustic frequencies. The unit must therefore always be confirmed by the user.
As guidance, the step shows:
- the raw bounding-box diagonal;
- the unit declared in the file header (a hint only);
- a suggestion based on the model size: a muffler is typically 0.05-3 m across, so a raw diagonal between 0.05 and 3 suggests metres and one between 50 and 3000 suggests millimetres; any other value is "uncertain".
After confirmation, every coordinate is multiplied by the factor of equation (1); areas, volumes and hydraulic diameters shown later are in SI units.
Equations
| where | meaning | unit |
|---|---|---|
| A coordinate as written in the file | file unit | |
| The same coordinate in the model | m | |
| Scale factor of the confirmed unit | m per file unit |
Default and rule
- Default
- none: the unit must be confirmed; the suggestion comes from the model's size
- Rule
No unit is applied without confirmation. The list is preselected with the suggestion from the bounding-box size (or, when a model is replaced, with the unit of the previous model), and the unit must be confirmed before the surfaces are listed.
- Source
The size rule is the program's own heuristic. That the STEP header unit is not applied by the reader was established on test files.
Valid range mm, cm, m, in
Choices
Millimetres, centimetres, metres, inches.
Check the size
After confirming, compare a known dimension (a pipe diameter in the surface table, the hydraulic diameter column) with the drawing. An error by a factor of 10 or 1000 is not detected by any later check.