From 82ec42b292b6e3656f170bf63db660832711fab7 Mon Sep 17 00:00:00 2001 From: "mhochsteger@cerbsim.com" Date: Wed, 2 Feb 2022 15:09:41 +0100 Subject: [PATCH] Ignore identified edges/vertices for closeedge localh restrictions --- libsrc/occ/occgenmesh.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index f96088fb..14da5c9a 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -650,6 +650,7 @@ namespace netgen BoxTree<3> searchtree(bb.PMin(), bb.PMax()); int nlines = 0; + Array edgenumber; for (int i = 1; i <= nedges && !multithread.terminate; i++) { TopoDS_Edge edge = TopoDS::Edge (geom.emap(i)); @@ -684,6 +685,7 @@ namespace netgen searchtree.Insert (box.PMin(), box.PMax(), nlines+1); nlines++; + edgenumber.Append(i); s_start = s; d0 = d1; @@ -692,6 +694,22 @@ namespace netgen } NgArray linenums; + auto is_identified_edge = [&](int e0, int e1) { + const auto& edge0 = geom.GetEdge(e0-1); + const auto& edge1 = geom.GetEdge(e1-1); + + if(edge0.primary == edge1.primary) + return true; + + Array v0 = { &edge0.GetStartVertex(), &edge0.GetEndVertex() }; + Array v1 = { &edge1.GetStartVertex(), &edge1.GetEndVertex() }; + for(auto i : Range(2)) + for(auto j : Range(2)) + if(v0[i]->primary == v1[j]->primary) + return true; + + return false; + }; for (int i = 0; i < nlines; i++) { @@ -713,6 +731,7 @@ namespace netgen { int num = linenums[j]-1; if (i == num) continue; + if( is_identified_edge(edgenumber[i], edgenumber[num]) ) continue; if ((line.p0-lines[num].p0).Length2() < 1e-15) continue; if ((line.p0-lines[num].p1).Length2() < 1e-15) continue; if ((line.p1-lines[num].p0).Length2() < 1e-15) continue;