diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 0f39c05fe..01ee50686 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -2686,10 +2686,6 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vectorIsEmpty()) { - return false; - } - // Do we just collect openings for a parent element (i.e. a wall)? // In such a case, we generate the polygonal mesh as usual, // but attach it to a TempOpening instance which will later be applied @@ -2698,13 +2694,19 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vectorpush_back(TempOpening(geo.ToPtr(), - IfcVector3(0,0,0), - meshtmp, - boost::shared_ptr(NULL))); + if (!meshtmp->IsEmpty()) { + conv.collect_openings->push_back(TempOpening(geo.ToPtr(), + IfcVector3(0,0,0), + meshtmp, + boost::shared_ptr(NULL))); + } return true; } + if (meshtmp->IsEmpty()) { + return false; + } + meshtmp->RemoveAdjacentDuplicates(); meshtmp->RemoveDegenerates();