2
0
Эх сурвалжийг харах

- Ifc: improve intersection check for openings.

Alexander Gessler 12 жил өмнө
parent
commit
b42f279110
1 өөрчлөгдсөн 7 нэмэгдсэн , 8 устгасан
  1. 7 8
      code/IFCGeometry.cpp

+ 7 - 8
code/IFCGeometry.cpp

@@ -1970,15 +1970,14 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
 			for (unsigned int vi = 0, vend = profile_vertcnts[f]; vi < vend; ++vi, ++vi_total) {
 				const IfcVector3& x = profile_verts[vi_total];
 
-				if(check_intersection) {
-					const IfcFloat vert_d = -(x * nor);
-					dmin = std::min(dmin, vert_d);
-					dmax = std::max(dmax, vert_d);
-				}
-
 				const IfcVector3& v = m * x;
 				IfcVector2 vv(v.x, v.y);
 
+				if(check_intersection) {
+					dmin = std::min(dmin, v.z);
+					dmax = std::max(dmax, v.z);
+				}
+
 				// sanity rounding
 				vv = std::max(vv,IfcVector2());
 				vv = std::min(vv,one_vec);
@@ -2245,7 +2244,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul
 		out.push_back(in[next]);
 
 		if(openings) {
-			if(GenerateOpenings(*conv.apply_openings,nors,temp, i >= size/2)) {
+			if(GenerateOpenings(*conv.apply_openings,nors,temp,true, true)) {
 				++sides_with_openings;
 			}
 			
@@ -2264,7 +2263,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul
 
 			curmesh.vertcnt.push_back(size);
 			if(openings && size > 2) {
-				if(GenerateOpenings(*conv.apply_openings,nors,temp, true)) {
+				if(GenerateOpenings(*conv.apply_openings,nors,temp,true, true)) {
 					++sides_with_v_openings;
 				}