diff --git a/libsrc/meshing/meshing2.cpp b/libsrc/meshing/meshing2.cpp index 0e2942ca..1feee9e7 100644 --- a/libsrc/meshing/meshing2.cpp +++ b/libsrc/meshing/meshing2.cpp @@ -193,8 +193,8 @@ namespace netgen } void Meshing2 :: - GetChartBoundary (NgArray & points, - NgArray & points3d, + GetChartBoundary (NgArray> & points, + NgArray> & points3d, NgArray & lines, double h) const { points.SetSize (0); @@ -279,8 +279,8 @@ namespace netgen StartMesh(); - NgArray chartboundpoints; - NgArray chartboundpoints3d; + NgArray> chartboundpoints; + NgArray> chartboundpoints3d; NgArray chartboundlines; // illegal points: points with more then 50 elements per node @@ -519,7 +519,7 @@ namespace netgen } - Point2d p12d, p22d; + // Point2d p12d, p22d; if (found) { @@ -571,8 +571,8 @@ namespace netgen *testout << "2d points: " << endl << plainpoints << endl; - p12d = plainpoints.Get(1); - p22d = plainpoints.Get(2); + // p12d = plainpoints.Get(1); + // p22d = plainpoints.Get(2); /* // last idea on friday diff --git a/libsrc/meshing/meshing2.hpp b/libsrc/meshing/meshing2.hpp index 08e275b6..568e3a60 100644 --- a/libsrc/meshing/meshing2.hpp +++ b/libsrc/meshing/meshing2.hpp @@ -126,8 +126,8 @@ protected: /* get (projected) boundary of current chart */ - virtual void GetChartBoundary (NgArray & points, - NgArray & points3d, + virtual void GetChartBoundary (NgArray> & points, + NgArray> & points3d, NgArray & lines, double p) const; virtual double Area () const; diff --git a/libsrc/meshing/netrule2.cpp b/libsrc/meshing/netrule2.cpp index b9b7ba06..a5c35761 100644 --- a/libsrc/meshing/netrule2.cpp +++ b/libsrc/meshing/netrule2.cpp @@ -79,10 +79,10 @@ void netrule :: SetFreeZoneTransformation (const Vector & devp, int tolclass) for (int i = 0; i < fzs; i++) { - Point2d p1 = transfreezone[i]; - Point2d p2 = transfreezone[(i+1) % fzs]; + const auto& p1 = transfreezone[i]; + const auto& p2 = transfreezone[(i+1) % fzs]; - Vec2d vn (p2.Y() - p1.Y(), p1.X() - p2.X()); + Vec<2> vn = { p2[1] - p1[1], p1[0] - p2[0] }; double len2 = vn.Length2(); @@ -96,9 +96,9 @@ void netrule :: SetFreeZoneTransformation (const Vector & devp, int tolclass) { vn /= sqrt (len2); // scaling necessary ? - freesetinequ(i,0) = vn.X(); - freesetinequ(i,1) = vn.Y(); - freesetinequ(i,2) = -(p1.X() * vn.X() + p1.Y() * vn.Y()); + freesetinequ(i,0) = vn[0]; + freesetinequ(i,1) = vn[1]; + freesetinequ(i,2) = -(p1[0] * vn[0] + p1[1] * vn[1]); } } } @@ -110,37 +110,37 @@ int netrule :: IsInFreeZone2 (const Point2d & p) const for (int i = 0; i < transfreezone.Size(); i++) { if (freesetinequ(i, 0) * p.X() + - freesetinequ(i, 1) * p.Y() + + freesetinequ(i, 1) * p[1] + freesetinequ(i, 2) > 0) return 0; } return 1; } */ -int netrule :: IsLineInFreeZone2 (const Point2d & p1, const Point2d & p2) const +int netrule :: IsLineInFreeZone2 (const Point<2> & p1, const Point<2> & p2) const { - if ( (p1.X() > fzmaxx && p2.X() > fzmaxx) || - (p1.X() < fzminx && p2.X() < fzminx) || - (p1.Y() > fzmaxy && p2.Y() > fzmaxy) || - (p1.Y() < fzminy && p2.Y() < fzminy) ) return 0; + if ( (p1[0] > fzmaxx && p2[0] > fzmaxx) || + (p1[0] < fzminx && p2[0] < fzminx) || + (p1[1] > fzmaxy && p2[1] > fzmaxy) || + (p1[1] < fzminy && p2[1] < fzminy) ) return 0; for (int i = 1; i <= transfreezone.Size(); i++) { - if (freesetinequ.Get(i, 1) * p1.X() + freesetinequ.Get(i, 2) * p1.Y() + + if (freesetinequ.Get(i, 1) * p1[0] + freesetinequ.Get(i, 2) * p1[1] + freesetinequ.Get(i, 3) > -1e-8 && // -1e-6 - freesetinequ.Get(i, 1) * p2.X() + freesetinequ.Get(i, 2) * p2.Y() + + freesetinequ.Get(i, 1) * p2[0] + freesetinequ.Get(i, 2) * p2[1] + freesetinequ.Get(i, 3) > -1e-8 // -1e-6 ) return 0; } - double nx = (p2.Y() - p1.Y()); - double ny = -(p2.X() - p1.X()); + double nx = (p2[1] - p1[1]); + double ny = -(p2[0] - p1[0]); double nl = sqrt (nx * nx + ny * ny); if (nl > 1e-8) { nx /= nl; ny /= nl; - double c = - (p1.X() * nx + p1.Y() * ny); + double c = - (p1[0] * nx + p1[1] * ny); bool allleft = true; bool allright = true; diff --git a/libsrc/meshing/ruler2.hpp b/libsrc/meshing/ruler2.hpp index 2bef2ae6..d300c82d 100644 --- a/libsrc/meshing/ruler2.hpp +++ b/libsrc/meshing/ruler2.hpp @@ -98,13 +98,13 @@ public: /// const NgArray & GetDelLines() const { return dellines; } /// - void GetFreeZone (NgArray & afreearea); + void GetFreeZone (NgArray> & afreearea); /// - double CalcPointDist (int pi, const Point2d & p) const + double CalcPointDist (int pi, const Point<2> & p) const { - double dx = p.X() - points.Get(pi)[0]; - double dy = p.Y() - points.Get(pi)[1]; + double dx = p[0] - points.Get(pi)[0]; + double dy = p[1] - points.Get(pi)[1]; const threefloat * tfp = &tolerances.Get(pi); return tfp->f1 * dx * dx + tfp->f2 * dx * dy + tfp->f3 * dy * dy; } @@ -116,31 +116,31 @@ public: void SetFreeZoneTransformation (const Vector & u, int tolclass); /// - bool IsInFreeZone (const Point2d & p) const + bool IsInFreeZone (const Point<2> & p) const { - if (p.X() < fzminx || p.X() > fzmaxx || - p.Y() < fzminy || p.Y() > fzmaxy) return 0; + if (p[0] < fzminx || p[0] > fzmaxx || + p[1] < fzminy || p[1] > fzmaxy) return 0; for (int i = 0; i < transfreezone.Size(); i++) { - if (freesetinequ(i, 0) * p.X() + - freesetinequ(i, 1) * p.Y() + + if (freesetinequ(i, 0) * p[0] + + freesetinequ(i, 1) * p[1] + freesetinequ(i, 2) > 0) return 0; } return 1; } /// - int IsLineInFreeZone (const Point2d & p1, const Point2d & p2) const + int IsLineInFreeZone (const Point<2> & p1, const Point<2> & p2) const { - if ( (p1.X() > fzmaxx && p2.X() > fzmaxx) || - (p1.X() < fzminx && p2.X() < fzminx) || - (p1.Y() > fzmaxy && p2.Y() > fzmaxy) || - (p1.Y() < fzminy && p2.Y() < fzminy) ) return 0; + if ( (p1[0] > fzmaxx && p2[0] > fzmaxx) || + (p1[0] < fzminx && p2[0] < fzminx) || + (p1[1] > fzmaxy && p2[1] > fzmaxy) || + (p1[1] < fzminy && p2[1] < fzminy) ) return 0; return IsLineInFreeZone2 (p1, p2); } /// - int IsLineInFreeZone2 (const Point2d & p1, const Point2d & p2) const; + int IsLineInFreeZone2 (const Point<2> & p1, const Point<2> & p2) const; /// int ConvexFreeZone () const; /// diff --git a/libsrc/stlgeom/meshstlsurface.cpp b/libsrc/stlgeom/meshstlsurface.cpp index eaf5a8af..3c4c2585 100644 --- a/libsrc/stlgeom/meshstlsurface.cpp +++ b/libsrc/stlgeom/meshstlsurface.cpp @@ -1003,8 +1003,8 @@ IsLineVertexOnChart (const Point3d & p1, const Point3d & p2, } void MeshingSTLSurface :: -GetChartBoundary (NgArray & points, - NgArray & points3d, +GetChartBoundary (NgArray> & points, + NgArray> & points3d, NgArray & lines, double h) const { points.SetSize (0); diff --git a/libsrc/stlgeom/meshstlsurface.hpp b/libsrc/stlgeom/meshstlsurface.hpp index 89420bde..ff54380f 100644 --- a/libsrc/stlgeom/meshstlsurface.hpp +++ b/libsrc/stlgeom/meshstlsurface.hpp @@ -52,8 +52,8 @@ protected: int IsLineVertexOnChart (const Point3d & p1, const Point3d & p2, int endpoint, const PointGeomInfo & gi) override; - void GetChartBoundary (NgArray & points, - NgArray & poitns3d, + void GetChartBoundary (NgArray> & points, + NgArray> & poitns3d, NgArray & lines, double h) const override; /// diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 76796cd2..3d6ddb22 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -407,8 +407,8 @@ namespace netgen //FOR MESHING int GetMeshChartNr () { return meshchart; } - void GetMeshChartBoundary (NgArray & points, - NgArray & points3d, + void GetMeshChartBoundary (NgArray> & points, + NgArray> & points3d, NgArray & lines, double h); diff --git a/libsrc/stlgeom/stlgeommesh.cpp b/libsrc/stlgeom/stlgeommesh.cpp index fc497039..5d47453a 100644 --- a/libsrc/stlgeom/stlgeommesh.cpp +++ b/libsrc/stlgeom/stlgeommesh.cpp @@ -300,8 +300,8 @@ void STLGeometry :: PrepareSurfaceMeshing() meshcharttrigs = 0; } -void STLGeometry::GetMeshChartBoundary (NgArray & apoints, - NgArray & points3d, +void STLGeometry::GetMeshChartBoundary (NgArray> & apoints, + NgArray> & points3d, NgArray & alines, double h) { twoint seg, newseg; @@ -520,14 +520,9 @@ void STLGeometry :: ToPlane (const Point<3> & locpoint, int * trigs, int STLGeometry :: FromPlane (const Point<2> & plainpoint, Point<3> & locpoint, double h) { - Point2d plainpoint2 (plainpoint); - - plainpoint2.X() *= h; - plainpoint2.Y() *= h; - Vec3d p1p = plainpoint2.X() * ex + plainpoint2.Y() * ey; + Vec<3> p1p = h * plainpoint[0] * ex + h * plainpoint[1] * ey; locpoint = p1 + p1p; - int rv = Project(locpoint); if (!rv) {return 1;} //project nicht gegangen return 0;