From 586ad14013c940394b9d181418e257f1741253f4 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 27 Dec 2013 09:36:14 +0000 Subject: [PATCH] #28 USE_BREP_DATA setting does not respect CONVERT_BACK_UNITS setting --- src/ifcgeom/IfcGeomObjects.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomObjects.cpp b/src/ifcgeom/IfcGeomObjects.cpp index 85a951cbef..232bd29f0c 100644 --- a/src/ifcgeom/IfcGeomObjects.cpp +++ b/src/ifcgeom/IfcGeomObjects.cpp @@ -87,7 +87,12 @@ IfcGeomObjects::IfcRepresentationBrepData::IfcRepresentationBrepData(const IfcRe builder.MakeCompound(compound); for ( IfcGeom::IfcRepresentationShapeItems::const_iterator it = shapes.begin(); it != shapes.end(); ++ it ) { const TopoDS_Shape& s = it->Shape(); - const gp_GTrsf& trsf = it->Placement(); + gp_GTrsf trsf = it->Placement(); + if (convert_back_units) { + gp_Trsf scale; + scale.SetScaleFactor(1.0 / IfcGeom::GetValue(IfcGeom::GV_LENGTH_UNIT)); + trsf.PreMultiply(scale); + } bool trsf_valid = false; gp_Trsf _trsf; try {