Selaa lähdekoodia

- Ifc: fix projection artifacts during opening generation.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1321 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 13 vuotta sitten
vanhempi
sitoutus
d128e3d531
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      code/IFCGeometry.cpp

+ 7 - 1
code/IFCGeometry.cpp

@@ -1448,6 +1448,12 @@ bool TryAddOpenings_Quadrulate(std::vector<TempOpening>& 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<IfcFloat>(1e-5)) {
+			continue;
+		}
 		std::vector<TempOpening*> 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<TempOpening>& 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) {