File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,9 +240,19 @@ IfcGeomObjects::IfcObject::IfcObject(
240240 , _guid(guid)
241241{
242242 // Convert the gp_Trsf into a 4x3 Matrix
243- for ( int i = 1 ; i < 5 ; ++ i )
244- for ( int j = 1 ; j < 4 ; ++ j )
245- _matrix.push_back ((float )trsf.Value (j,i));
243+ // Note that in case the CONVERT_BACK_UNITS setting is enabled
244+ // the translation component of the matrix needs to be divided
245+ // by the magnitude of the IFC model length unit because
246+ // internally in IfcOpenShell everything is measured in meters.
247+ for (int i = 1 ; i < 5 ; ++i) {
248+ for (int j = 1 ; j < 4 ; ++j) {
249+ const double trsf_value = trsf.Value (j,i);
250+ const double matrix_value = i == 4 && convert_back_units
251+ ? trsf_value / IfcGeom::GetValue (IfcGeom::GV_LENGTH_UNIT)
252+ : trsf_value;
253+ _matrix.push_back (static_cast <float >(matrix_value));
254+ }
255+ }
246256}
247257
248258IfcGeomObjects::IfcGeomShapeModelObject::IfcGeomShapeModelObject (
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments