From 236f14553c33eb319e01aa4ddb1bfc1d59cf2ef5 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 3 Jun 2024 17:19:41 +0200 Subject: [PATCH] fix project on edge in MapSurfacemesh if no trafo is given --- libsrc/meshing/basegeom.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index 119986ec..379185ff 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -1072,7 +1072,19 @@ namespace netgen if(trafo) p = (*trafo)(p); else - dst.Project(p); + for(auto& edge: dst.edges) + if (edge->primary->nr == seg.edgenr-1) + { + if (mesh[pi].Type() == FIXEDPOINT) { + if((edge->GetStartVertex().GetPoint() - p).Length2() >\ + (edge->GetEndVertex().GetPoint() - p).Length2()) + p = edge->GetEndVertex().GetPoint(); + else + p = edge->GetStartVertex().GetPoint(); + } + else + edge->ProjectPoint(p, nullptr); + } tree.Insert(p, pi); is_point_in_tree[pi] = true; }