From af0d4ef3daae12d25549f9ce494859c7a6cec60c Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Fri, 25 Jan 2013 04:35:30 +0100 Subject: [PATCH] - Ifc: clean up temporary wall points when switching from horizontal to vertical openings. --- code/IFCGeometry.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 409ce1441..0c044553f 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1724,6 +1724,7 @@ void CloseWindows(ContourVector& contours, BOOST_FOREACH(const TempOpening* opening, refs) { BOOST_FOREACH(const IfcVector3& other, opening->wallPoints) { const IfcFloat sqdist = (world_point - other).SquareLength(); + if (sqdist < best) { bestv = other; best = sqdist; @@ -2262,7 +2263,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul out.push_back(in[next]); if(openings) { - if(GenerateOpenings(*conv.apply_openings,nors,temp,true, true)) { + if(GenerateOpenings(*conv.apply_openings,nors,temp,false, true)) { ++sides_with_openings; } @@ -2270,6 +2271,12 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul temp.Clear(); } } + + if(openings) { + BOOST_FOREACH(TempOpening& opening, *conv.apply_openings) { + opening.wallPoints.clear(); + } + } size_t sides_with_v_openings = 0; if(has_area) {