From c7ddc0643e129f553c1a533d24538227779c9d40 Mon Sep 17 00:00:00 2001 From: aothms Date: Wed, 7 Oct 2015 16:14:34 +0200 Subject: [PATCH] Fixes to flatten_shape_list() --- src/ifcgeom/IfcGeomFunctions.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 4fbd154d39..51e6584e12 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -776,8 +776,14 @@ bool IfcGeom::Kernel::flatten_shape_list(const IfcGeom::IfcRepresentationShapeIt _trsf = trsf.Trsf(); trsf_valid = true; } catch (...) {} - const TopoDS_Shape moved_shape = trsf_valid ? merged.Moved(_trsf) : - BRepBuilderAPI_GTransform(merged,trsf,true).Shape(); + + const TopoDS_Shape moved_shape = trsf.Form() == gp_Identity + ? merged + : ( + trsf_valid + ? merged.Moved(_trsf) + : BRepBuilderAPI_GTransform(merged,trsf,true).Shape() + ); if (shapes.size() == 1) { result = moved_shape; @@ -809,6 +815,10 @@ bool IfcGeom::Kernel::flatten_shape_list(const IfcGeom::IfcRepresentationShapeIt } } + if (!fuse) { + result = compound; + } + const bool success = !result.IsNull(); if (success) { const double precision = getValue(GV_PRECISION);