diff --git a/libsrc/gprim/geomtest3d.hpp b/libsrc/gprim/geomtest3d.hpp index b26c9b41..954d32e7 100644 --- a/libsrc/gprim/geomtest3d.hpp +++ b/libsrc/gprim/geomtest3d.hpp @@ -69,10 +69,10 @@ extern double ComputeCylinderRadius (const Vec3d & n1, const Vec3d & n2, double h1, double h2); /// Minimal distance of point p to the line segment [lp1,lp2] -extern double MinDistLP2 (const Point2d & lp1, const Point2d & lp2, const Point2d & p); +DLL_HEADER double MinDistLP2 (const Point2d & lp1, const Point2d & lp2, const Point2d & p); /// Minimal distance of point p to the line segment [lp1,lp2] -extern double MinDistLP2 (const Point3d & lp1, const Point3d & lp2, const Point3d & p); +DLL_HEADER double MinDistLP2 (const Point3d & lp1, const Point3d & lp2, const Point3d & p); /// Minimal distance of point p to the triangle segment [tp1,tp2,pt3] DLL_HEADER double MinDistTP2 (const Point3d & tp1, const Point3d & tp2, diff --git a/libsrc/meshing/delaunay2d.cpp b/libsrc/meshing/delaunay2d.cpp index e88434bf..db6bcc71 100644 --- a/libsrc/meshing/delaunay2d.cpp +++ b/libsrc/meshing/delaunay2d.cpp @@ -668,6 +668,11 @@ namespace netgen for (auto pi : points_range) dmesh.AddPoint(pi); + auto first_new_point = points_range.Next(); + tempmesh.AddPoint(P3(temp_points[first_new_point])); + tempmesh.AddPoint(P3(temp_points[first_new_point+1])); + tempmesh.AddPoint(P3(temp_points[first_new_point+2])); + timer_addpoints.Stop(); static Timer taddseg("addseg"); diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index b215bfd7..c46df8a0 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -339,6 +339,9 @@ namespace netgen if (swapped[t1]) return; + if(mesh[t1].GetNP() != 3) + return; + if (multithread.terminate) throw NgException ("Meshing stopped"); diff --git a/libsrc/meshing/smoothing2.cpp b/libsrc/meshing/smoothing2.cpp index 11f21cb8..0e6db78a 100644 --- a/libsrc/meshing/smoothing2.cpp +++ b/libsrc/meshing/smoothing2.cpp @@ -756,10 +756,17 @@ namespace netgen { for (auto & se : mesh.SurfaceElements()) if (se.GetNP() != 3) - { - mixed = true; - break; - } + { + for(auto pi : se.PNums()) + if(mesh[pi].Type() == SURFACEPOINT) + { + mixed = true; + break; + } + if(mixed) + break; + } + const auto & getDofs = [&] (int i) { return elementsonpoint[i+PointIndex::BASE];