- Ifc: avoid duplicate points in opening contour lines, this sometimes screws up the clipping algorithm.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1325 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/6/merge
aramis_acg 2012-11-01 21:36:39 +00:00
parent 11b2219b1a
commit 612f67da0a
1 changed files with 11 additions and 1 deletions

View File

@ -1461,9 +1461,19 @@ bool TryAddOpenings_Quadrulate(std::vector<TempOpening>& openings,
vpmin = std::min(vpmin,vv); vpmin = std::min(vpmin,vv);
vpmax = std::max(vpmax,vv); vpmax = std::max(vpmax,vv);
// usually there won't be too many elements so the linear time check is ok
bool found = false;
for (std::vector<IfcVector2>::const_iterator it = contour.begin(); it != contour.end(); ++it) {
if (((*it)-vv).SquareLength() < 1e-5f) {
found = true;
break;
}
}
if(!found) {
contour.push_back(vv); contour.push_back(vv);
} }
} }
}
if(contour.size() <= 2) { if(contour.size() <= 2) {
continue; continue;