From d128e3d531d525dc5364ec79dbf82812fa339bea Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 21:50:30 +0000 Subject: [PATCH] - Ifc: fix projection artifacts during opening generation. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1321 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index f6c7e9b02..ffee5cb6a 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1448,6 +1448,12 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, } BoundingBox bb = BoundingBox(vpmin,vpmax); + + // Skip over very small openings - these are likely projection errors + // (i.e. they don't belong to this side of the wall) + if(fabs(vpmax.x - vpmin.x) * fabs(vpmax.y - vpmin.y) < static_cast(1e-5)) { + continue; + } std::vector joined_openings(1, &opening); // See if this BB intersects any other, in which case we could not use the Quadrify() @@ -1477,7 +1483,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, break; } else { - IFCImporter::LogDebug("merging overlapping openings, this should not happen"); + IFCImporter::LogDebug("merging overlapping openings"); contour.clear(); BOOST_FOREACH(const ClipperLib::IntPoint& point, poly[0].outer) {