From 28081f7df8d9d424dc75a3015e71a63f9d2d7391 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 8 May 2021 13:04:22 +0200 Subject: [PATCH] Fixes for spatial tree on iterator and positive extend param --- src/ifcgeom/IfcGeomTree.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ifcgeom/IfcGeomTree.h b/src/ifcgeom/IfcGeomTree.h index 049066261b..40f02e8ce7 100644 --- a/src/ifcgeom/IfcGeomTree.h +++ b/src/ifcgeom/IfcGeomTree.h @@ -166,8 +166,11 @@ namespace IfcGeom { std::vector ts; - if (IfcGeom::Kernel::count(s, TopAbs_SHELL) == 0) { - return ts; + if (extend < 0.) { + // Shell are only required when we do the boolean based intersection check + if (IfcGeom::Kernel::count(s, TopAbs_SHELL) == 0) { + return ts; + } } ts = select_box(bb, completely_within); @@ -288,7 +291,9 @@ namespace IfcGeom { if (it.initialize()) { do { IfcGeom::BRepElement* elem = (IfcGeom::BRepElement*)it.get(); - add((IfcUtil::IfcBaseEntity*)it.file()->instance_by_id(elem->id()), elem->geometry().as_compound()); + auto compound = elem->geometry().as_compound(); + compound.Move(elem->transformation().data()); + add((IfcUtil::IfcBaseEntity*)it.file()->instance_by_id(elem->id()), compound); } while (it.next()); } }