From bef1172b44db3844faebc83a5b36f39017da00e5 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 30 Sep 2019 18:50:43 +0200 Subject: [PATCH] only iterate over outer chart if inner chart searchtree --- libsrc/stlgeom/stltool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsrc/stlgeom/stltool.cpp b/libsrc/stlgeom/stltool.cpp index b7134357..f1b931ba 100644 --- a/libsrc/stlgeom/stltool.cpp +++ b/libsrc/stlgeom/stltool.cpp @@ -829,9 +829,11 @@ STLTrigId STLChart :: ProjectNormal (Point<3> & p3d) const double lamtol = 1e-6; QuadraticFunction3d quadfun(p3d, GetNormal()); + int starttrig = 1; if (inner_searchtree) { NgArray trigs; + starttrig = GetNChartT()+1; Point<2> p2d = Project2d (p3d); inner_searchtree->GetIntersecting(p2d, p2d, trigs); @@ -858,7 +860,7 @@ STLTrigId STLChart :: ProjectNormal (Point<3> & p3d) const } - for (int j = 1; j <= nt; j++) + for (int j = starttrig; j <= nt; j++) { STLTrigId i = GetTrig1(j); auto & trig = geometry->GetTriangle(i);