CAD Exchanger implicitly uses millimeters as the unit of length measurement and radians as the unit of plane angle measurement.
Each format has its own conventions on what units of measurement are used to store geometric data. CAD Exchanger takes these conventions into account and performs scaling of coordinates, lengths and angles when importing and exporting models. Import and export parameters classes also contain methods (Base_ReaderParameters::SetLengthUnit(), Base_WriterParameters::LengthUnit()) allowing to specify the length unit that will be used if the format has no conventions about units (e.g. STL, OBJ) or when the choice is arbitrary (as is often the case in export).
As a result of these scaling procedures, all length (or derived) parameters provided via SDK API are assumed to be in millimeters. Likewise, coordinates retrieved from B-Rep or polygonal representations are also in millimeters.
Support of units across formats and the unit handling strategies in import and export are summarized in the table below:
Format | Unit assignment | Import behavior | Export behavior |
---|---|---|---|
3D PDF | No unit information | Scale from meters (current limitation) | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
3D XML | File-wide | Scale lengths/coordinates according to file-wide units | N/A |
3DS | No unit information | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | N/A |
3MF | No unit information | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | N/A |
ACIS-SAT | File-wide | Scale lengths/coordinates according to file-wide units | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
BRep | Millimeteres and radians by convention | No scaling | No scaling |
CATIA | File-wide | Scale lengths/coordinates according to file-wide units | N/A |
Collada | Meters and degrees by convention | Scale lengths/coordinates and angles from convention unit | Scale lengths/coordinates and angles to convention unit |
Creo | File-wide | Scale lengths/coordinates according to file-wide units | N/A |
DXF | File-wide | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
DWG | File-wide | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | N/A |
FBX | Centimeters and degrees by convention | Scale lengths/coordinates and angles from convention unit | Scale lengths/coordinates and angles to convention unit |
GLTF | Meters and radians by convention | Scale lengths/coordinates and angles from convention unit | Scale lengths/coordinates and angles to convention unit |
IFC | File-wide | Scale lengths/coordinates and angles according to file-wide units | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit(), save angles in radians |
IGES | File-wide | Scale lengths/coordinates according to file-wide units | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
INV | File-wide | Scale lengths/coordinates according to file-wide units | N/A |
JT | Per-Logical Scene Graph element; same as Parasolid for XT segments | Scale lengths/coordinates of mesh and JT B-Rep data using units in LSG; same as Parasolid for XT segments | Scale lengths/coordinates of mesh according to JT_WriterParameters::PolyRepresentationUnit(); same as Parasolid for XT segments |
NX | File-wide | Scale lenghts/coordinates according to file-wide units | N/A |
OBJ | No unit information | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
Parasolid-XT | Meters and radians by convention | Scale lengths/coordinates from convention unit | Scale lengths/coordinates to convention unit |
PLY | No unit information | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | N/A |
PRC | File-wide | Scale lengths/coordinates and angles according to file-wide units | N/A |
Rhino | File-wide | Scale lengths/coordinates according to file-wide units | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
Solid Edge | File-wide | Scale lengths/coordinates according to file-wide units | N/A |
SolidWorks | File-wide | Scale lengths/coordinates according to file-wide units | N/A |
STEP | Per-product | Scale lengths/coordinates and angles according to per-product units | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit(), save angles in radians |
STL | No unit information | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
U3D | No unit information | Scale from meters (current limitation) | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
USD | File-wide | N/A | No scaling (current limitation) |
VRML | Meters and radians by convention | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |
X3D | Meters and radians by convention | Scale lengths/coordinates according to Base_ReaderParameters::SetLengthUnit() | Scale lengths/coordinates according to Base_WriterParameters::LengthUnit() |