diff --git a/libsrc/csg/csgeom.cpp b/libsrc/csg/csgeom.cpp index b4004a41..9a12443e 100644 --- a/libsrc/csg/csgeom.cpp +++ b/libsrc/csg/csgeom.cpp @@ -72,6 +72,84 @@ namespace netgen Clean(); } + void CSGeometry :: ProjectPoint(int surfind, Point<3> & p) const + { + Point<3> hp = p; + GetSurface(surfind)->Project (hp); + p = hp; + } + + void CSGeometry :: ProjectPointEdge(int surfind, INDEX surfind2, + Point<3> & p) const + { + Point<3> hp = p; + ProjectToEdge (GetSurface(surfind), + GetSurface(surfind2), hp); + p = hp; + } + + + Vec<3> CSGeometry :: GetNormal(int surfind, const Point<3> & p) const + { + Vec<3> hn; + GetSurface(surfind)->CalcGradient(p, hn); + hn.Normalize(); + return hn; + } + + void CSGeometry :: + PointBetween(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const + { + Point<3> hnewp; + hnewp = p1+secpoint*(p2-p1); + if (surfi != -1) + { + GetSurface (surfi) -> Project (hnewp); + newgi.trignum = 1; + } + + newp = hnewp; + } + + void CSGeometry :: PointBetweenEdge(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const + { + Point<3> hnewp = p1+secpoint*(p2-p1); + //(*testout) << "hnewp " << hnewp << " s1 " << surfi1 << " s2 " << surfi2 << endl; + if (surfi1 != -1 && surfi2 != -1 && surfi1 != surfi2) + { + netgen::ProjectToEdge (GetSurface(surfi1), + GetSurface(surfi2), + hnewp); + // (*testout) << "Pointbetween, newp = " << hnewp << endl + // << ", err = " << sqrt (sqr (hnewp(0))+ sqr(hnewp(1)) + sqr (hnewp(2))) - 1 << endl; + newgi.edgenr = 1; + //(*testout) << "hnewp (a1) " << hnewp << endl; + } + else if (surfi1 != -1) + { + GetSurface (surfi1) -> Project (hnewp); + //(*testout) << "hnewp (a2) " << hnewp << endl; + } + + newp = hnewp; + }; + + Vec<3> CSGeometry :: GetTangent(const Point<3> & p, int surfi1, int surfi2, + const EdgePointGeomInfo & ap1) const + { + Vec<3> n1 = GetSurface (surfi1)->GetNormalVector (p); + Vec<3> n2 = GetSurface (surfi2)->GetNormalVector (p); + Vec<3> tau = Cross (n1, n2).Normalize(); + return tau; + } void CSGeometry :: Clean () { @@ -137,15 +215,6 @@ namespace netgen return CSGGenerateMesh (*this, mesh, mparam); } - const Refinement & CSGeometry :: GetRefinement () const - { - // cout << "get CSGeometry - Refinement" << endl; - // should become class variables - RefinementSurfaces * ref = new RefinementSurfaces(*this); - ref -> Set2dOptimizer(new MeshOptimize2dSurfaces(*this)); - return *ref; - } - class WritePrimitivesIt : public SolidIterator { ostream & ost; diff --git a/libsrc/csg/csgeom.hpp b/libsrc/csg/csgeom.hpp index d178b81c..398c21bc 100644 --- a/libsrc/csg/csgeom.hpp +++ b/libsrc/csg/csgeom.hpp @@ -188,6 +188,24 @@ namespace netgen virtual void SaveToMeshFile (ostream & ost) const override; + void ProjectPoint(INDEX surfind, Point<3> & p) const override; + void ProjectPointEdge(INDEX surfind, INDEX surfind2, Point<3> & p) const override; + Vec<3> GetNormal(int surfind, const Point<3> & p) const override; + void PointBetween(const Point<3> & p1, const Point<3> & p2, + double secpoint, int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const override; + + void PointBetweenEdge(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const override; + + Vec<3> GetTangent (const Point<3> & p, int surfi1, int surfi2, + const EdgePointGeomInfo & ap1) const override; + int GetChangeVal() { return changeval; } void Change() { changeval++; } @@ -348,8 +366,6 @@ namespace netgen virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) override; - virtual const Refinement & GetRefinement () const override; - void AddSplineSurface (shared_ptr ss) { spline_surfaces.Append(ss); } }; diff --git a/libsrc/csg/genmesh.cpp b/libsrc/csg/genmesh.cpp index 3bc1c440..9ac96715 100644 --- a/libsrc/csg/genmesh.cpp +++ b/libsrc/csg/genmesh.cpp @@ -523,48 +523,48 @@ namespace netgen if (multithread.terminate) return; { - MeshOptimize2dSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.EdgeSwapping (mesh, (i > mparam.optsteps2d/2)); + meshopt.EdgeSwapping (i > mparam.optsteps2d/2); } if (multithread.terminate) return; { // mesh.CalcSurfacesOfNode(); - MeshOptimize2dSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.ImproveMesh (mesh, mparam); + meshopt.ImproveMesh(mparam); } { - MeshOptimize2dSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.CombineImprove (mesh); + meshopt.CombineImprove(); // mesh.CalcSurfacesOfNode(); } if (multithread.terminate) return; { - MeshOptimize2dSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.ImproveMesh (mesh, mparam); + meshopt.ImproveMesh(mparam); } } } diff --git a/libsrc/csg/meshsurf.cpp b/libsrc/csg/meshsurf.cpp index 1fcaeb17..f7b8d3fb 100644 --- a/libsrc/csg/meshsurf.cpp +++ b/libsrc/csg/meshsurf.cpp @@ -59,147 +59,4 @@ double Meshing2Surfaces :: CalcLocalH (const Point<3> & p, double gh) const return loch; */ } - - - - - - -MeshOptimize2dSurfaces :: MeshOptimize2dSurfaces (const CSGeometry & ageometry) - : MeshOptimize2d(), geometry(ageometry) -{ - ; -} - - -void MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point<3> & p) const -{ - Point<3> hp = p; - geometry.GetSurface(surfind)->Project (hp); - p = hp; -} - -void MeshOptimize2dSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, - Point<3> & p) const -{ - Point<3> hp = p; - ProjectToEdge ( geometry.GetSurface(surfind), - geometry.GetSurface(surfind2), hp); - p = hp; -} - - -void MeshOptimize2dSurfaces :: -GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const -{ - Vec<3> hn = n; - geometry.GetSurface(surfind)->CalcGradient (p, hn); - hn.Normalize(); - n = hn; - - /* - if (geometry.GetSurface(surfind)->Inverse()) - n *= -1; - */ -} - - - - - - - -RefinementSurfaces :: RefinementSurfaces (const CSGeometry & ageometry) - : Refinement(), geometry(ageometry) -{ - if(geometry.GetNSurf() == 0) - *testout << endl - << "WARNING: Initializing 2D refinement with 0-surface geometry" << endl - << "==========================================================" << endl - << endl << endl; -} - -RefinementSurfaces :: ~RefinementSurfaces () -{ - ; -} - -void RefinementSurfaces :: -PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const -{ - Point<3> hnewp; - hnewp = p1+secpoint*(p2-p1); - if (surfi != -1) - { - geometry.GetSurface (surfi) -> Project (hnewp); - newgi.trignum = 1; - } - - newp = hnewp; -} - -void RefinementSurfaces :: -PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const -{ - Point<3> hnewp = p1+secpoint*(p2-p1); - //(*testout) << "hnewp " << hnewp << " s1 " << surfi1 << " s2 " << surfi2 << endl; - if (surfi1 != -1 && surfi2 != -1 && surfi1 != surfi2) - { - netgen::ProjectToEdge (geometry.GetSurface(surfi1), - geometry.GetSurface(surfi2), - hnewp); - // (*testout) << "Pointbetween, newp = " << hnewp << endl - // << ", err = " << sqrt (sqr (hnewp(0))+ sqr(hnewp(1)) + sqr (hnewp(2))) - 1 << endl; - newgi.edgenr = 1; - //(*testout) << "hnewp (a1) " << hnewp << endl; - } - else if (surfi1 != -1) - { - geometry.GetSurface (surfi1) -> Project (hnewp); - //(*testout) << "hnewp (a2) " << hnewp << endl; - } - - newp = hnewp; -}; - -Vec<3> RefinementSurfaces :: GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & ap1) const -{ - Vec<3> n1 = geometry.GetSurface (surfi1)->GetNormalVector (p); - Vec<3> n2 = geometry.GetSurface (surfi2)->GetNormalVector (p); - Vec<3> tau = Cross (n1, n2).Normalize(); - return tau; -} - -Vec<3> RefinementSurfaces :: GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const -{ - return geometry.GetSurface (surfi1)->GetNormalVector (p); -} - - - -void RefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi) const -{ - if (surfi != -1) - geometry.GetSurface (surfi) -> Project (p); -}; - -void RefinementSurfaces :: ProjectToEdge (Point<3> & p, int surfi1, int surfi2, const EdgePointGeomInfo & egi) const -{ - netgen::ProjectToEdge (geometry.GetSurface(surfi1), - geometry.GetSurface(surfi2), - p); - -} - - } diff --git a/libsrc/csg/meshsurf.hpp b/libsrc/csg/meshsurf.hpp index 88e8f741..25e23857 100644 --- a/libsrc/csg/meshsurf.hpp +++ b/libsrc/csg/meshsurf.hpp @@ -38,62 +38,6 @@ namespace netgen /// double CalcLocalH(const Point<3> & p, double gh) const override; }; - - - - /// - class MeshOptimize2dSurfaces : public MeshOptimize2d - { - /// - const CSGeometry & geometry; - - public: - /// - MeshOptimize2dSurfaces (const CSGeometry & ageometry); - - /// - virtual void ProjectPoint (INDEX surfind, Point<3> & p) const override; - /// - virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const override; - /// - virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const override; - }; - - - - class RefinementSurfaces : public Refinement - { - const CSGeometry & geometry; - - public: - RefinementSurfaces (const CSGeometry & ageometry); - virtual ~RefinementSurfaces (); - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const override; - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const override; - - virtual Vec<3> GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & ap1) const override; - - virtual Vec<3> GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const override; - - - virtual void ProjectToSurface (Point<3> & p, int surfi) const override; - - virtual void ProjectToEdge (Point<3> & p, int surfi1, int surfi2, const EdgePointGeomInfo & egi) const override; - - }; - } #endif diff --git a/libsrc/geom2d/CMakeLists.txt b/libsrc/geom2d/CMakeLists.txt index 8809e06c..2a29f6e5 100644 --- a/libsrc/geom2d/CMakeLists.txt +++ b/libsrc/geom2d/CMakeLists.txt @@ -1,5 +1,5 @@ add_definitions(-DNGLIB_EXPORTS) -add_library(geom2d ${NG_LIB_TYPE} genmesh2d.cpp geom2dmesh.cpp geometry2d.cpp python_geom2d.cpp ) +add_library(geom2d ${NG_LIB_TYPE} genmesh2d.cpp geometry2d.cpp python_geom2d.cpp ) if(APPLE) set_target_properties( geom2d PROPERTIES SUFFIX ".so") endif(APPLE) @@ -18,7 +18,7 @@ if(USE_GUI) endif(USE_GUI) install(FILES - geom2dmesh.hpp geometry2d.hpp spline2d.hpp + geometry2d.hpp spline2d.hpp vsgeom2d.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/geom2d COMPONENT netgen_devel ) diff --git a/libsrc/geom2d/geom2dmesh.cpp b/libsrc/geom2d/geom2dmesh.cpp deleted file mode 100644 index bc5fef19..00000000 --- a/libsrc/geom2d/geom2dmesh.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include -#include - -namespace netgen -{ - - Refinement2d :: Refinement2d (const SplineGeometry2d & ageometry) - : Refinement(), geometry(ageometry) - { - ; - } - - Refinement2d :: ~Refinement2d () - { - ; - } - - - void Refinement2d :: - PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const - { - newp = p1+secpoint*(p2-p1); - newgi.trignum = 1; - } - - - - void Refinement2d :: - PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const - { - Point<2> p2d; - double newdist; - auto spline = geometry.GetSplines().Get(ap1.edgenr); - if( (ap1.dist == 0.0) && (ap2.dist == 0.0) ) - { - // used for manually generated meshes - const SplineSeg3<2> * ss3; - const LineSeg<2> * ls; - auto ext = dynamic_cast(spline); - if(ext) - { - ss3 = dynamic_cast *>(ext->seg); - ls = dynamic_cast *>(ext->seg); - } - else - { - ss3 = dynamic_cast *>(spline); - ls = dynamic_cast *>(spline); - } - Point<2> p12d(p1(0),p1(1)), p22d(p2(0),p2(1)); - Point<2> p1_proj(0.0,0.0), p2_proj(0.0,0.0); - double t1_proj = 0.0; - double t2_proj = 0.0; - if(ss3) - { - ss3->Project(p12d,p1_proj,t1_proj); - ss3->Project(p22d,p2_proj,t2_proj); - } - else if(ls) - { - ls->Project(p12d,p1_proj,t1_proj); - ls->Project(p22d,p2_proj,t2_proj); - } - p2d = spline->GetPoint (((1-secpoint)*t1_proj+secpoint*t2_proj)); - newdist = (1-secpoint)*t1_proj+secpoint*t2_proj; - } - else - { - p2d = spline->GetPoint (((1-secpoint)*ap1.dist+secpoint*ap2.dist)); - newdist = (1-secpoint)*ap1.dist+secpoint*ap2.dist; - } - - // (*testout) << "refine 2d line, ap1.dist, ap2.dist = " << ap1.dist << ", " << ap2.dist << endl; - // (*testout) << "p1, p2 = " << p1 << p2 << ", newp = " << p2d << endl; - - newp = Point3d (p2d(0), p2d(1), 0); - newgi.edgenr = ap1.edgenr; - newgi.dist = newdist; - }; - - - - Vec<3> Refinement2d :: GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & ap1) const - { - Vec<2> t2d = geometry.GetSplines().Get(ap1.edgenr) -> GetTangent(ap1.dist); - return Vec<3> (t2d(0), t2d(1), 0); - } - - Vec<3> Refinement2d :: GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const - { - return Vec<3> (0,0,1); - } - - - void Refinement2d :: ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & /* gi */) const - { - p(2) = 0; - } - - - void Refinement2d :: ProjectToEdge (Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & egi) const - { - Point<2> p2d (p(0), p(1)), pp; - double t; - geometry.GetSplines().Get(egi.edgenr) -> Project (p2d, pp, t); - p = Point<3> (pp(0), pp(1), 0); - } -} diff --git a/libsrc/geom2d/geom2dmesh.hpp b/libsrc/geom2d/geom2dmesh.hpp deleted file mode 100644 index cab3418e..00000000 --- a/libsrc/geom2d/geom2dmesh.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef FILE_GEOM2DMESH -#define FILE_GEOM2DMESH - -/**************************************************************************/ -/* File: geom2dmesh.hh */ -/* Author: Joachim Schoeberl */ -/* Date: 22. Jan. 01 */ -/**************************************************************************/ - - -namespace netgen -{ - - class Refinement2d : public Refinement - { - const class SplineGeometry2d & geometry; - - public: - Refinement2d (const class SplineGeometry2d & ageometry); - virtual ~Refinement2d (); - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const override; - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const override; - - - virtual Vec<3> GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & ap1) const override; - - virtual Vec<3> GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const override; - - virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & /* gi */) const override; - - virtual void ProjectToEdge (Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & egi) const override; - }; - - -} - - - -#endif diff --git a/libsrc/geom2d/geometry2d.cpp b/libsrc/geom2d/geometry2d.cpp index 3f5cac0c..43282cff 100644 --- a/libsrc/geom2d/geometry2d.cpp +++ b/libsrc/geom2d/geometry2d.cpp @@ -20,6 +20,76 @@ namespace netgen delete [] materials[i]; } + void SplineGeometry2d :: PointBetweenEdge(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const + { + Point<2> p2d; + double newdist; + auto spline = GetSplines().Get(ap1.edgenr); + if( (ap1.dist == 0.0) && (ap2.dist == 0.0) ) + { + // used for manually generated meshes + const SplineSeg3<2> * ss3; + const LineSeg<2> * ls; + auto ext = dynamic_cast(spline); + if(ext) + { + ss3 = dynamic_cast *>(ext->seg); + ls = dynamic_cast *>(ext->seg); + } + else + { + ss3 = dynamic_cast *>(spline); + ls = dynamic_cast *>(spline); + } + Point<2> p12d(p1(0),p1(1)), p22d(p2(0),p2(1)); + Point<2> p1_proj(0.0,0.0), p2_proj(0.0,0.0); + double t1_proj = 0.0; + double t2_proj = 0.0; + if(ss3) + { + ss3->Project(p12d,p1_proj,t1_proj); + ss3->Project(p22d,p2_proj,t2_proj); + } + else if(ls) + { + ls->Project(p12d,p1_proj,t1_proj); + ls->Project(p22d,p2_proj,t2_proj); + } + p2d = spline->GetPoint (((1-secpoint)*t1_proj+secpoint*t2_proj)); + newdist = (1-secpoint)*t1_proj+secpoint*t2_proj; + } + else + { + p2d = spline->GetPoint (((1-secpoint)*ap1.dist+secpoint*ap2.dist)); + newdist = (1-secpoint)*ap1.dist+secpoint*ap2.dist; + } + + // (*testout) << "refine 2d line, ap1.dist, ap2.dist = " << ap1.dist << ", " << ap2.dist << endl; + // (*testout) << "p1, p2 = " << p1 << p2 << ", newp = " << p2d << endl; + + newp = Point3d (p2d(0), p2d(1), 0); + newgi.edgenr = ap1.edgenr; + newgi.dist = newdist; + }; + + + + Vec<3> SplineGeometry2d :: GetTangent(const Point<3> & p, int surfi1, int surfi2, + const EdgePointGeomInfo & ap1) const + { + Vec<2> t2d = GetSplines().Get(ap1.edgenr) -> GetTangent(ap1.dist); + return Vec<3> (t2d(0), t2d(1), 0); + } + + Vec<3> SplineGeometry2d :: GetNormal(int surfi1, const Point<3> & p, + const PointGeomInfo & gi) const + { + return Vec<3> (0,0,1); + } void SplineGeometry2d :: Load (const char * filename) { @@ -992,14 +1062,6 @@ namespace netgen return 0; } - - Refinement & SplineGeometry2d :: GetRefinement () const - { - return * new Refinement2d (*this); - } - - - class SplineGeometryRegister : public GeometryRegister { public: diff --git a/libsrc/geom2d/geometry2d.hpp b/libsrc/geom2d/geometry2d.hpp index f8b55430..13c1887b 100644 --- a/libsrc/geom2d/geometry2d.hpp +++ b/libsrc/geom2d/geometry2d.hpp @@ -13,7 +13,6 @@ // #include "../gprim/spline.hpp" // #include "../gprim/splinegeometry.hpp" -#include "geom2dmesh.hpp" namespace netgen { @@ -151,12 +150,34 @@ namespace netgen void TestComment ( ifstream & infile ) ; - void DoArchive(Archive& ar) + void DoArchive(Archive& ar) override { SplineGeometry<2>::DoArchive(ar); ar & materials & maxh & quadmeshing & tensormeshing & layer & bcnames & elto0; } + void PointBetween(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const override + { + newp = p1+secpoint*(p2-p1); + newgi.trignum = 1; + } + + void PointBetweenEdge(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const override; + + + Vec<3> GetTangent (const Point<3> & p, int surfi1, int surfi2, + const EdgePointGeomInfo & ap1) const override; + Vec<3> GetNormal(int surfi1, const Point<3> & p, + const PointGeomInfo & gi) const override; + const SplineSegExt & GetSpline (const int i) const { return dynamic_cast (*splines[i]); @@ -168,7 +189,7 @@ namespace netgen } - DLL_HEADER virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); + DLL_HEADER int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) override; void PartitionBoundary (MeshingParameters & mp, double h, Mesh & mesh2d); @@ -205,9 +226,6 @@ namespace netgen int AddBCName (string name); string * BCNamePtr ( const int bcnr ); - - - DLL_HEADER virtual Refinement & GetRefinement () const; }; } diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index 6df0cf6e..4868b5a0 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -10,6 +10,40 @@ namespace netgen GeometryRegister :: ~GeometryRegister() { ; } + void NetgenGeometry :: OptimizeSurface(Mesh& mesh, const MeshingParameters& mparam) + { + const auto savetask = multithread.task; + multithread.task = "Optimizing surface"; + + static Timer timer_opt2d("Optimization 2D"); + RegionTimer reg(timer_opt2d); + auto meshopt = MeshOptimize2d(mesh); + for(auto i : Range(mparam.optsteps2d)) + { + PrintMessage(2, "Optimization step ", i); + for(auto optstep : mparam.optimize2d) + { + switch(optstep) + { + case 's': + meshopt.EdgeSwapping(0); + break; + case 'S': + meshopt.EdgeSwapping(1); + break; + case 'm': + meshopt.ImproveMesh(mparam); + break; + case 'c': + meshopt.CombineImprove(); + break; + } + } + } + mesh.CalcSurfacesOfNode(); + mesh.Compress(); + multithread.task = savetask; + } shared_ptr GeometryRegisterArray :: LoadFromMeshFile (istream & ist) const { @@ -27,26 +61,56 @@ namespace netgen int NetgenGeometry :: GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) { - if (!mesh) return 1; + multithread.percent = 0; - if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME) + if(mparam.perfstepsstart <= MESHCONST_ANALYSE) { - multithread.task = "Volume meshing"; - - MESHING3_RESULT res = - MeshVolume (mparam, *mesh); - - if (res != MESHING3_OK) return 1; - - if (multithread.terminate) return 0; - - RemoveIllegalElements (*mesh); - if (multithread.terminate) return 0; - - MeshQuality3d (*mesh); + if(!mesh) + mesh = make_shared(); + mesh->geomtype = GetGeomType(); + Analyse(*mesh, mparam); + } + + if(multithread.terminate || mparam.perfstepsend <= MESHCONST_ANALYSE) + return 0; + + if(mparam.perfstepsstart <= MESHCONST_MESHEDGES) + FindEdges(*mesh, mparam); + + if(multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHEDGES) + return 0; + + if (mparam.perfstepsstart <= MESHCONST_MESHSURFACE) + { + MeshSurface(*mesh, mparam); + mesh->CalcSurfacesOfNode(); + } + + if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHSURFACE) + return 0; + + if (mparam.perfstepsstart <= MESHCONST_OPTSURFACE) + OptimizeSurface(*mesh, mparam); + + if (multithread.terminate || mparam.perfstepsend <= MESHCONST_OPTSURFACE) + return 0; + + + if(mparam.perfstepsstart <= MESHCONST_MESHVOLUME) + { + multithread.task = "Volume meshing"; + + MESHING3_RESULT res = MeshVolume (mparam, *mesh); + + if (res != MESHING3_OK) return 1; + if (multithread.terminate) return 0; + + RemoveIllegalElements (*mesh); + if (multithread.terminate) return 0; + + MeshQuality3d (*mesh); } - if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHVOLUME) return 0; @@ -54,21 +118,14 @@ namespace netgen if (mparam.perfstepsstart <= MESHCONST_OPTVOLUME) { multithread.task = "Volume optimization"; - + OptimizeVolume (mparam, *mesh); if (multithread.terminate) return 0; } - + FinalizeMesh(*mesh); return 0; - } - - - const Refinement & NetgenGeometry :: GetRefinement () const - { - return *new Refinement;; } - void NetgenGeometry :: Save (string filename) const { throw NgException("Cannot save geometry - no geometry available"); diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index f6e63046..221e875b 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -15,16 +15,81 @@ namespace netgen class DLL_HEADER NetgenGeometry { + unique_ptr ref; public: + NetgenGeometry() + { + ref = make_unique(*this); + } virtual ~NetgenGeometry () { ; } virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); - virtual const Refinement & GetRefinement () const; + virtual const Refinement & GetRefinement () const + { + return *ref; + } - virtual void DoArchive(Archive&) + virtual void DoArchive(Archive&) { throw NgException("DoArchive not implemented for " + Demangle(typeid(*this).name())); } + virtual Mesh::GEOM_TYPE GetGeomType() const { return Mesh::NO_GEOM; } + virtual void Analyse(Mesh& mesh, + const MeshingParameters& mparam) {} + virtual void FindEdges(Mesh& mesh, const MeshingParameters& mparam) {} + virtual void MeshSurface(Mesh& mesh, const MeshingParameters& mparam) {} + virtual void OptimizeSurface(Mesh& mesh, const MeshingParameters& mparam); + + virtual void FinalizeMesh(Mesh& mesh) const {} + + virtual void ProjectPoint (int surfind, Point<3> & p) const + { } + virtual void ProjectPointEdge (int surfind, int surfind2, Point<3> & p) const { } + virtual void ProjectPointEdge (int surfind, int surfind2, Point<3> & p, EdgePointGeomInfo& gi) const + { ProjectPointEdge(surfind, surfind2, p); } + + virtual bool CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p3) const {return false;} + virtual bool ProjectPointGI (int surfind, Point<3> & p, PointGeomInfo & gi) const + { + ProjectPoint(surfind, p); + return CalcPointGeomInfo(surfind, gi, p); + } + virtual Vec<3> GetNormal(int surfind, const Point<3> & p) const + { return {0.,0.,1.}; } + virtual Vec<3> GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & gi) const + { return GetNormal(surfind, p); } + [[deprecated]] + void GetNormal(int surfind, const Point<3> & p, Vec<3> & n) const + { + n = GetNormal(surfind, p); + } + + virtual void PointBetween (const Point<3> & p1, + const Point<3> & p2, double secpoint, + int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, + PointGeomInfo & newgi) const + { + newp = p1 + secpoint * (p2-p1); + } + + virtual void PointBetweenEdge(const Point<3> & p1, + const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, + EdgePointGeomInfo & newgi) const + { + newp = p1+secpoint*(p2-p1); + } + + virtual Vec<3> GetTangent(const Point<3> & p, int surfi1, + int surfi2, + const EdgePointGeomInfo & egi) const + { throw Exception("Call GetTangent of " + Demangle(typeid(*this).name())); } virtual void Save (string filename) const; virtual void SaveToMeshFile (ostream & /* ost */) const { ; } }; diff --git a/libsrc/meshing/bisect.cpp b/libsrc/meshing/bisect.cpp index 9696fd81..9b5c770f 100644 --- a/libsrc/meshing/bisect.cpp +++ b/libsrc/meshing/bisect.cpp @@ -3430,11 +3430,11 @@ namespace netgen PointGeomInfo npgi; if (mesh[newp].Type() != EDGEPOINT) - PointBetween (mesh.Point (oldpi1), mesh.Point (oldpi2), - 0.5, si, - oldtri.pgeominfo[(oldtri.markededge+1)%3], - oldtri.pgeominfo[(oldtri.markededge+2)%3], - mesh.Point (newp), npgi); + geo.PointBetween (mesh.Point (oldpi1), mesh.Point (oldpi2), + 0.5, si, + oldtri.pgeominfo[(oldtri.markededge+1)%3], + oldtri.pgeominfo[(oldtri.markededge+2)%3], + mesh.Point (newp), npgi); BTBisectTri (oldtri, newp, npgi, newtri1, newtri2); @@ -3508,28 +3508,16 @@ namespace netgen PointGeomInfo npgi1, npgi2; int si = mesh.GetFaceDescriptor (oldquad.surfid).SurfNr(); - // geom->GetSurface(si)->Project (mesh.Point(newp1)); - // geom->GetSurface(si)->Project (mesh.Point(newp2)); - -// (*testout) -// cerr << "project point 1 " << newp1 << " old: " << mesh.Point(newp1); - PointBetween (mesh.Point (edge1.I1()), mesh.Point (edge1.I2()), - 0.5, si, - pgi11, - pgi12, - mesh.Point (newp1), npgi1); -// (*testout) -// cerr << " new: " << mesh.Point(newp1) << endl; - - -// cerr << "project point 2 " << newp2 << " old: " << mesh.Point(newp2); - PointBetween (mesh.Point (edge2.I1()), mesh.Point (edge2.I2()), - 0.5, si, - pgi21, - pgi22, - mesh.Point (newp2), npgi2); -// cerr << " new: " << mesh.Point(newp2) << endl; - + geo.PointBetween(mesh.Point (edge1.I1()), mesh.Point (edge1.I2()), + 0.5, si, + pgi11, + pgi12, + mesh.Point (newp1), npgi1); + geo.PointBetween (mesh.Point (edge2.I1()), mesh.Point (edge2.I2()), + 0.5, si, + pgi21, + pgi22, + mesh.Point (newp2), npgi2); BTBisectQuad (oldquad, newp1, npgi1, newp2, npgi2, newquad1, newquad2); @@ -3565,16 +3553,10 @@ namespace netgen EdgePointGeomInfo newepgi; - -// -// cerr << "move edgepoint " << newpi << " from " << mesh.Point(newpi); - PointBetween (mesh.Point (seg[0]), mesh.Point (seg[1]), - 0.5, seg.surfnr1, seg.surfnr2, - seg.epgeominfo[0], seg.epgeominfo[1], - mesh.Point (newpi), newepgi); -// cerr << " to " << mesh.Point (newpi) << endl; - - + geo.PointBetweenEdge(mesh.Point (seg[0]), mesh.Point (seg[1]), + 0.5, seg.surfnr1, seg.surfnr2, + seg.epgeominfo[0], seg.epgeominfo[1], + mesh.Point (newpi), newepgi); nseg1.epgeominfo[1] = newepgi; nseg2.epgeominfo[0] = newepgi; @@ -4141,62 +4123,4 @@ namespace netgen refine_hp = 0; refine_p = 0; } - - - Refinement :: Refinement () - { - optimizer2d = NULL; - } - - Refinement :: ~Refinement () - { - ; - } - - - void Refinement :: PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const - { - newp = p1+secpoint*(p2-p1); - } - - void Refinement :: PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const - { - //cout << "base class edge point between" << endl; - newp = p1+secpoint*(p2-p1); - } - - - Vec<3> Refinement :: GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & ap1) const - { - cerr << "Refinement::GetTangent not overloaded" << endl; - return Vec<3> (0,0,0); - } - - Vec<3> Refinement :: GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const - { - cerr << "Refinement::GetNormal not overloaded" << endl; - return Vec<3> (0,0,0); - } - - - void Refinement :: ProjectToSurface (Point<3> & p, int surfi) const - { - if (printmessage_importance>0) - cerr << "Refinement :: ProjectToSurface ERROR: no geometry set" << endl; - }; - - void Refinement :: ProjectToEdge (Point<3> & p, int surfi1, int surfi2, const EdgePointGeomInfo & egi) const - { - cerr << "Refinement::ProjectToEdge not overloaded" << endl; - } } diff --git a/libsrc/meshing/bisect.hpp b/libsrc/meshing/bisect.hpp index 7da7443c..6b96bd07 100644 --- a/libsrc/meshing/bisect.hpp +++ b/libsrc/meshing/bisect.hpp @@ -38,11 +38,11 @@ DLL_HEADER extern void ZRefinement (Mesh &, const class NetgenGeometry *, class DLL_HEADER Refinement { - MeshOptimize2d * optimizer2d; + const NetgenGeometry& geo; public: - Refinement (); - virtual ~Refinement (); + Refinement (const NetgenGeometry& ageo) : geo(ageo) {} + virtual ~Refinement () {} void Refine (Mesh & mesh) const; void Refine (Mesh & mesh); @@ -51,48 +51,9 @@ public: void MakeSecondOrder (Mesh & mesh) const; void MakeSecondOrder (Mesh & mesh); - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const; - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const; - - virtual Vec<3> GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & egi) const; - - virtual Vec<3> GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const; - - - virtual void ProjectToSurface (Point<3> & p, int surfi) const; - - virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & /* gi */) const - { - ProjectToSurface (p, surfi); - } - - virtual void ProjectToEdge (Point<3> & p, int surfi1, int surfi2, const EdgePointGeomInfo & egi) const; - - void ValidateSecondOrder (Mesh & mesh); void ValidateRefinedMesh (Mesh & mesh, NgArray & parents); - - MeshOptimize2d * Get2dOptimizer(void) const - { - return optimizer2d; - } - void Set2dOptimizer(MeshOptimize2d * opti) - { - optimizer2d = opti; - } - virtual void LocalizeEdgePoints(Mesh & /* mesh */) const {;} }; diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 392ef0ef..0ffc9b7a 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -539,7 +539,7 @@ namespace netgen CurvedElements :: CurvedElements (const Mesh & amesh) - : mesh (amesh) + : mesh(amesh), geo(*mesh.GetGeometry()) { order = 1; rational = 0; @@ -838,8 +838,8 @@ namespace netgen { Point<3> pm = Center (p1, p2); - Vec<3> n1 = ref -> GetNormal (p1, surfnr[e], gi0[e]); - Vec<3> n2 = ref -> GetNormal (p2, surfnr[e], gi1[e]); + Vec<3> n1 = geo.GetNormal (surfnr[e], p1, gi0[e]); + Vec<3> n2 = geo.GetNormal (surfnr[e], p2, gi1[e]); // p3 = pm + alpha1 n1 + alpha2 n2 @@ -876,7 +876,7 @@ namespace netgen Vec<3> v05 = 0.25 * Vec<3> (p1) + 0.5*w* Vec<3>(p3) + 0.25 * Vec<3> (p2); v05 /= 1 + (w-1) * 0.5; Point<3> p05 (v05), pp05(v05); - ref -> ProjectToSurface (pp05, surfnr[e], gi0[e]); + geo.ProjectPointGI(surfnr[e], pp05, gi0[e]); double d = Dist (pp05, p05); if (d < dold) @@ -911,16 +911,16 @@ namespace netgen if (swap) { p = p1 + xi[j] * (p2-p1); - ref -> PointBetween (p1, p2, xi[j], - surfnr[e], gi0[e], gi1[e], - pp, ppgi); + geo.PointBetween (p1, p2, xi[j], + surfnr[e], gi0[e], gi1[e], + pp, ppgi); } else { p = p2 + xi[j] * (p1-p2); - ref -> PointBetween (p2, p1, xi[j], - surfnr[e], gi1[e], gi0[e], - pp, ppgi); + geo.PointBetween (p2, p1, xi[j], + surfnr[e], gi1[e], gi0[e], + pp, ppgi); } Vec<3> dist = pp - p; @@ -1053,10 +1053,10 @@ namespace netgen if (rational) { - Vec<3> tau1 = ref -> GetTangent (p1, edge_surfnr2[edgenr], edge_surfnr1[edgenr], - edge_gi0[edgenr]); - Vec<3> tau2 = ref -> GetTangent (p2, edge_surfnr2[edgenr], edge_surfnr1[edgenr], - edge_gi1[edgenr]); + Vec<3> tau1 = geo.GetTangent(p1, edge_surfnr2[edgenr], edge_surfnr1[edgenr], + edge_gi0[edgenr]); + Vec<3> tau2 = geo.GetTangent(p2, edge_surfnr2[edgenr], edge_surfnr1[edgenr], + edge_gi1[edgenr]); // p1 + alpha1 tau1 = p2 + alpha2 tau2; Mat<3,2> mat; @@ -1082,8 +1082,8 @@ namespace netgen Vec<3> v05 = 0.25 * Vec<3> (p1) + 0.5*w* Vec<3>(p3) + 0.25 * Vec<3> (p2); v05 /= 1 + (w-1) * 0.5; Point<3> p05 (v05), pp05(v05); - ref -> ProjectToEdge (pp05, edge_surfnr1[edgenr], edge_surfnr2[edgenr], - edge_gi0[edgenr]); + geo.ProjectPointEdge(edge_surfnr1[edgenr], edge_surfnr2[edgenr], pp05, + edge_gi0[edgenr]); double d = Dist (pp05, p05); if (d < dold) @@ -1127,16 +1127,16 @@ namespace netgen if (swap) { p = p1 + xi[j] * (p2-p1); - ref -> PointBetween (p1, p2, xi[j], - edge_surfnr2[edgenr], edge_surfnr1[edgenr], - edge_gi0[edgenr], edge_gi1[edgenr], - pp, ppgi); + geo.PointBetweenEdge(p1, p2, xi[j], + edge_surfnr2[edgenr], edge_surfnr1[edgenr], + edge_gi0[edgenr], edge_gi1[edgenr], + pp, ppgi); } else { p = p2 + xi[j] * (p1-p2); - ref -> PointBetween (p2, p1, xi[j], - edge_surfnr2[edgenr], edge_surfnr1[edgenr], + geo.PointBetweenEdge(p2, p1, xi[j], + edge_surfnr2[edgenr], edge_surfnr1[edgenr], edge_gi1[edgenr], edge_gi0[edgenr], pp, ppgi); } @@ -1302,10 +1302,10 @@ namespace netgen SurfaceElementIndex sei = top.GetFace2SurfaceElement (f+1)-1; if (sei != SurfaceElementIndex(-1)) { PointGeomInfo gi = mesh[sei].GeomInfoPi(1); - ref -> ProjectToSurface (pp, surfnr[facenr], gi); + geo.ProjectPointGI(surfnr[facenr], pp, gi); } else - { ref -> ProjectToSurface (pp, surfnr[facenr]); } + { geo.ProjectPoint(surfnr[facenr], pp); } Vec<3> dist = pp-xa[jj]; CalcTrigShape (order1, lami[fnums[1]]-lami[fnums[0]], diff --git a/libsrc/meshing/curvedelems.hpp b/libsrc/meshing/curvedelems.hpp index f1a732a0..da46ae21 100644 --- a/libsrc/meshing/curvedelems.hpp +++ b/libsrc/meshing/curvedelems.hpp @@ -17,6 +17,7 @@ class Refinement; class CurvedElements { const Mesh & mesh; + const NetgenGeometry& geo; NgArray edgeorder; NgArray faceorder; diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 8e1c9576..524ba239 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -19,7 +19,7 @@ namespace netgen }; - bool MeshOptimize2d :: EdgeSwapping (Mesh & mesh, const int usemetric, + bool MeshOptimize2d :: EdgeSwapping (const int usemetric, Array &neighbors, Array &swapped, const SurfaceElementIndex t1, const int o1, @@ -85,12 +85,11 @@ namespace netgen nv1.Normalize(); nv2.Normalize(); - Vec<3> nvp3, nvp4; - GetNormalVector (surfnr, mesh.Point(pi3), gi3, nvp3); + auto nvp3 = geo.GetNormal (surfnr, mesh.Point(pi3), gi3); nvp3.Normalize(); - GetNormalVector (surfnr, mesh.Point(pi4), gi4, nvp4); + auto nvp4 = geo.GetNormal (surfnr, mesh.Point(pi4), gi4); nvp4.Normalize(); @@ -168,7 +167,7 @@ namespace netgen } - void MeshOptimize2d :: EdgeSwapping (Mesh & mesh, int usemetric) + void MeshOptimize2d :: EdgeSwapping (int usemetric) { static Timer timer("EdgeSwapping (2D)"); RegionTimer reg(timer); static Timer timer_nb("EdgeSwapping-Find neighbors"); @@ -203,7 +202,7 @@ namespace netgen } if(mixed) - return GenericImprove(mesh); + return GenericImprove(); Array neighbors(mesh.GetNSE()); auto elements_on_node = mesh.CreatePoint2SurfaceElementTable(faceindex); @@ -262,7 +261,7 @@ namespace netgen } }); - ParallelFor( Range(seia), [&pdef, &neighbors, &mesh, &seia, &elements_on_node] (auto i) NETGEN_LAMBDA_INLINE + ParallelFor( Range(seia), [this, &pdef, &neighbors, &seia, &elements_on_node] (auto i) NETGEN_LAMBDA_INLINE { auto sei = seia[i]; for (PointIndex pi : mesh[sei].template PNums<3>()) @@ -336,7 +335,7 @@ namespace netgen throw NgException ("Meshing stopped"); for (int o1 = 0; o1 < 3; o1++) - if(EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, t, pdef, true)) + if(EdgeSwapping(usemetric, neighbors, swapped, t1, o1, t, pdef, true)) improvement_candidates[cnt++]= std::make_pair(t1,o1); }); @@ -344,7 +343,7 @@ namespace netgen QuickSort(elements_with_improvement); for (auto [t1,o1] : elements_with_improvement) - done |= EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, t, pdef, false); + done |= EdgeSwapping(usemetric, neighbors, swapped, t1, o1, t, pdef, false); t--; } @@ -566,9 +565,9 @@ namespace netgen return d_badness; } - void MeshOptimize2d :: CombineImprove (Mesh & mesh) + void MeshOptimize2d :: CombineImprove () { - SplitImprove(mesh); + SplitImprove(); PrintMessage (3, "Combine improve"); if (multithread.terminate) @@ -649,7 +648,7 @@ namespace netgen { const int faceindex = hel.GetIndex(); const int surfnr = mesh.GetFaceDescriptor (faceindex).SurfNr(); - GetNormalVector (surfnr, mesh[pi], hel.GeomInfoPi(k+1), normals[pi]); + normals[pi] = geo.GetNormal (surfnr, mesh[pi], hel.GeomInfoPi(k+1)); break; } } @@ -682,7 +681,7 @@ namespace netgen mesh.SetNextTimeStamp(); } - void MeshOptimize2d :: SplitImprove (Mesh & mesh) + void MeshOptimize2d :: SplitImprove() { if (!faceindex) { @@ -691,7 +690,7 @@ namespace netgen mesh.CalcSurfacesOfNode(); // TODO: needed? for (faceindex = 1; faceindex <= mesh.GetNFD(); faceindex++) { - SplitImprove (mesh); + SplitImprove(); if (multithread.terminate) throw NgException ("Meshing stopped"); @@ -750,70 +749,81 @@ namespace netgen // TODO: split also bad trigs, nut just illegal ones if (mesh.LegalTrig(sel)) continue; - for (int j = 0; j < 3; j++) + // find longest edge + INDEX_2 edge; + double edge_len = 0; + PointIndex pi1, pi2, pi3, pi4; + PointGeomInfo gi1, gi2, gi3, gi4; + for(auto j : Range(1,4)) { - PointIndex pi1 = sel.PNumMod(j+2); - PointIndex pi2 = sel.PNumMod(j+3); - PointIndex pi3 = sel.PNumMod(j+1); - PointIndex pi4; - PointGeomInfo gi1 = sel.GeomInfoPiMod(j+2); - PointGeomInfo gi2 = sel.GeomInfoPiMod(j+3); - PointGeomInfo gi3 = sel.GeomInfoPiMod(j+1); - PointGeomInfo gi4; - - if (mesh.IsSegment (pi1, pi2)) continue; - - // get neighbor element - INDEX_2 ii2 (pi1, pi2); - ii2.Sort(); - auto els = els_on_edge.Get(ii2); - SurfaceElementIndex other_i = get<0>(els); - if(other_i==sei) other_i = get<1>(els); - auto & other = mesh[other_i]; - - // find opposite point of neighbor element - for (int j = 0; j < 3; j++) - if(other[j]!=pi1 && other[j]!=pi2) - { - pi4 = other[j]; - gi4 = other.GeomInfoPi(j); - break; - } - - // split edge pi1,pi2 - Point<3> p5; - PointIndex pi5; - PointGeomInfo gi5; - - mesh.GetGeometry()->GetRefinement().PointBetween (mesh[pi1], mesh[pi2], 0.5, - faceindex, - gi1, gi2, p5, gi5); - - pi5 = mesh.AddPoint(p5); - - Element2d e1(3); - e1.SetIndex(faceindex); - e1={ {pi1,gi1}, {pi5,gi5}, {pi3,gi3} }; - mesh.AddSurfaceElement( e1 ); - - Element2d e2(3); - e2.SetIndex(faceindex); - e2 ={ {pi5,gi5}, {pi2,gi2}, {pi3,gi3} }; - mesh.AddSurfaceElement( e2 ); - - Element2d e3(3); - e3.SetIndex(faceindex); - e3 ={ {pi1,gi1}, {pi4,gi4}, {pi5,gi5} }; - mesh.AddSurfaceElement( e3 ); - - Element2d e4(3); - e4.SetIndex(faceindex); - e4 ={ {pi4,gi4}, {pi2,gi2}, {pi5,gi5} }; - mesh.AddSurfaceElement( e4 ); - - sel.Delete(); - other.Delete(); + auto test_pi1 = sel.PNumMod(j); + auto test_pi2 = sel.PNumMod(j+1); + if (mesh.IsSegment(test_pi1, test_pi2)) + continue; + auto len = (mesh[test_pi2]-mesh[test_pi1]).Length(); + if(len > edge_len) + { + edge = {test_pi1, test_pi2}; + edge.Sort(); + edge_len = len; + pi1 = test_pi1; + pi2 = test_pi2; + pi3 = sel.PNumMod(j+2); + gi1 = sel.GeomInfoPiMod(j); + gi2 = sel.GeomInfoPiMod(j+1); + gi3 = sel.GeomInfoPiMod(j+2); + } } + if(!edge_len) + throw Exception("Couldn't find edge to split, something is wrong"); + // get neighbor element + auto els = els_on_edge.Get(edge); + SurfaceElementIndex other_i = get<0>(els); + if(other_i==sei) other_i = get<1>(els); + auto & other = mesh[other_i]; + + // find opposite point of neighbor element + for (int j = 0; j < 3; j++) + if(other[j]!=pi1 && other[j]!=pi2) + { + pi4 = other[j]; + gi4 = other.GeomInfoPi(j); + break; + } + + // split edge pi1,pi2 + Point<3> p5; + PointIndex pi5; + PointGeomInfo gi5; + + geo.PointBetween(mesh[pi1], mesh[pi2], 0.5, + faceindex, + gi1, gi2, p5, gi5); + + pi5 = mesh.AddPoint(p5); + + Element2d e1(3); + e1.SetIndex(faceindex); + e1={ {pi1,gi1}, {pi5,gi5}, {pi3,gi3} }; + mesh.AddSurfaceElement( e1 ); + + Element2d e2(3); + e2.SetIndex(faceindex); + e2 ={ {pi5,gi5}, {pi2,gi2}, {pi3,gi3} }; + mesh.AddSurfaceElement( e2 ); + + Element2d e3(3); + e3.SetIndex(faceindex); + e3 ={ {pi1,gi1}, {pi4,gi4}, {pi5,gi5} }; + mesh.AddSurfaceElement( e3 ); + + Element2d e4(3); + e4.SetIndex(faceindex); + e4 ={ {pi4,gi4}, {pi2,gi2}, {pi5,gi5} }; + mesh.AddSurfaceElement( e4 ); + + sel.Delete(); + other.Delete(); } mesh.SetNextTimeStamp(); diff --git a/libsrc/meshing/improve2.hpp b/libsrc/meshing/improve2.hpp index bc4ad00d..08172818 100644 --- a/libsrc/meshing/improve2.hpp +++ b/libsrc/meshing/improve2.hpp @@ -75,29 +75,31 @@ public: /// class MeshOptimize2d { - int faceindex; - int improveedges; - double metricweight; - int writestatus; - + int faceindex = 0; + int improveedges = 0; + double metricweight = 0.; + int writestatus = 1; + Mesh& mesh; + const NetgenGeometry& geo; public: /// - MeshOptimize2d (); + MeshOptimize2d(Mesh& amesh) : mesh(amesh), geo(*mesh.GetGeometry()) + {} virtual ~MeshOptimize2d() { ; } /// - void ImproveMesh (Mesh & mesh2d, const MeshingParameters & mp); - void ImproveMeshJacobian (Mesh & mesh2d, const MeshingParameters & mp); - void ImproveVolumeMesh (Mesh & mesh); + void ImproveMesh (const MeshingParameters & mp); + void ImproveMeshJacobian (const MeshingParameters & mp); + void ImproveVolumeMesh (); void ProjectBoundaryPoints(NgArray & surfaceindex, const NgArray* > & from, NgArray* > & dest); - bool EdgeSwapping (Mesh & mesh, const int usemetric, Array &neighbors, Array &swapped, + bool EdgeSwapping (const int usemetric, Array &neighbors, Array &swapped, const SurfaceElementIndex t1, const int edge, const int t, Array &pdef, const bool check_only=false); - void EdgeSwapping (Mesh & mesh, int usemetric); - void CombineImprove (Mesh & mesh); - void SplitImprove (Mesh & mesh); + void EdgeSwapping (int usemetric); + void CombineImprove (); + void SplitImprove (); - void GenericImprove (Mesh & mesh); + void GenericImprove (); void SetFaceIndex (int fi) { faceindex = fi; } @@ -106,28 +108,9 @@ public: void SetWriteStatus (int ws) { writestatus = ws; } - - /// - virtual void ProjectPoint (INDEX /* surfind */, Point<3> & /* p */) const { }; - - /// project point, use gi as initial value, and compute new gi - virtual int ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const - { ProjectPoint (surfind, p); return CalcPointGeomInfo (surfind, gi, p); } - - /// - virtual void ProjectPoint2 (INDEX /* surfind */, INDEX /* surfind2 */, Point<3> & /* p */) const { }; - /// liefert zu einem 3d-Punkt die geominfo (Dreieck) und liefert 1, wenn erfolgreich, /// 0, wenn nicht (Punkt ausserhalb von chart) - virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & /*p3*/) const - { gi.trignum = 1; return 1;}; - - virtual int CalcPointGeomInfo(int /* surfind */, PointGeomInfo& gi, const Point<3> & p3) const - { return CalcPointGeomInfo (gi, p3); } - /// - virtual void GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const; - virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const; void CheckMeshApproximation (Mesh & mesh); diff --git a/libsrc/meshing/improve2gen.cpp b/libsrc/meshing/improve2gen.cpp index 326afbf2..1d4ebbc9 100644 --- a/libsrc/meshing/improve2gen.cpp +++ b/libsrc/meshing/improve2gen.cpp @@ -19,7 +19,7 @@ namespace netgen }; - void MeshOptimize2d :: GenericImprove (Mesh & mesh) + void MeshOptimize2d :: GenericImprove () { static Timer timer("MeshOptimize2d::GenericImprove"); RegionTimer reg(timer); if (!faceindex) @@ -28,7 +28,7 @@ namespace netgen PrintMessage (3, "Generic Improve"); for (faceindex = 1; faceindex <= mesh.GetNFD(); faceindex++) - GenericImprove (mesh); + GenericImprove (); faceindex = 0; } @@ -396,9 +396,8 @@ namespace netgen // calc metric badness double bad1 = 0, bad2 = 0; - Vec<3> n; - - GetNormalVector (surfnr, mesh.Point(pmap.Get(1)), pgi.Elem(1), n); + // SelectSurfaceOfPoint (mesh.Point(pmap.Get(1)), pgi.Get(1)); + auto n = geo.GetNormal(surfnr, mesh.Point(pmap.Get(1)), pgi.Elem(1)); for (int j = 0; j < rule.oldels.Size(); j++) bad1 += mesh[elmap[j]].CalcJacobianBadness (mesh.Points(), n); diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 6431afad..fab9a13f 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -864,7 +864,7 @@ namespace netgen /// friend class Meshing3; - + // only for saving the geometry enum GEOM_TYPE { NO_GEOM = 0, GEOM_2D = 1, GEOM_CSG = 10, GEOM_STL = 11, GEOM_OCC = 12, GEOM_ACIS = 13 }; GEOM_TYPE geomtype; diff --git a/libsrc/meshing/meshfunc2d.cpp b/libsrc/meshing/meshfunc2d.cpp index 9c794da2..90ac9b68 100644 --- a/libsrc/meshing/meshfunc2d.cpp +++ b/libsrc/meshing/meshfunc2d.cpp @@ -31,30 +31,30 @@ namespace netgen { case 's': { // topological swap - MeshOptimize2d meshopt; + MeshOptimize2d meshopt(mesh); meshopt.SetMetricWeight (mp.elsizeweight); - meshopt.EdgeSwapping (mesh, 0); + meshopt.EdgeSwapping (0); break; } case 'S': { // metric swap - MeshOptimize2d meshopt; + MeshOptimize2d meshopt(mesh); meshopt.SetMetricWeight (mp.elsizeweight); - meshopt.EdgeSwapping (mesh, 1); + meshopt.EdgeSwapping (1); break; } case 'm': { - MeshOptimize2d meshopt; + MeshOptimize2d meshopt(mesh); meshopt.SetMetricWeight (mp.elsizeweight); - meshopt.ImproveMesh(mesh, mp); + meshopt.ImproveMesh(mp); break; } case 'c': { - MeshOptimize2d meshopt; + MeshOptimize2d meshopt(mesh); meshopt.SetMetricWeight (mp.elsizeweight); - meshopt.CombineImprove(mesh); + meshopt.CombineImprove(); break; } default: diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 66687a6d..f28a5cd1 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -1234,7 +1234,7 @@ namespace netgen // P .. plot, pause // c .. combine **/ - string optimize2d = "smsmsmSmSmSm"; + string optimize2d = "smcmSmcmSmcm"; /// number of 2d optimization steps int optsteps2d = 3; /// power of error (to approximate max err optimization) diff --git a/libsrc/meshing/python_mesh.hpp b/libsrc/meshing/python_mesh.hpp index d28c3211..96c930a5 100644 --- a/libsrc/meshing/python_mesh.hpp +++ b/libsrc/meshing/python_mesh.hpp @@ -66,7 +66,7 @@ optimize3d: str = "cmdmustm" optsteps3d: int = 3 Number of 3d optimization steps. -optimize2d: str = "smsmsmSmSmSm" +optimize2d: str = "smcmSmcmSmcm" 2d optimization strategy: s .. swap, opt 6 lines/node S .. swap, optimal elements diff --git a/libsrc/meshing/refine.cpp b/libsrc/meshing/refine.cpp index ef99ff0a..228ebf2b 100644 --- a/libsrc/meshing/refine.cpp +++ b/libsrc/meshing/refine.cpp @@ -147,11 +147,11 @@ namespace netgen { pointset[pinew] = true; Point<3> pnew; - PointBetween (mesh.Point (el[0]), - mesh.Point (el[1]), 0.5, - el.surfnr1, el.surfnr2, - el.epgeominfo[0], el.epgeominfo[1], - pnew, ngi); + geo.PointBetweenEdge(mesh.Point (el[0]), + mesh.Point (el[1]), 0.5, + el.surfnr1, el.surfnr2, + el.epgeominfo[0], el.epgeominfo[1], + pnew, ngi); // pinew = mesh.AddPoint (pnew); mesh.Point(pinew) = pnew; @@ -216,12 +216,12 @@ namespace netgen Point<3> pb; PointGeomInfo pgi; - PointBetween (mesh.Point (pi1), - mesh.Point (pi2), 0.5, - mesh.GetFaceDescriptor(el.GetIndex ()).SurfNr(), - el.GeomInfoPi (betw[j][0]), - el.GeomInfoPi (betw[j][1]), - pb, pgi); + geo.PointBetween(mesh.Point (pi1), + mesh.Point (pi2), 0.5, + mesh.GetFaceDescriptor(el.GetIndex ()).SurfNr(), + el.GeomInfoPi (betw[j][0]), + el.GeomInfoPi (betw[j][1]), + pb, pgi); pgis.Elem(4+j) = pgi; @@ -307,12 +307,12 @@ namespace netgen else { Point<3> pb; - PointBetween (mesh.Point (pi1), - mesh.Point (pi2), 0.5, - mesh.GetFaceDescriptor(el.GetIndex ()).SurfNr(), - el.GeomInfoPi (betw[j][0]), - el.GeomInfoPi (betw[j][1]), - pb, pgis.Elem(5+j)); + geo.PointBetween(mesh.Point (pi1), + mesh.Point (pi2), 0.5, + mesh.GetFaceDescriptor(el.GetIndex ()).SurfNr(), + el.GeomInfoPi (betw[j][0]), + el.GeomInfoPi (betw[j][1]), + pb, pgis.Elem(5+j)); pnums.Elem(5+j) = mesh.AddPoint (pb); diff --git a/libsrc/meshing/secondorder.cpp b/libsrc/meshing/secondorder.cpp index 14fc43d4..3a7368a9 100644 --- a/libsrc/meshing/secondorder.cpp +++ b/libsrc/meshing/secondorder.cpp @@ -100,11 +100,11 @@ namespace netgen { Point<3> pb; EdgePointGeomInfo ngi; - PointBetween (mesh.Point (el[0]), - mesh.Point (el[1]), 0.5, - el.surfnr1, el.surfnr2, - el.epgeominfo[0], el.epgeominfo[1], - pb, ngi); + geo.PointBetweenEdge(mesh.Point (el[0]), + mesh.Point (el[1]), 0.5, + el.surfnr1, el.surfnr2, + el.epgeominfo[0], el.epgeominfo[1], + pb, ngi); el[2] = mesh.AddPoint (pb, mesh.Point(el[0]).GetLayer(), EDGEPOINT); @@ -184,12 +184,12 @@ namespace netgen { Point<3> pb; PointGeomInfo newgi; - PointBetween (mesh.Point (pi1), - mesh.Point (pi2), 0.5, - mesh.GetFaceDescriptor(el.GetIndex ()).SurfNr(), - el.GeomInfoPi (betw[j][0]+1), - el.GeomInfoPi (betw[j][1]+1), - pb, newgi); + geo.PointBetween(mesh.Point (pi1), + mesh.Point (pi2), 0.5, + mesh.GetFaceDescriptor(el.GetIndex ()).SurfNr(), + el.GeomInfoPi (betw[j][0]+1), + el.GeomInfoPi (betw[j][1]+1), + pb, newgi); newel[onp+j] = mesh.AddPoint (pb, mesh.Point(pi1).GetLayer(), SURFACEPOINT); diff --git a/libsrc/meshing/smoothing2.5.cpp b/libsrc/meshing/smoothing2.5.cpp index 3bcefee8..587c8d47 100644 --- a/libsrc/meshing/smoothing2.5.cpp +++ b/libsrc/meshing/smoothing2.5.cpp @@ -15,14 +15,14 @@ namespace netgen if(surfaceindex[i] >= 0) { *dest[i] = *from[i]; - ProjectPoint(surfaceindex[i],*dest[i]); + geo.ProjectPoint(surfaceindex[i],*dest[i]); } } } - void MeshOptimize2d :: ImproveVolumeMesh (Mesh & mesh) + void MeshOptimize2d :: ImproveVolumeMesh () { if (!faceindex) @@ -31,7 +31,7 @@ namespace netgen for (faceindex = 1; faceindex <= mesh.GetNFD(); faceindex++) { - ImproveVolumeMesh (mesh); + ImproveVolumeMesh (); if (multithread.terminate) throw NgException ("Meshing stopped"); } @@ -229,7 +229,7 @@ namespace netgen //cout << "origp " << origp << " newp " << mesh[pi]; ngi = gi1; - moveisok = (ProjectPointGI (surfi, mesh[pi], ngi) != 0); + moveisok = (geo.ProjectPointGI(surfi, mesh[pi], ngi) != 0); //cout << " projected " << mesh[pi] << endl; diff --git a/libsrc/meshing/smoothing2.cpp b/libsrc/meshing/smoothing2.cpp index 2aa1308c..a3ebd88c 100644 --- a/libsrc/meshing/smoothing2.cpp +++ b/libsrc/meshing/smoothing2.cpp @@ -205,22 +205,20 @@ namespace netgen class Opti2SurfaceMinFunction : public MinFunction { - const Mesh & mesh; Opti2dLocalData & ld; + const NetgenGeometry& geo; public: Opti2SurfaceMinFunction (const Mesh & amesh, Opti2dLocalData & ald) - : mesh(amesh), ld(ald) + : ld(ald), geo(*amesh.GetGeometry()) { } ; virtual double Func (const Vector & x) const { - Vec<3> n; - double badness = 0; - ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n); + auto n = geo.GetNormal(ld.surfi, ld.sp1, ld.gi1); Point<3> pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2; for (int j = 0; j < ld.locelements.Size(); j++) @@ -355,13 +353,13 @@ namespace netgen // static int timer = NgProfiler::CreateTimer ("opti2surface - funcgrad"); // NgProfiler::RegionTimer reg (timer); - Vec<3> n, vgrad; + Vec<3> vgrad; Point<3> pp1; vgrad = 0; double badness = 0; - ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n); + auto n = geo.GetNormal(ld.surfi, ld.sp1, ld.gi1); pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2; // meshthis -> ProjectPoint (surfi, pp1); @@ -410,13 +408,13 @@ namespace netgen // static int timer = NgProfiler::CreateTimer ("opti2surface - funcderiv"); // NgProfiler::RegionTimer reg (timer); - Vec<3> n, vgrad; + Vec<3> vgrad; Point<3> pp1; vgrad = 0; double badness = 0; - ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n); + auto n = geo.GetNormal(ld.surfi, ld.sp1, ld.gi1); pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2; for (int j = 0; j < ld.locelements.Size(); j++) @@ -474,11 +472,12 @@ namespace netgen { const Mesh & mesh; Opti2dLocalData & ld; + const NetgenGeometry& geo; public: Opti2EdgeMinFunction (const Mesh & amesh, Opti2dLocalData & ald) - : mesh(amesh), ld(ald) { } ; + : mesh(amesh), ld(ald), geo(*amesh.GetGeometry()) { } ; virtual double FuncGrad (const Vector & x, Vector & g) const; virtual double Func (const Vector & x) const; @@ -493,7 +492,7 @@ namespace netgen double Opti2EdgeMinFunction :: FuncGrad (const Vector & x, Vector & grad) const { int j, rot; - Vec<3> n1, n2, v1, v2, e1, e2, vgrad; + Vec<3> v1, v2, e1, e2, vgrad; Point<3> pp1; Vec<2> g1; double badness, hbadness; @@ -502,7 +501,7 @@ namespace netgen badness = 0; pp1 = ld.sp1 + x(0) * ld.t1; - ld.meshthis -> ProjectPoint2 (ld.surfi, ld.surfi2, pp1); + geo.ProjectPointEdge(ld.surfi, ld.surfi2, pp1); for (j = 0; j < ld.locelements.Size(); j++) { @@ -526,8 +525,8 @@ namespace netgen vgrad += g1(0) * e1 + g1(1) * e2; } - ld.meshthis -> GetNormalVector (ld.surfi, pp1, n1); - ld.meshthis -> GetNormalVector (ld.surfi2, pp1, n2); + auto n1 = geo.GetNormal(ld.surfi, pp1); + auto n2 = geo.GetNormal(ld.surfi2, pp1); v1 = Cross (n1, n2); v1.Normalize(); @@ -544,11 +543,12 @@ namespace netgen { const Mesh & mesh; Opti2dLocalData & ld; + const NetgenGeometry& geo; public: Opti2SurfaceMinFunctionJacobian (const Mesh & amesh, Opti2dLocalData & ald) - : mesh(amesh), ld(ald) + : mesh(amesh), ld(ald), geo(*amesh.GetGeometry()) { } ; virtual double FuncGrad (const Vector & x, Vector & g) const; virtual double FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const; @@ -569,7 +569,7 @@ namespace netgen // from 2d: int lpi, gpi; - Vec<3> n, vgrad; + Vec<3> vgrad; Point<3> pp1; Vec<2> g1, vdir; double badness, hbad, hderiv; @@ -577,7 +577,7 @@ namespace netgen vgrad = 0; badness = 0; - ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n); + auto n = geo.GetNormal(ld.surfi, ld.sp1, ld.gi1); pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2; @@ -641,7 +641,7 @@ namespace netgen // from 2d: int j, k, lpi, gpi; - Vec<3> n, vgrad; + Vec<3> vgrad; Point<3> pp1; Vec<2> g1, vdir; double badness, hbad, hderiv; @@ -649,8 +649,6 @@ namespace netgen vgrad = 0; badness = 0; - ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n); - // pp1 = sp1; // pp1.Add2 (x.Get(1), t1, x.Get(2), t2); pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2; @@ -690,24 +688,7 @@ namespace netgen return badness; } - - - - - - - MeshOptimize2d dummy; - - MeshOptimize2d :: MeshOptimize2d () - { - SetFaceIndex (0); - SetImproveEdges (0); - SetMetricWeight (0); - SetWriteStatus (1); - } - - - void MeshOptimize2d :: ImproveMesh (Mesh & mesh, const MeshingParameters & mp) + void MeshOptimize2d :: ImproveMesh (const MeshingParameters & mp) { static Timer timer("MeshSmoothing 2D"); RegionTimer reg (timer); @@ -919,6 +900,7 @@ namespace netgen } ld.gi1 = hel.GeomInfoPi(hpi); + // SelectSurfaceOfPoint (ld.sp1, ld.gi1); ld.locelements.SetSize(0); ld.locrots.SetSize (0); @@ -951,7 +933,7 @@ namespace netgen } - GetNormalVector (ld.surfi, ld.sp1, ld.gi1, ld.normal); + ld.normal = geo.GetNormal(ld.surfi, ld.sp1, ld.gi1); ld.t1 = ld.normal.GetNormal (); ld.t2 = Cross (ld.normal, ld.t1); @@ -1029,7 +1011,7 @@ namespace netgen PointGeomInfo ngi; ngi = ld.gi1; - moveisok = ProjectPointGI (ld.surfi, mesh[pi], ngi); + moveisok = geo.ProjectPointGI(ld.surfi, mesh[pi], ngi); // point lies on same chart in stlsurface if (moveisok) @@ -1052,14 +1034,4 @@ namespace netgen CheckMeshApproximation (mesh); mesh.SetNextTimeStamp(); } - - void MeshOptimize2d :: GetNormalVector(INDEX /* surfind */, const Point<3> & p, Vec<3> & nv) const - { - nv = Vec<3> (0, 0, 1); - } - - void MeshOptimize2d :: GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const - { - GetNormalVector (surfind, p, n); - } } diff --git a/libsrc/meshing/validate.cpp b/libsrc/meshing/validate.cpp index 06122ce9..f5fbff75 100644 --- a/libsrc/meshing/validate.cpp +++ b/libsrc/meshing/validate.cpp @@ -276,8 +276,8 @@ namespace netgen double oldlamedge,oldlamface; - MeshOptimize2d * optimizer2d = refinement.Get2dOptimizer(); - if(!optimizer2d) + auto geo = mesh.GetGeometry(); + if(!geo) { cerr << "No 2D Optimizer!" << endl; return; @@ -382,8 +382,15 @@ namespace netgen for (int i = 1; i <= np; i++) *can.Elem(i) = mesh.Point(i); - if(optimizer2d) - optimizer2d->ProjectBoundaryPoints(surfaceindex,can,should); + if(geo) + for(int i=0; i= 0) + { + *should[i] = *can[i]; + geo->ProjectPoint(surfaceindex[i],*should[i]); + } + } } diff --git a/libsrc/occ/Partition_Inter3d.cxx b/libsrc/occ/Partition_Inter3d.cxx index 38787fbe..df02e94c 100644 --- a/libsrc/occ/Partition_Inter3d.cxx +++ b/libsrc/occ/Partition_Inter3d.cxx @@ -206,7 +206,7 @@ static void PutInBounds (const TopoDS_Face& F, Handle (Geom_Surface) S = BRep_Tool::Surface(F,L); if (S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { - S = (*(Handle_Geom_RectangularTrimmedSurface*)&S)->BasisSurface(); + S = Handle(Geom_RectangularTrimmedSurface)::DownCast(S)->BasisSurface(); } if (!S->IsUPeriodic() && !S->IsVPeriodic()) return; @@ -702,7 +702,7 @@ TopTools_MapOfShape& Partition_Inter3d::TouchedFaces() //purpose : //======================================================================= -Handle_BRepAlgo_AsDes Partition_Inter3d::AsDes() const +Handle(BRepAlgo_AsDes) Partition_Inter3d::AsDes() const { return myAsDes; } @@ -829,7 +829,7 @@ TopoDS_Vertex Partition_Inter3d::ReplaceSameDomainV(const TopoDS_Vertex& V, //purpose : //======================================================================= -Handle_BRepAlgo_AsDes Partition_Inter3d::SectionEdgesAD() const +Handle(BRepAlgo_AsDes) Partition_Inter3d::SectionEdgesAD() const { return mySectionEdgesAD; } diff --git a/libsrc/occ/Partition_Inter3d.hxx b/libsrc/occ/Partition_Inter3d.hxx index 93af0773..f2133c24 100644 --- a/libsrc/occ/Partition_Inter3d.hxx +++ b/libsrc/occ/Partition_Inter3d.hxx @@ -96,13 +96,13 @@ public: void FacesPartition(const TopoDS_Face& F1,const TopoDS_Face& F2) ; Standard_Boolean IsDone(const TopoDS_Face& F1,const TopoDS_Face& F2) const; TopTools_MapOfShape& TouchedFaces() ; - Handle_BRepAlgo_AsDes AsDes() const; + Handle(BRepAlgo_AsDes) AsDes() const; TopTools_MapOfShape& NewEdges() ; Standard_Boolean HasSameDomainF(const TopoDS_Shape& F) const; Standard_Boolean IsSameDomainF(const TopoDS_Shape& F1,const TopoDS_Shape& F2) const; const TopTools_ListOfShape& SameDomain(const TopoDS_Face& F) const; TopoDS_Vertex ReplaceSameDomainV(const TopoDS_Vertex& V,const TopoDS_Edge& E) const; - Handle_BRepAlgo_AsDes SectionEdgesAD() const; + Handle(BRepAlgo_AsDes) SectionEdgesAD() const; Standard_Boolean IsSectionEdge(const TopoDS_Edge& E) const; Standard_Boolean HasSectionEdge(const TopoDS_Face& F) const; Standard_Boolean IsSplitOn(const TopoDS_Edge& NewE,const TopoDS_Edge& OldE,const TopoDS_Face& F) const; @@ -134,11 +134,11 @@ private: // Fields PRIVATE // - Handle_BRepAlgo_AsDes myAsDes; + Handle(BRepAlgo_AsDes) myAsDes; TopTools_DataMapOfShapeListOfShape myDone; TopTools_MapOfShape myTouched; TopTools_MapOfShape myNewEdges; - Handle_BRepAlgo_AsDes mySectionEdgesAD; + Handle(BRepAlgo_AsDes) mySectionEdgesAD; TopTools_DataMapOfShapeListOfShape mySameDomainFM; TopTools_DataMapOfShapeShape mySameDomainVM; diff --git a/libsrc/occ/Partition_Spliter.hxx b/libsrc/occ/Partition_Spliter.hxx index e75e9893..1cb6c571 100644 --- a/libsrc/occ/Partition_Spliter.hxx +++ b/libsrc/occ/Partition_Spliter.hxx @@ -143,7 +143,7 @@ private: TopTools_DataMapOfShapeShape myFaceShapeMap; TopTools_DataMapOfShapeShape myInternalFaces; TopTools_DataMapOfShapeShape myIntNotClFaces; - Handle_BRepAlgo_AsDes myAsDes; + Handle(BRepAlgo_AsDes) myAsDes; BRepAlgo_Image myImagesFaces; BRepAlgo_Image myImagesEdges; BRepAlgo_Image myImageShape; diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index d4633928..88384d6a 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -602,7 +602,7 @@ namespace netgen void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, - MeshingParameters & mparam) + const MeshingParameters & mparam) { static Timer t("OCCMeshSurface"); RegionTimer r(t); @@ -796,7 +796,6 @@ namespace netgen // Philippose - 15/01/2009 double maxh = geom.face_maxh[k-1]; //double maxh = mparam.maxh; - mparam.checkoverlap = 0; // int noldpoints = mesh->GetNP(); int noldsurfel = mesh.GetNSE(); @@ -809,9 +808,13 @@ namespace netgen MESHING2_RESULT res; + // TODO: check overlap not correctly working here + MeshingParameters mparam_without_overlap = mparam; + mparam_without_overlap.checkoverlap = false; + try { static Timer t("GenerateMesh"); RegionTimer reg(t); - res = meshing.GenerateMesh (mesh, mparam, maxh, k); + res = meshing.GenerateMesh (mesh, mparam_without_overlap, maxh, k); } catch (SingularMatrixException) @@ -916,7 +919,7 @@ namespace netgen } void OCCOptimizeSurface(OCCGeometry & geom, Mesh & mesh, - MeshingParameters & mparam) + const MeshingParameters & mparam) { const char * savetask = multithread.task; multithread.task = "Optimizing surface"; @@ -941,41 +944,41 @@ namespace netgen if (multithread.terminate) return; { - MeshOptimize2dOCCSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.EdgeSwapping (mesh, (i > mparam.optsteps2d/2)); + meshopt.EdgeSwapping (i > mparam.optsteps2d/2); } if (multithread.terminate) return; { - MeshOptimize2dOCCSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.ImproveMesh (mesh, mparam); + meshopt.ImproveMesh (mparam); } { - MeshOptimize2dOCCSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.CombineImprove (mesh); + meshopt.CombineImprove (); } if (multithread.terminate) return; { - MeshOptimize2dOCCSurfaces meshopt(geom); + MeshOptimize2d meshopt(mesh); meshopt.SetFaceIndex (k); meshopt.SetImproveEdges (0); meshopt.SetMetricWeight (mparam.elsizeweight); meshopt.SetWriteStatus (0); - meshopt.ImproveMesh (mesh, mparam); + meshopt.ImproveMesh (mparam); } } @@ -991,7 +994,7 @@ namespace netgen - void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh, + void OCCSetLocalMeshSize(const OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam, const OCCParameters& occparam) { static Timer t1("OCCSetLocalMeshSize"); @@ -1279,197 +1282,6 @@ namespace netgen mesh.LoadLocalMeshSize (mparam.meshsizefilename); } - - - - int OCCGenerateMesh (OCCGeometry & geom, shared_ptr & mesh, MeshingParameters & mparam, - const OCCParameters& occparam) - { - multithread.percent = 0; - - if (mparam.perfstepsstart <= MESHCONST_ANALYSE) - { - if(mesh.get() == nullptr) - mesh = make_shared(); - mesh->geomtype = Mesh::GEOM_OCC; - - OCCSetLocalMeshSize(geom,*mesh, mparam, occparam); - } - - if (multithread.terminate || mparam.perfstepsend <= MESHCONST_ANALYSE) - return TCL_OK; - - if (mparam.perfstepsstart <= MESHCONST_MESHEDGES) - { - OCCFindEdges (geom, *mesh, mparam); - - /* - cout << "Removing redundant points" << endl; - - int i, j; - int np = mesh->GetNP(); - NgArray equalto; - - equalto.SetSize (np); - equalto = 0; - - for (i = 1; i <= np; i++) - { - for (j = i+1; j <= np; j++) - { - if (!equalto[j-1] && (Dist2 (mesh->Point(i), mesh->Point(j)) < 1e-12)) - equalto[j-1] = i; - } - } - - for (i = 1; i <= np; i++) - if (equalto[i-1]) - { - cout << "Point " << i << " is equal to Point " << equalto[i-1] << endl; - for (j = 1; j <= mesh->GetNSeg(); j++) - { - Segment & seg = mesh->LineSegment(j); - if (seg[0] == i) seg[0] = equalto[i-1]; - if (seg[1] == i) seg[1] = equalto[i-1]; - } - } - - cout << "Removing degenerated segments" << endl; - for (j = 1; j <= mesh->GetNSeg(); j++) - { - Segment & seg = mesh->LineSegment(j); - if (seg[0] == seg[1]) - { - mesh->DeleteSegment(j); - cout << "Deleting Segment " << j << endl; - } - } - - mesh->Compress(); - */ - - /* - for (int i = 1; i <= geom.fmap.Extent(); i++) - { - Handle(Geom_Surface) hf1 = - BRep_Tool::Surface(TopoDS::Face(geom.fmap(i))); - for (int j = i+1; j <= geom.fmap.Extent(); j++) - { - Handle(Geom_Surface) hf2 = - BRep_Tool::Surface(TopoDS::Face(geom.fmap(j))); - if (hf1 == hf2) cout << "face " << i << " and face " << j << " lie on same surface" << endl; - } - } - */ - -#ifdef LOG_STREAM - (*logout) << "Edges meshed" << endl - << "time = " << GetTime() << " sec" << endl - << "points: " << mesh->GetNP() << endl; -#endif - } - - if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHEDGES) - return TCL_OK; - - if (mparam.perfstepsstart <= MESHCONST_MESHSURFACE) - { - OCCMeshSurface (geom, *mesh, mparam); - if (multithread.terminate) return TCL_OK; - -#ifdef LOG_STREAM - (*logout) << "Surfaces meshed" << endl - << "time = " << GetTime() << " sec" << endl - << "points: " << mesh->GetNP() << endl; -#endif - -#ifdef STAT_STREAM - (*statout) << mesh->GetNSeg() << " & " - << mesh->GetNSE() << " & - &" - << GetTime() << " & " << endl; -#endif - - // MeshQuality2d (*mesh); - mesh->CalcSurfacesOfNode(); - } - - if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHSURFACE) - return TCL_OK; - - if (mparam.perfstepsstart <= MESHCONST_OPTSURFACE) - { - OCCOptimizeSurface(geom, *mesh, mparam); - } - - if (multithread.terminate || mparam.perfstepsend <= MESHCONST_OPTSURFACE) - return TCL_OK; - - if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME) - { - multithread.task = "Volume meshing"; - - MESHING3_RESULT res = MeshVolume (mparam, *mesh); - - if (res != MESHING3_OK) return TCL_ERROR; - if (multithread.terminate) return TCL_OK; - - RemoveIllegalElements (*mesh); - if (multithread.terminate) return TCL_OK; - - MeshQuality3d (*mesh); - -#ifdef STAT_STREAM - (*statout) << GetTime() << " & "; -#endif - -#ifdef LOG_STREAM - (*logout) << "Volume meshed" << endl - << "time = " << GetTime() << " sec" << endl - << "points: " << mesh->GetNP() << endl; -#endif - } - - if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHVOLUME) - return TCL_OK; - - if (mparam.perfstepsstart <= MESHCONST_OPTVOLUME) - { - multithread.task = "Volume optimization"; - - OptimizeVolume (mparam, *mesh); - if (multithread.terminate) return TCL_OK; - -#ifdef STAT_STREAM - (*statout) << GetTime() << " & " - << mesh->GetNE() << " & " - << mesh->GetNP() << " " << '\\' << '\\' << " \\" << "hline" << endl; -#endif - -#ifdef LOG_STREAM - (*logout) << "Volume optimized" << endl - << "time = " << GetTime() << " sec" << endl - << "points: " << mesh->GetNP() << endl; -#endif - - // cout << "Optimization complete" << endl; - - } - - /* - (*testout) << "NP: " << mesh->GetNP() << endl; - for (int i = 1; i <= mesh->GetNP(); i++) - (*testout) << mesh->Point(i) << endl; - - (*testout) << endl << "NSegments: " << mesh->GetNSeg() << endl; - for (int i = 1; i <= mesh->GetNSeg(); i++) - (*testout) << mesh->LineSegment(i) << endl; - */ - - for (int i = 0; i < mesh->GetNDomains(); i++) - if (geom.snames.Size()) - mesh->SetMaterial (i+1, geom.snames[i]); - return TCL_OK; - } } #endif diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 0faf7f0a..fb8006f6 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -74,6 +74,30 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a } } + void OCCGeometry :: Analyse(Mesh& mesh, + const MeshingParameters& mparam) + { + OCCSetLocalMeshSize(*this, mesh, mparam, occparam); + } + + void OCCGeometry :: FindEdges(Mesh& mesh, + const MeshingParameters& mparam) + { + OCCFindEdges(*this, mesh, mparam); + } + + void OCCGeometry :: MeshSurface(Mesh& mesh, + const MeshingParameters& mparam) + { + OCCMeshSurface(*this, mesh, mparam); + } + + void OCCGeometry :: FinalizeMesh(Mesh& mesh) const + { + for (int i = 0; i < mesh.GetNDomains(); i++) + if (snames.Size()) + mesh.SetMaterial (i+1, snames[i]); + } void OCCGeometry :: PrintNrShapes () { @@ -1010,10 +1034,7 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a SetCenter(); } - - - - void OCCGeometry :: Project (int surfi, Point<3> & p) const + void OCCGeometry :: ProjectPoint(int surfi, Point<3> & p) const { static int cnt = 0; if (++cnt % 1000 == 0) cout << "Project cnt = " << cnt << endl; @@ -1032,8 +1053,47 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a } + bool OCCGeometry :: ProjectPointGI(int surfind, Point<3>& p, PointGeomInfo& gi) const + { + double u = gi.u; + double v = gi.v; + Point<3> hp = p; + if (FastProject (surfind, hp, u, v)) + { + p = hp; + return 1; + } + ProjectPoint (surfind, p); + return CalcPointGeomInfo (surfind, gi, p); + } + void OCCGeometry :: ProjectPointEdge(int surfind, INDEX surfind2, + Point<3> & p) const + { + TopExp_Explorer exp0, exp1; + bool done = false; + Handle(Geom_Curve) c; + + for (exp0.Init(fmap(surfind), TopAbs_EDGE); !done && exp0.More(); exp0.Next()) + for (exp1.Init(fmap(surfind2), TopAbs_EDGE); !done && exp1.More(); exp1.Next()) + { + if (TopoDS::Edge(exp0.Current()).IsSame(TopoDS::Edge(exp1.Current()))) + { + done = true; + double s0, s1; + c = BRep_Tool::Curve(TopoDS::Edge(exp0.Current()), s0, s1); + } + } + + gp_Pnt pnt(p(0), p(1), p(2)); + GeomAPI_ProjectPointOnCurve proj(pnt, c); + pnt = proj.NearestPoint(); + p(0) = pnt.X(); + p(1) = pnt.Y(); + p(2) = pnt.Z(); + + } bool OCCGeometry :: FastProject (int surfi, Point<3> & ap, double& u, double& v) const { @@ -1091,7 +1151,148 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a return true; } + Vec<3> OCCGeometry :: GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & geominfo) const + { + gp_Pnt pnt; + gp_Vec du, dv; + Handle(Geom_Surface) occface; + occface = BRep_Tool::Surface(TopoDS::Face(fmap(surfind))); + + occface->D1(geominfo.u,geominfo.v,pnt,du,dv); + + auto n = Cross (Vec<3>(du.X(), du.Y(), du.Z()), + Vec<3>(dv.X(), dv.Y(), dv.Z())); + n.Normalize(); + + if (fmap(surfind).Orientation() == TopAbs_REVERSED) n *= -1; + return n; + } + + Vec<3> OCCGeometry :: GetNormal(int surfind, const Point<3> & p) const + { + Standard_Real u,v; + + gp_Pnt pnt(p(0), p(1), p(2)); + + Handle(Geom_Surface) occface; + occface = BRep_Tool::Surface(TopoDS::Face(fmap(surfind))); + + /* + GeomAPI_ProjectPointOnSurf proj(pnt, occface); + + if (proj.NbPoints() < 1) + { + cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!" + << endl; + cout << p << endl; + return; + } + + proj.LowerDistanceParameters (u, v); + */ + + Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( occface ); + gp_Pnt2d suval = su->ValueOfUV ( pnt, BRep_Tool::Tolerance( TopoDS::Face(fmap(surfind)) ) ); + suval.Coord( u, v); + pnt = occface->Value( u, v ); + + gp_Vec du, dv; + occface->D1(u,v,pnt,du,dv); + + /* + if (!occface->IsCNu (1) || !occface->IsCNv (1)) + (*testout) << "SurfOpt: Differentiation FAIL" << endl; + */ + + auto n = Cross (Vec3d(du.X(), du.Y(), du.Z()), + Vec3d(dv.X(), dv.Y(), dv.Z())); + n.Normalize(); + + if (fmap(surfind).Orientation() == TopAbs_REVERSED) n *= -1; + return n; + } + + bool OCCGeometry :: CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p) const + { + Standard_Real u,v; + + gp_Pnt pnt(p(0), p(1), p(2)); + + Handle(Geom_Surface) occface; + occface = BRep_Tool::Surface(TopoDS::Face(fmap(surfind))); + + /* + GeomAPI_ProjectPointOnSurf proj(pnt, occface); + + if (proj.NbPoints() < 1) + { + cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!" + << endl; + cout << p << endl; + return 0; + } + + proj.LowerDistanceParameters (u, v); + */ + + Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( occface ); + gp_Pnt2d suval = su->ValueOfUV ( pnt, BRep_Tool::Tolerance( TopoDS::Face(fmap(surfind)) ) ); + suval.Coord( u, v); + //pnt = occface->Value( u, v ); + + + gi.u = u; + gi.v = v; + return true; + } + + void OCCGeometry :: PointBetween(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const + { + Point<3> hnewp; + hnewp = p1+secpoint*(p2-p1); + + if (surfi > 0) + { + double u = gi1.u+secpoint*(gi2.u-gi1.u); + double v = gi1.v+secpoint*(gi2.v-gi1.v); + + auto savept = hnewp; + if (!FastProject(surfi, hnewp, u, v) || Dist(hnewp, savept) > Dist(p1,p2)) + { + // cout << "Fast projection to surface fails! Using OCC projection" << endl; + hnewp = savept; + ProjectPoint(surfi, hnewp); + } + newgi.trignum = 1; + newgi.u = u; + newgi.v = v; + } + newp = hnewp; + } + + + void OCCGeometry :: PointBetweenEdge(const Point<3> & p1, + const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const + { + double s0, s1; + + Point<3> hnewp = p1+secpoint*(p2-p1); + gp_Pnt pnt(hnewp(0), hnewp(1), hnewp(2)); + GeomAPI_ProjectPointOnCurve proj(pnt, BRep_Tool::Curve(TopoDS::Edge(emap(ap1.edgenr)), s0, s1)); + pnt = proj.NearestPoint(); + hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z()); + newp = hnewp; + newgi = ap1; + }; // void OCCGeometry :: WriteOCC_STL(char * filename) @@ -1681,17 +1882,7 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a return false; } - - - - - - const Refinement & OCCGeometry :: GetRefinement () const - { - return * new OCCRefinementSurfaces (*this); - } - - void OCCParameters :: Print(ostream & ost) const + void OCCParameters :: Print(ostream & ost) const { ost << "OCC Parameters:" << endl << "close edges: " << resthcloseedgeenable @@ -1703,10 +1894,10 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a DLL_HEADER extern OCCParameters occparam; OCCParameters occparam; - int OCCGeometry :: GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) - { - return OCCGenerateMesh (*this, mesh, mparam, occparam); - } + // int OCCGeometry :: GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) + // { + // return OCCGenerateMesh (*this, mesh, mparam, occparam); + // } } diff --git a/libsrc/occ/occgeom.hpp b/libsrc/occ/occgeom.hpp index 750c6e29..45f06026 100644 --- a/libsrc/occ/occgeom.hpp +++ b/libsrc/occ/occgeom.hpp @@ -183,12 +183,33 @@ namespace netgen return a00*a11*a22 + a01*a12*a20 + a10*a21*a02 - a20*a11*a02 - a10*a01*a22 - a21*a12*a00; } + class DLL_HEADER OCCParameters + { + public: + /// Factor for meshing close edges + double resthcloseedgefac = 2.; + /// Enable / Disable detection of close edges + int resthcloseedgeenable = true; + + /// Minimum edge length to be used for dividing edges to mesh points + double resthminedgelen = 0.001; + + /// Enable / Disable use of the minimum edge length (by default use 1e-4) + int resthminedgelenenable = true; + + /*! + Dump all the OpenCascade specific meshing parameters + to console + */ + void Print (ostream & ost) const; + }; class OCCGeometry : public NetgenGeometry { Point<3> center; + OCCParameters occparam; public: TopoDS_Shape shape; @@ -239,12 +260,44 @@ namespace netgen emap.Clear(); vmap.Clear(); } + + Mesh::GEOM_TYPE GetGeomType() const override + { return Mesh::GEOM_OCC; } + + void SetOCCParameters(const OCCParameters& par) + { occparam = par; } + + void Analyse(Mesh& mesh, + const MeshingParameters& mparam) override; + void FindEdges(Mesh& mesh, + const MeshingParameters& mparam) override; + void MeshSurface(Mesh& mesh, + const MeshingParameters& mparam) override; + + void FinalizeMesh(Mesh& mesh) const override; + DLL_HEADER void Save (string filename) const override; - DLL_HEADER virtual void Save (string filename) const; - - void DoArchive(Archive& ar); - + void DoArchive(Archive& ar) override; + + void ProjectPoint(int surfind, Point<3> & p) const override; + void ProjectPointEdge (int surfind, int surfind2, Point<3> & p) const override; + bool ProjectPointGI (int surfind, Point<3> & p, PointGeomInfo & gi) const override; + Vec<3> GetNormal(int surfind, const Point<3> & p) const override; + Vec<3> GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & gi) const override; + bool CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p3) const override; + + void PointBetweenEdge(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const override; + void PointBetween(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const override; + DLL_HEADER void BuildFMap(); Box<3> GetBoundingBox() const @@ -264,9 +317,6 @@ namespace netgen Point<3> Center() const { return center; } - void Project (int surfi, Point<3> & p) const; - bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const; - OCCSurface GetSurface (int surfi) { cout << "OCCGeometry::GetSurface using PLANESPACE" << endl; @@ -391,37 +441,9 @@ namespace netgen // void WriteOCC_STL(char * filename); - DLL_HEADER virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); - - DLL_HEADER virtual const Refinement & GetRefinement () const; - }; - - - - class DLL_HEADER OCCParameters - { - public: - - /// Factor for meshing close edges - double resthcloseedgefac = 2.; - - - /// Enable / Disable detection of close edges - int resthcloseedgeenable = true; - - - /// Minimum edge length to be used for dividing edges to mesh points - double resthminedgelen = 0.001; - - - /// Enable / Disable use of the minimum edge length (by default use 1e-4) - int resthminedgelenenable = true; - - /*! - Dump all the OpenCascade specific meshing parameters - to console - */ - void Print (ostream & ost) const; + // DLL_HEADER virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); + private: + bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const; }; @@ -434,15 +456,12 @@ namespace netgen // Philippose - 31.09.2009 // External access to the mesh generation functions within the OCC // subsystem (Not sure if this is the best way to implement this....!!) - DLL_HEADER extern int OCCGenerateMesh (OCCGeometry & occgeometry, shared_ptr & mesh, - MeshingParameters & mparam, const OCCParameters& occparam); - - DLL_HEADER extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam, + DLL_HEADER extern void OCCSetLocalMeshSize(const OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam, const OCCParameters& occparam); - DLL_HEADER extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, MeshingParameters & mparam); + DLL_HEADER extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam); - DLL_HEADER extern void OCCOptimizeSurface (OCCGeometry & geom, Mesh & mesh, MeshingParameters & mparam); + DLL_HEADER extern void OCCOptimizeSurface (OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam); DLL_HEADER extern void OCCFindEdges (OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam); } diff --git a/libsrc/occ/occmeshsurf.cpp b/libsrc/occ/occmeshsurf.cpp index ed6daab9..847907b1 100644 --- a/libsrc/occ/occmeshsurf.cpp +++ b/libsrc/occ/occmeshsurf.cpp @@ -532,188 +532,6 @@ namespace netgen return gh; } - - - - - - MeshOptimize2dOCCSurfaces :: MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry) - : MeshOptimize2d(), geometry(ageometry) - { - ; - } - - - void MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point<3> & p) const - { - geometry.Project (surfind, p); - } - - - int MeshOptimize2dOCCSurfaces :: ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const - { - double u = gi.u; - double v = gi.v; - - Point<3> hp = p; - if (geometry.FastProject (surfind, hp, u, v)) - { - p = hp; - return 1; - } - ProjectPoint (surfind, p); - return CalcPointGeomInfo (surfind, gi, p); - } - - - void MeshOptimize2dOCCSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, - Point<3> & p) const - { - TopExp_Explorer exp0, exp1; - bool done = false; - Handle(Geom_Curve) c; - - for (exp0.Init(geometry.fmap(surfind), TopAbs_EDGE); !done && exp0.More(); exp0.Next()) - for (exp1.Init(geometry.fmap(surfind2), TopAbs_EDGE); !done && exp1.More(); exp1.Next()) - { - if (TopoDS::Edge(exp0.Current()).IsSame(TopoDS::Edge(exp1.Current()))) - { - done = true; - double s0, s1; - c = BRep_Tool::Curve(TopoDS::Edge(exp0.Current()), s0, s1); - } - } - - gp_Pnt pnt(p(0), p(1), p(2)); - GeomAPI_ProjectPointOnCurve proj(pnt, c); - pnt = proj.NearestPoint(); - p(0) = pnt.X(); - p(1) = pnt.Y(); - p(2) = pnt.Z(); - - } - - void MeshOptimize2dOCCSurfaces :: - GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & geominfo, Vec<3> & n) const - { - gp_Pnt pnt; - gp_Vec du, dv; - - Handle(Geom_Surface) occface; - occface = BRep_Tool::Surface(TopoDS::Face(geometry.fmap(surfind))); - - occface->D1(geominfo.u,geominfo.v,pnt,du,dv); - - n = Cross (Vec<3>(du.X(), du.Y(), du.Z()), - Vec<3>(dv.X(), dv.Y(), dv.Z())); - n.Normalize(); - - if (geometry.fmap(surfind).Orientation() == TopAbs_REVERSED) n = -1*n; - - // GetNormalVector (surfind, p, n); - } - - - void MeshOptimize2dOCCSurfaces :: - GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const - { - // static int cnt = 0; - // if (cnt++ % 1000 == 0) cout << "GetNV cnt = " << cnt << endl; - Standard_Real u,v; - - gp_Pnt pnt(p(0), p(1), p(2)); - - Handle(Geom_Surface) occface; - occface = BRep_Tool::Surface(TopoDS::Face(geometry.fmap(surfind))); - - /* - GeomAPI_ProjectPointOnSurf proj(pnt, occface); - - if (proj.NbPoints() < 1) - { - cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!" - << endl; - cout << p << endl; - return; - } - - proj.LowerDistanceParameters (u, v); - */ - - Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( occface ); - gp_Pnt2d suval = su->ValueOfUV ( pnt, BRep_Tool::Tolerance( TopoDS::Face(geometry.fmap(surfind)) ) ); - suval.Coord( u, v); - pnt = occface->Value( u, v ); - - - - gp_Vec du, dv; - occface->D1(u,v,pnt,du,dv); - - /* - if (!occface->IsCNu (1) || !occface->IsCNv (1)) - (*testout) << "SurfOpt: Differentiation FAIL" << endl; - */ - - n = Cross (Vec3d(du.X(), du.Y(), du.Z()), - Vec3d(dv.X(), dv.Y(), dv.Z())); - n.Normalize(); - - if (geometry.fmap(surfind).Orientation() == TopAbs_REVERSED) n = -1*n; - } - - - int MeshOptimize2dOCCSurfaces :: - CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p) const - { - Standard_Real u,v; - - gp_Pnt pnt(p(0), p(1), p(2)); - - Handle(Geom_Surface) occface; - occface = BRep_Tool::Surface(TopoDS::Face(geometry.fmap(surfind))); - - /* - GeomAPI_ProjectPointOnSurf proj(pnt, occface); - - if (proj.NbPoints() < 1) - { - cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!" - << endl; - cout << p << endl; - return 0; - } - - proj.LowerDistanceParameters (u, v); - */ - - Handle( ShapeAnalysis_Surface ) su = new ShapeAnalysis_Surface( occface ); - gp_Pnt2d suval = su->ValueOfUV ( pnt, BRep_Tool::Tolerance( TopoDS::Face(geometry.fmap(surfind)) ) ); - suval.Coord( u, v); - //pnt = occface->Value( u, v ); - - - gi.u = u; - gi.v = v; - return 1; - } - - - - - - - OCCRefinementSurfaces :: OCCRefinementSurfaces (const OCCGeometry & ageometry) - : Refinement(), geometry(ageometry) - { - ; - } - - OCCRefinementSurfaces :: ~OCCRefinementSurfaces () - { - ; - } - /* inline double Det3 (double a00, double a01, double a02, double a10, double a11, double a12, @@ -772,76 +590,6 @@ namespace netgen return true; } */ - - void OCCRefinementSurfaces :: - PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const - { - Point<3> hnewp; - hnewp = p1+secpoint*(p2-p1); - - if (surfi > 0) - { - double u = gi1.u+secpoint*(gi2.u-gi1.u); - double v = gi1.v+secpoint*(gi2.v-gi1.v); - - auto savept = hnewp; - if (!geometry.FastProject (surfi, hnewp, u, v) || Dist(hnewp, savept) > Dist(p1,p2)) - { - // cout << "Fast projection to surface fails! Using OCC projection" << endl; - hnewp = savept; - geometry.Project (surfi, hnewp); - } - - newgi.trignum = 1; - newgi.u = u; - newgi.v = v; - } - - newp = hnewp; - } - - - void OCCRefinementSurfaces :: - PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const - { - double s0, s1; - - Point<3> hnewp = p1+secpoint*(p2-p1); - gp_Pnt pnt(hnewp(0), hnewp(1), hnewp(2)); - GeomAPI_ProjectPointOnCurve proj(pnt, BRep_Tool::Curve(TopoDS::Edge(geometry.emap(ap1.edgenr)), s0, s1)); - pnt = proj.NearestPoint(); - hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z()); - newp = hnewp; - newgi = ap1; - }; - - - void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi) const - { - if (surfi > 0) - geometry.Project (surfi, p); - }; - - void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const - { - if (surfi > 0) - if (!geometry.FastProject (surfi, p, gi.u, gi.v)) - { - cout << "Fast projection to surface fails! Using OCC projection" << endl; - geometry.Project (surfi, p); - } - }; - - - } diff --git a/libsrc/occ/occmeshsurf.hpp b/libsrc/occ/occmeshsurf.hpp index d88657df..3a74b170 100644 --- a/libsrc/occ/occmeshsurf.hpp +++ b/libsrc/occ/occmeshsurf.hpp @@ -141,64 +141,8 @@ protected: }; - - -/// -class MeshOptimize2dOCCSurfaces : public MeshOptimize2d - { - /// - const OCCGeometry & geometry; - -public: - /// - MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry); - - /// - virtual void ProjectPoint (INDEX surfind, Point<3> & p) const; - /// - virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const; - /// - virtual int ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const; - /// - virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const; - /// - virtual void GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const; - - virtual int CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p3) const; -}; - - - class OCCGeometry; - -class DLL_HEADER OCCRefinementSurfaces : public Refinement -{ - const OCCGeometry & geometry; - -public: - OCCRefinementSurfaces (const OCCGeometry & ageometry); - virtual ~OCCRefinementSurfaces (); - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const override; - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const override; - - virtual void ProjectToSurface (Point<3> & p, int surfi) const override; - - virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const override; -}; - - - #endif diff --git a/libsrc/occ/occpkg.cpp b/libsrc/occ/occpkg.cpp index de9367d7..7ebc13d3 100644 --- a/libsrc/occ/occpkg.cpp +++ b/libsrc/occ/occpkg.cpp @@ -53,6 +53,8 @@ namespace netgen atof (Tcl_GetVar (interp, "::stloptions.resthminedgelen", 0)); occparam.resthminedgelenenable = atoi (Tcl_GetVar (interp, "::stloptions.resthminedgelenenable", 0)); + if(auto geo = dynamic_pointer_cast(ng_geometry); geo) + geo->SetOCCParameters(occparam); } }; diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index 6a847e14..d3a38c15 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -183,11 +183,12 @@ DLL_HEADER void ExportNgOCC(py::module &m) CreateOCCParametersFromKwargs(occparam, kwargs); CreateMPfromKwargs(mp, kwargs); } + geo->SetOCCParameters(occparam); auto mesh = make_shared(); - SetGlobalMesh(mesh); + geo->GenerateMesh(mesh, mp); mesh->SetGeometry(geo); + SetGlobalMesh(mesh); ng_geometry = geo; - OCCGenerateMesh(*geo, mesh, mp, occparam); return mesh; }, py::arg("mp") = nullptr, py::call_guard(), diff --git a/libsrc/stlgeom/meshstlsurface.cpp b/libsrc/stlgeom/meshstlsurface.cpp index 6333ea26..9259aba6 100644 --- a/libsrc/stlgeom/meshstlsurface.cpp +++ b/libsrc/stlgeom/meshstlsurface.cpp @@ -299,14 +299,14 @@ int STLSurfaceMeshing (STLGeometry & geom, class Mesh & mesh, const MeshingParam geom.SetMarkedTrig(seg.geominfo[1].trignum,1); } - MeshOptimizeSTLSurface optmesh(geom); + MeshOptimize2d optmesh(mesh); optmesh.SetFaceIndex (0); optmesh.SetImproveEdges (0); optmesh.SetMetricWeight (0); mesh.CalcSurfacesOfNode(); - optmesh.EdgeSwapping (mesh, 0); - optmesh.ImproveMesh (mesh, mparam); + optmesh.EdgeSwapping (0); + optmesh.ImproveMesh (mparam); } mesh.Compress(); @@ -826,7 +826,7 @@ void STLSurfaceOptimization (STLGeometry & geom, { PrintFnStart("optimize STL Surface"); - MeshOptimizeSTLSurface optmesh(geom); + MeshOptimize2d optmesh(mesh); optmesh.SetFaceIndex (0); optmesh.SetImproveEdges (0); @@ -847,25 +847,41 @@ void STLSurfaceOptimization (STLGeometry & geom, { case 's': { - optmesh.EdgeSwapping (mesh, 0); + optmesh.EdgeSwapping(0); break; } case 'S': { - optmesh.EdgeSwapping (mesh, 1); + optmesh.EdgeSwapping(1); break; } case 'm': { - optmesh.ImproveMesh(mesh, mparam); + optmesh.ImproveMesh(mparam); break; } case 'c': { - optmesh.CombineImprove (mesh); + optmesh.CombineImprove(); break; } } + // while(mesh.CheckOverlappingBoundary()) + // { + // for(const auto & el : mesh.SurfaceElements()) + // { + // if(el.BadElement()) + // { + // cout << "Restrict localh at el nr " << el << endl; + // for(const auto& p : el.PNums()) + // { + // const auto& pnt = mesh[p]; + // mesh.RestrictLocalH(pnt, 0.5*mesh.GetH(pnt)); + // } + // } + // } + // optmesh.SplitImprove(); + // } //(*testout) << "optimize, after, step = " << meshparam.optimize2d[j-1] << mesh.Point (3679) << endl; } @@ -1051,208 +1067,4 @@ double MeshingSTLSurface :: Area () const return geom.Area(); } - - - - - -MeshOptimizeSTLSurface :: MeshOptimizeSTLSurface (STLGeometry & ageom) - : MeshOptimize2d(), geom(ageom) -{ - ; -} - - - -void MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point<3> & p) const -{ - if (!geom.Project (p)) - { - PrintMessage(7,"project failed"); - - if (!geom.ProjectOnWholeSurface(p)) - { - PrintMessage(7, "project on whole surface failed"); - } - } - - // geometry.GetSurface(surfind)->Project (p); -} - -int MeshOptimizeSTLSurface :: ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const -{ - int meshchart = geom.GetChartNr(gi.trignum); - const STLChart& chart = geom.GetChart(meshchart); - int trignum = chart.ProjectNormal(p); - if(trignum==0) - { - PrintMessage(7,"project failed"); - geom.SelectChartOfTriangle (gi.trignum); // needed because ProjectOnWholeSurface uses meshchartnv (the normal vector of selected chart) - trignum = geom.ProjectOnWholeSurface(p); - if(trignum==0) - PrintMessage(7, "project on whole surface failed"); - } - return trignum; -} - -void MeshOptimizeSTLSurface :: ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const -{ - /* - ProjectToEdge ( geometry.GetSurface(surfind), - geometry.GetSurface(surfind2), p); - */ -} - -int MeshOptimizeSTLSurface :: CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & p3) const -{ - Point<3> hp = p3; - gi.trignum = geom.Project (hp); - - if (gi.trignum) return 1; - - return 0; - -} - -void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const -{ - n = geom.GetTriangle(gi.trignum).Normal(); -} - - -void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const -{ - throw Exception("MeshOptimizeSTLSurface :: GetNormalVector called without PointGeomInfo"); -} - - - - - - - - - - -RefinementSTLGeometry :: RefinementSTLGeometry (const STLGeometry & ageom) - : Refinement(), geom(ageom) -{ - ; -} - -RefinementSTLGeometry :: ~RefinementSTLGeometry () -{ - ; -} - -void RefinementSTLGeometry :: -PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const -{ - newp = p1+secpoint*(p2-p1); - - /* - (*testout) << "surf-between: p1 = " << p1 << ", p2 = " << p2 - << ", gi = " << gi1 << " - " << gi2 << endl; - */ - - if (gi1.trignum > 0) - { - // ((STLGeometry&)geom).SelectChartOfTriangle (gi1.trignum); - - Point<3> np1 = newp; - Point<3> np2 = newp; - ((STLGeometry&)geom).SelectChartOfTriangle (gi1.trignum); - int tn1 = geom.Project (np1); - - ((STLGeometry&)geom).SelectChartOfTriangle (gi2.trignum); - int tn2 = geom.Project (np2); - - newgi.trignum = tn1; //urspruengliche version - newp = np1; //urspruengliche version - - if (!newgi.trignum) - { newgi.trignum = tn2; newp = np2; } - if (!newgi.trignum) newgi.trignum = gi1.trignum; - - /* - if (tn1 != 0 && tn2 != 0 && ((STLGeometry&)geom).GetAngle(tn1,tn2) < M_PI*0.05) { - newgi.trignum = tn1; - newp = np1; - } - else - { - newp = ((STLGeometry&)geom).PointBetween(p1, gi1.trignum, p2, gi2.trignum); - tn1 = ((STLGeometry&)geom).Project(newp); - newgi.trignum = tn1; - - if (!tn1) - { - newp = Center (p1, p2); - newgi.trignum = 0; - - } - } - */ - } - else - { - // (*testout) << "WARNING: PointBetween got geominfo = 0" << endl; - newp = p1+secpoint*(p2-p1); - newgi.trignum = 0; - } - - // (*testout) << "newp = " << newp << ", ngi = " << newgi << endl; -} - -void RefinementSTLGeometry :: -PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & gi1, - const EdgePointGeomInfo & gi2, - Point<3> & newp, EdgePointGeomInfo & newgi) const -{ - /* - (*testout) << "edge-between: p1 = " << p1 << ", p2 = " << p2 - << ", gi1,2 = " << gi1 << ", " << gi2 << endl; - */ - /* - newp = Center (p1, p2); - ((STLGeometry&)geom).SelectChartOfTriangle (gi1.trignum); - newgi.trignum = geom.Project (newp); - */ - int hi; - newgi.dist = (1.0-secpoint) * gi1.dist + secpoint*gi2.dist; - newgi.edgenr = gi1.edgenr; - - /* - (*testout) << "p1 = " << p1 << ", p2 = " << p2 << endl; - (*testout) << "refedge: " << gi1.edgenr - << " d1 = " << gi1.dist << ", d2 = " << gi2.dist << endl; - */ - newp = geom.GetLine (gi1.edgenr)->GetPointInDist (geom.GetPoints(), newgi.dist, hi); - - // (*testout) << "newp = " << newp << endl; -} - - -void RefinementSTLGeometry :: ProjectToSurface (Point<3> & p, int surfi) const -{ - cout << "RefinementSTLGeometry :: ProjectToSurface not implemented!" << endl; -}; - - -void RefinementSTLGeometry :: ProjectToSurface (Point<3> & p, int surfi, - PointGeomInfo & gi) const -{ - ((STLGeometry&)geom).SelectChartOfTriangle (gi.trignum); - gi.trignum = geom.Project (p); - // if (!gi.trignum) - // cout << "projectSTL failed" << endl; -}; - - } diff --git a/libsrc/stlgeom/meshstlsurface.hpp b/libsrc/stlgeom/meshstlsurface.hpp index 1f1ad27b..aad08708 100644 --- a/libsrc/stlgeom/meshstlsurface.hpp +++ b/libsrc/stlgeom/meshstlsurface.hpp @@ -63,59 +63,5 @@ protected: double Area () const override; }; - - -/// -class MeshOptimizeSTLSurface : public MeshOptimize2d - { - /// - STLGeometry & geom; - -public: - /// - MeshOptimizeSTLSurface (STLGeometry & ageom); - - /// - void ProjectPoint (INDEX surfind, Point<3> & p) const override; - /// - int ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const override; - /// - void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const override; - /// - int CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & p3) const override; - /// - void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const override; - void GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const override; -}; - - - - -class RefinementSTLGeometry : public Refinement -{ - const STLGeometry & geom; - -public: - RefinementSTLGeometry (const STLGeometry & ageom); - virtual ~RefinementSTLGeometry (); - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi, - const PointGeomInfo & gi1, - const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const override; - - virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, - int surfi1, int surfi2, - const EdgePointGeomInfo & ap1, - const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const override; - - virtual void ProjectToSurface (Point<3> & p, int surfi) const override; - virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const override; -}; - - - #endif diff --git a/libsrc/stlgeom/stlgeom.cpp b/libsrc/stlgeom/stlgeom.cpp index b34f38c5..7d254162 100644 --- a/libsrc/stlgeom/stlgeom.cpp +++ b/libsrc/stlgeom/stlgeom.cpp @@ -44,7 +44,6 @@ void STLMeshing (STLGeometry & geom, lineendpoints(), spiralpoints(), selectedmultiedge() */ { - ref = NULL; edgedata = make_unique(*this); externaledges.SetSize(0); Clear(); @@ -66,7 +65,6 @@ STLGeometry :: ~STLGeometry() { // for (auto p : atlas) delete p; // delete edgedata; - delete ref; } void STLGeometry :: Save (string filename) const @@ -102,17 +100,127 @@ int STLGeometry :: GenerateMesh (shared_ptr & mesh, MeshingParameters & mp return STLMeshingDummy (this, mesh, mparam, stlpar); } - -const Refinement & STLGeometry :: GetRefinement () const +Vec<3> STLGeometry :: GetNormal(INDEX surfind, const Point<3> & p) const { - delete ref; - ref = new RefinementSTLGeometry(*this); - // ref -> Set2dOptimizer(new MeshOptimizeSTLSurface(*this)); ??? copied from CSG - return *ref; - + throw Exception("STLGeometry::GetNormal without PointGeomInfo called"); } +Vec<3> STLGeometry :: GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & gi) const +{ + return GetChart(GetChartNr(gi.trignum)).GetNormal(); +} +bool STLGeometry :: CalcPointGeomInfo(int /*surfind*/, PointGeomInfo& gi, const Point<3> & p3) const +{ + Point<3> hp = p3; + SelectChartOfTriangle(gi.trignum); + + gi.trignum = Project (hp); + + if (gi.trignum) return true; + + return false; +} + +bool STLGeometry :: ProjectPointGI (int surfind, Point<3> & p, PointGeomInfo & gi) const +{ + static std::mutex mutex_project_whole_surface; + int meshchart = GetChartNr(gi.trignum); + const STLChart& chart = GetChart(meshchart); + int trignum = chart.ProjectNormal(p); + if(trignum==0) + { + // non-thread-safe implementation + std::lock_guard guard(mutex_project_whole_surface); + PrintMessage(7,"project failed"); + SelectChartOfTriangle (gi.trignum); // needed because ProjectOnWholeSurface uses meshchartnv (the normal vector of selected chart) + trignum = ProjectOnWholeSurface(p); + if(trignum==0) + { + PrintMessage(7, "project on whole surface failed"); + return false; + } + } + return true; +} + +void STLGeometry :: ProjectPoint (INDEX surfind, Point<3> & p) const +{ + throw Exception("ProjectPoint without PointGeomInfo not implemented"); +} + +void STLGeometry :: +PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const +{ + newp = p1+secpoint*(p2-p1); + + /* + (*testout) << "surf-between: p1 = " << p1 << ", p2 = " << p2 + << ", gi = " << gi1 << " - " << gi2 << endl; + */ + + if (gi1.trignum > 0) + { + // ((STLGeometry&)geom).SelectChartOfTriangle (gi1.trignum); + + Point<3> np1 = newp; + Point<3> np2 = newp; + auto ngi1 = gi1; + auto ngi2 = gi2; + // SelectChartOfTriangle (gi1.trignum); + int tn1 = ProjectPointGI (surfi, np1, ngi1); + + // SelectChartOfTriangle (gi2.trignum); + int tn2 = ProjectPointGI (surfi, np2, ngi2); + + newgi.trignum = tn1; //urspruengliche version + newp = np1; //urspruengliche version + + if (!newgi.trignum) + { newgi.trignum = tn2; newp = np2; } + if (!newgi.trignum) newgi.trignum = gi1.trignum; + } + else + { + // (*testout) << "WARNING: PointBetween got geominfo = 0" << endl; + newp = p1+secpoint*(p2-p1); + newgi.trignum = 0; + } +} + +void STLGeometry :: +PointBetweenEdge (const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & gi1, + const EdgePointGeomInfo & gi2, + Point<3> & newp, EdgePointGeomInfo & newgi) const +{ + /* + (*testout) << "edge-between: p1 = " << p1 << ", p2 = " << p2 + << ", gi1,2 = " << gi1 << ", " << gi2 << endl; + */ + /* + newp = Center (p1, p2); + ((STLGeometry&)geom).SelectChartOfTriangle (gi1.trignum); + newgi.trignum = geom.Project (newp); + */ + int hi; + newgi.dist = (1.0-secpoint) * gi1.dist + secpoint*gi2.dist; + newgi.edgenr = gi1.edgenr; + + /* + (*testout) << "p1 = " << p1 << ", p2 = " << p2 << endl; + (*testout) << "refedge: " << gi1.edgenr + << " d1 = " << gi1.dist << ", d2 = " << gi2.dist << endl; + */ + newp = GetLine (gi1.edgenr)->GetPointInDist (GetPoints(), newgi.dist, hi); + + // (*testout) << "newp = " << newp << endl; +} void STLGeometry :: STLInfo(double* data) { diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 3d6ddb22..e29e4824 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -148,7 +148,7 @@ namespace netgen //for meshing and project: NgArray meshcharttrigs; //per trig: 1=belong to chart, 0 not - int meshchart; + mutable int meshchart; NgArray ha_points; // help array, np long, filled with 0 @@ -159,12 +159,10 @@ namespace netgen //transformation: - Vec<3> meshtrignv; + mutable Vec<3> meshtrignv; Vec<3> ex, ey, ez; Point<3> p1; - mutable class RefinementSTLGeometry * ref; - public: int edgesfound; int surfacemeshed; @@ -194,6 +192,24 @@ namespace netgen virtual void Save (string filename) const override; + bool CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point<3> & p3) const override; + void ProjectPoint(INDEX surfind, Point<3> & p) const override; + bool ProjectPointGI (int surfind, Point<3> & p, PointGeomInfo & gi) const override; + Vec<3> GetNormal(int surfind, const Point<3> & p) const override; + Vec<3> GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & gi) const override; + void PointBetween(const Point<3> & p1, const Point<3> & p2, + double secpoint, int surfi, + const PointGeomInfo & gi1, + const PointGeomInfo & gi2, + Point<3> & newp, PointGeomInfo & newgi) const override; + + void PointBetweenEdge(const Point<3> & p1, const Point<3> & p2, double secpoint, + int surfi1, int surfi2, + const EdgePointGeomInfo & ap1, + const EdgePointGeomInfo & ap2, + Point<3> & newp, EdgePointGeomInfo & newgi) const override; + + DLL_HEADER void STLInfo(double* data); //stldoctor: @@ -419,7 +435,7 @@ namespace netgen // void DefineTangentialPlane(const Point<3> & ap1, const Point<3> & ap2, int trig); // - void SelectChartOfTriangle (int trignum); + void SelectChartOfTriangle (int trignum) const; // void SelectChartOfPoint (const Point<3> & p); // @@ -459,8 +475,6 @@ namespace netgen int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam) override; - virtual const Refinement & GetRefinement () const override; - // Add additional Point to chart to close the surface and write the resulting stl to a file DLL_HEADER void WriteChartToFile( ChartId chartnumber, string filename="chart.slb" ); }; diff --git a/libsrc/stlgeom/stlgeommesh.cpp b/libsrc/stlgeom/stlgeommesh.cpp index ca1552e2..a5d32c9e 100644 --- a/libsrc/stlgeom/stlgeommesh.cpp +++ b/libsrc/stlgeom/stlgeommesh.cpp @@ -392,7 +392,7 @@ void STLGeometry :: DefineTangentialPlane (const Point<3> & ap1, const Point<3> } -void STLGeometry :: SelectChartOfTriangle (int trignum) +void STLGeometry :: SelectChartOfTriangle (int trignum) const { meshchart = GetChartNr(trignum); meshtrignv = GetTriangle(trignum).Normal(); diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index 5c0b8638..85052353 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -537,6 +537,7 @@ namespace netgen // delete ng_geometry; // ng_geometry = hgeom; ng_geometry = shared_ptr (hgeom); + geometryregister[i]->SetParameters(interp); mesh.reset(); return TCL_OK; diff --git a/nglib/CMakeLists.txt b/nglib/CMakeLists.txt index 7253230a..8fa7444b 100644 --- a/nglib/CMakeLists.txt +++ b/nglib/CMakeLists.txt @@ -7,7 +7,6 @@ if(WIN32) $ $ $ - $ $ $ @@ -23,7 +22,7 @@ endif(WIN32) add_library(nglib SHARED nglib.cpp ${nglib_objects}) if(NOT WIN32) - target_link_libraries( nglib PUBLIC mesh stl interface geom2d csg stl visual) + target_link_libraries( nglib PUBLIC mesh interface geom2d csg stl visual) if(USE_GUI) target_link_libraries( nglib PUBLIC stlvis geom2dvis csgvis ) endif(USE_GUI) diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp index d369eb27..a988b106 100644 --- a/nglib/nglib.cpp +++ b/nglib/nglib.cpp @@ -536,7 +536,7 @@ namespace nglib Ng_Mesh * mesh, int levels) { - Refinement2d ref(*(SplineGeometry2d*)geom); + Refinement ref(*(SplineGeometry2d*)geom); HPRefinement (*(Mesh*)mesh, &ref, levels); } @@ -547,7 +547,7 @@ namespace nglib Ng_Mesh * mesh, int levels, double parameter) { - Refinement2d ref(*(SplineGeometry2d*)geom); + Refinement ref(*(SplineGeometry2d*)geom); HPRefinement (*(Mesh*)mesh, &ref, levels, parameter); } @@ -1090,7 +1090,7 @@ namespace nglib // ------------------ Begin - Second Order Mesh generation functions ---------------- DLL_HEADER void Ng_Generate_SecondOrder(Ng_Mesh * mesh) { - Refinement ref; + Refinement ref(*((Mesh*) mesh)->GetGeometry()); ref.MakeSecondOrder(*(Mesh*) mesh); } @@ -1139,8 +1139,8 @@ namespace nglib // ------------------ Begin - Uniform Mesh Refinement functions --------------------- DLL_HEADER void Ng_Uniform_Refinement (Ng_Mesh * mesh) { - Refinement ref; - ref.Refine ( * (Mesh*) mesh ); + Refinement ref(*((Mesh*)mesh)->GetGeometry()); + ref.Refine ( * (Mesh*) mesh ); } diff --git a/tests/pytest/results.json b/tests/pytest/results.json index da57b936..10f15113 100644 --- a/tests/pytest/results.json +++ b/tests/pytest/results.json @@ -3,9 +3,9 @@ { "ne1d": 74, "ne2d": 54, - "ne3d": 40, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 7, 16, 1, 5, 2, 0, 0, 0]", - "total_badness": 61.085020204 + "ne3d": 39, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 6, 14, 0, 8, 1, 0, 0, 1]", + "total_badness": 58.504327315 }, { "ne1d": 59, @@ -24,155 +24,155 @@ { "ne1d": 74, "ne2d": 54, - "ne3d": 40, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 7, 16, 1, 5, 2, 0, 0, 0]", - "total_badness": 61.085020204 + "ne3d": 39, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 6, 14, 0, 8, 1, 0, 0, 1]", + "total_badness": 58.504327315 }, { "ne1d": 118, - "ne2d": 140, - "ne3d": 165, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 9, 13, 23, 20, 31, 25, 21, 14, 6, 1]", - "total_badness": 233.73328932 + "ne2d": 128, + "ne3d": 146, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 6, 11, 15, 19, 23, 29, 14, 9, 3, 10, 2]", + "total_badness": 221.53127331 }, { "ne1d": 181, - "ne2d": 325, - "ne3d": 528, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 19, 38, 53, 74, 80, 99, 85, 63, 9]", - "total_badness": 687.31675405 + "ne2d": 295, + "ne3d": 478, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 6, 20, 38, 41, 79, 96, 81, 59, 46, 7]", + "total_badness": 634.07879728 } ], "boxcyl.geo": [ { "ne1d": 190, - "ne2d": 468, - "ne3d": 846, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 31, 93, 78, 103, 80, 92, 103, 102, 84, 56, 21]", - "total_badness": 1229.0231928 + "ne2d": 452, + "ne3d": 838, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 3, 4, 24, 113, 90, 93, 118, 93, 82, 89, 68, 47, 13]", + "total_badness": 1250.6676912 }, { "ne1d": 94, "ne2d": 114, - "ne3d": 157, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 3, 8, 13, 13, 15, 7, 12, 11, 19, 14, 12, 21, 5, 3]", - "total_badness": 260.17372209 + "ne3d": 156, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 6, 9, 10, 8, 12, 9, 13, 7, 20, 15, 15, 22, 5, 3]", + "total_badness": 257.95680767 }, { "ne1d": 136, - "ne2d": 222, - "ne3d": 386, - "quality_histogram": "[0, 0, 0, 1, 2, 3, 2, 7, 8, 15, 16, 36, 36, 59, 53, 55, 58, 19, 15, 1]", - "total_badness": 590.51625062 + "ne2d": 218, + "ne3d": 378, + "quality_histogram": "[0, 0, 0, 1, 1, 1, 1, 3, 14, 20, 20, 34, 45, 51, 41, 52, 56, 18, 19, 1]", + "total_badness": 576.7536717 }, { "ne1d": 190, - "ne2d": 468, - "ne3d": 833, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 32, 89, 78, 83, 86, 83, 106, 103, 89, 62, 21]", - "total_badness": 1200.9010008 + "ne2d": 452, + "ne3d": 826, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 1, 21, 112, 89, 94, 110, 88, 87, 79, 79, 50, 13]", + "total_badness": 1223.565534 }, { "ne1d": 284, - "ne2d": 938, - "ne3d": 3742, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 25, 55, 131, 247, 484, 640, 754, 710, 529, 161]", - "total_badness": 4685.7832014 + "ne2d": 912, + "ne3d": 3696, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 6, 10, 20, 64, 152, 268, 438, 622, 744, 728, 497, 147]", + "total_badness": 4653.1667633 }, { "ne1d": 456, - "ne2d": 2496, - "ne3d": 18713, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 39, 127, 338, 795, 1684, 2888, 4053, 4409, 3223, 1146]", - "total_badness": 22695.778021 + "ne2d": 2450, + "ne3d": 18381, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 6, 19, 64, 164, 415, 920, 1808, 2907, 3777, 4130, 3152, 1018]", + "total_badness": 22479.104821 } ], "circle_on_cube.geo": [ { "ne1d": 94, - "ne2d": 170, - "ne3d": 637, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 4, 5, 18, 38, 54, 74, 84, 109, 110, 73, 55, 12]", - "total_badness": 863.74076861 + "ne2d": 152, + "ne3d": 608, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 2, 8, 27, 31, 47, 60, 88, 114, 93, 70, 55, 11]", + "total_badness": 828.41267216 }, { "ne1d": 40, "ne2d": 38, - "ne3d": 46, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 2, 4, 8, 8, 6, 7, 5, 1, 2, 1, 0, 0, 0, 0]", - "total_badness": 97.323158335 + "ne3d": 53, + "quality_histogram": "[0, 0, 0, 0, 1, 3, 1, 4, 6, 12, 4, 9, 2, 2, 4, 3, 0, 2, 0, 0]", + "total_badness": 109.70868385 }, { "ne1d": 62, - "ne2d": 96, - "ne3d": 196, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 8, 8, 27, 34, 42, 33, 20, 9, 6, 1]", - "total_badness": 282.75693303 + "ne2d": 86, + "ne3d": 182, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 9, 17, 19, 28, 35, 22, 22, 11, 5, 3]", + "total_badness": 266.64934593 }, { "ne1d": 94, - "ne2d": 170, - "ne3d": 622, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 12, 26, 39, 80, 70, 113, 112, 93, 62, 10]", - "total_badness": 821.68699443 + "ne2d": 152, + "ne3d": 593, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 15, 27, 33, 50, 84, 110, 102, 84, 64, 14]", + "total_badness": 786.32868296 }, { "ne1d": 138, - "ne2d": 384, - "ne3d": 2028, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 9, 28, 67, 157, 250, 347, 419, 398, 261, 88]", - "total_badness": 2540.7133216 + "ne2d": 370, + "ne3d": 1891, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 9, 27, 75, 163, 236, 317, 385, 323, 276, 78]", + "total_badness": 2378.4348462 }, { "ne1d": 224, - "ne2d": 944, - "ne3d": 11860, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 29, 85, 211, 518, 1135, 1851, 2527, 2686, 2118, 688]", - "total_badness": 14411.259826 + "ne2d": 900, + "ne3d": 11870, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 7, 17, 44, 128, 272, 627, 1206, 1832, 2541, 2570, 2011, 615]", + "total_badness": 14569.250591 } ], "cone.geo": [ { "ne1d": 64, - "ne2d": 722, - "ne3d": 1263, - "quality_histogram": "[0, 0, 0, 0, 0, 3, 4, 14, 48, 62, 95, 129, 141, 162, 163, 145, 107, 112, 61, 17]", - "total_badness": 1927.4650748 + "ne2d": 716, + "ne3d": 1192, + "quality_histogram": "[0, 0, 0, 0, 1, 2, 13, 27, 54, 76, 88, 145, 123, 139, 140, 131, 123, 80, 40, 10]", + "total_badness": 1887.2343616 }, { "ne1d": 32, "ne2d": 220, - "ne3d": 700, - "quality_histogram": "[0, 0, 13, 49, 51, 51, 51, 46, 63, 42, 38, 49, 53, 50, 42, 33, 27, 21, 18, 3]", - "total_badness": 1807.5903418 + "ne3d": 737, + "quality_histogram": "[0, 0, 16, 46, 43, 51, 72, 61, 53, 51, 52, 46, 68, 44, 31, 27, 41, 18, 13, 4]", + "total_badness": 1894.7838255 }, { "ne1d": 48, - "ne2d": 428, - "ne3d": 930, - "quality_histogram": "[6, 33, 75, 70, 53, 52, 44, 63, 73, 77, 65, 88, 62, 37, 46, 30, 20, 21, 15, 0]", - "total_badness": 3263.5820874 + "ne2d": 418, + "ne3d": 673, + "quality_histogram": "[0, 3, 23, 17, 19, 16, 38, 41, 64, 86, 77, 66, 50, 49, 40, 29, 23, 25, 6, 1]", + "total_badness": 1591.8445773 }, { "ne1d": 64, - "ne2d": 722, - "ne3d": 1244, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 10, 25, 61, 77, 117, 140, 158, 172, 138, 144, 118, 66, 15]", - "total_badness": 1843.7405821 + "ne2d": 716, + "ne3d": 1169, + "quality_histogram": "[0, 0, 0, 0, 1, 0, 10, 22, 34, 57, 80, 108, 139, 147, 154, 144, 115, 88, 57, 13]", + "total_badness": 1787.8610181 }, { "ne1d": 96, - "ne2d": 1660, - "ne3d": 4395, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 14, 39, 86, 147, 270, 427, 584, 724, 725, 723, 492, 162]", - "total_badness": 5745.9242938 + "ne2d": 1654, + "ne3d": 4374, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 9, 44, 77, 192, 302, 495, 598, 729, 718, 662, 425, 121]", + "total_badness": 5789.8784966 }, { "ne1d": 160, - "ne2d": 4748, - "ne3d": 27365, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 8, 35, 121, 352, 715, 1535, 2882, 4456, 5703, 5878, 4303, 1377]", - "total_badness": 33766.111622 + "ne2d": 4722, + "ne3d": 27153, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 10, 50, 134, 382, 841, 1698, 2942, 4533, 5543, 5629, 4130, 1260]", + "total_badness": 33712.712047 } ], "cube.geo": [ @@ -213,54 +213,54 @@ }, { "ne1d": 72, - "ne2d": 116, - "ne3d": 167, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 2, 5, 5, 16, 8, 18, 30, 31, 29, 11, 7]", - "total_badness": 224.7322738 + "ne2d": 108, + "ne3d": 171, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, 11, 14, 16, 27, 28, 27, 24, 11, 3]", + "total_badness": 233.61347097 } ], "cubeandring.geo": [ { "ne1d": 262, - "ne2d": 726, - "ne3d": 2225, - "quality_histogram": "[0, 10, 19, 36, 98, 105, 126, 110, 98, 59, 71, 87, 153, 186, 272, 275, 223, 160, 109, 28]", - "total_badness": 4466.5881396 + "ne2d": 690, + "ne3d": 2140, + "quality_histogram": "[3, 12, 19, 38, 56, 105, 96, 77, 120, 76, 100, 117, 154, 202, 231, 248, 218, 143, 97, 28]", + "total_badness": 4299.394376 }, { "ne1d": 134, - "ne2d": 164, - "ne3d": 250, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 0, 4, 4, 6, 13, 24, 28, 43, 40, 34, 25, 19, 7, 2]", - "total_badness": 372.39445714 + "ne2d": 156, + "ne3d": 249, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 4, 5, 14, 24, 38, 39, 36, 35, 25, 19, 6, 1]", + "total_badness": 369.67745906 }, { "ne1d": 190, - "ne2d": 300, - "ne3d": 646, - "quality_histogram": "[0, 0, 0, 1, 2, 0, 0, 2, 10, 27, 58, 69, 66, 107, 87, 91, 60, 44, 20, 2]", - "total_badness": 978.54289744 + "ne2d": 278, + "ne3d": 574, + "quality_histogram": "[0, 0, 0, 1, 1, 0, 0, 6, 6, 32, 46, 56, 64, 94, 90, 65, 56, 34, 20, 3]", + "total_badness": 874.96542794 }, { "ne1d": 262, - "ne2d": 726, - "ne3d": 2087, - "quality_histogram": "[0, 2, 12, 18, 54, 90, 113, 95, 88, 55, 41, 59, 111, 196, 254, 299, 260, 193, 114, 33]", - "total_badness": 3774.9667473 + "ne2d": 690, + "ne3d": 1978, + "quality_histogram": "[0, 0, 8, 21, 34, 88, 102, 58, 96, 50, 73, 83, 123, 183, 205, 261, 260, 178, 122, 33]", + "total_badness": 3497.4685292 }, { "ne1d": 378, - "ne2d": 1412, - "ne3d": 7741, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 11, 17, 64, 139, 294, 516, 862, 1328, 1545, 1486, 1147, 331]", - "total_badness": 9711.521562 + "ne2d": 1346, + "ne3d": 7382, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 9, 22, 42, 97, 190, 367, 566, 900, 1275, 1377, 1321, 979, 237]", + "total_badness": 9468.2810231 }, { "ne1d": 624, - "ne2d": 3944, - "ne3d": 38347, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 18, 40, 131, 351, 853, 2070, 3906, 6037, 7925, 8484, 6438, 2092]", - "total_badness": 47000.212862 + "ne2d": 3810, + "ne3d": 37770, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 6, 20, 70, 145, 415, 941, 1986, 3872, 6127, 7881, 8209, 6217, 1880]", + "total_badness": 46477.07805 } ], "cubeandspheres.geo": [ @@ -268,353 +268,353 @@ "ne1d": 144, "ne2d": 148, "ne3d": 98, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 4, 18, 19, 13, 20, 2, 9, 1, 0]", - "total_badness": 145.83375079 - }, - { - "ne1d": 144, - "ne2d": 150, - "ne3d": 100, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 10, 16, 18, 15, 17, 6, 5, 4, 0]", - "total_badness": 146.6468601 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 14, 14, 14, 18, 14, 6, 6, 0, 0]", + "total_badness": 149.18816997 }, { "ne1d": 144, "ne2d": 148, "ne3d": 98, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 6, 19, 21, 12, 18, 5, 4, 4, 0]", - "total_badness": 145.14580879 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 11, 11, 17, 13, 16, 18, 3, 6, 0, 0]", + "total_badness": 148.56830588 }, { "ne1d": 144, "ne2d": 148, "ne3d": 98, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 4, 18, 19, 13, 20, 2, 9, 1, 0]", - "total_badness": 145.83375079 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 8, 12, 14, 22, 10, 18, 4, 6, 0, 0]", + "total_badness": 148.71179128 + }, + { + "ne1d": 144, + "ne2d": 148, + "ne3d": 98, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 14, 14, 14, 18, 14, 6, 6, 0, 0]", + "total_badness": 149.18816997 }, { "ne1d": 264, - "ne2d": 390, - "ne3d": 369, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 5, 19, 26, 42, 46, 49, 41, 53, 45, 27, 10, 2]", - "total_badness": 554.2809713 + "ne2d": 352, + "ne3d": 322, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 15, 33, 40, 34, 47, 42, 23, 32, 29, 18, 5, 1]", + "total_badness": 519.67445044 }, { "ne1d": 428, - "ne2d": 926, - "ne3d": 1074, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 23, 50, 36, 109, 137, 96, 117, 160, 162, 67, 60, 32, 22]", - "total_badness": 1675.8711911 + "ne2d": 902, + "ne3d": 1050, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 21, 55, 53, 60, 106, 140, 125, 89, 115, 114, 79, 49, 37, 7]", + "total_badness": 1742.9580036 } ], "cubemcyl.geo": [ { "ne1d": 142, - "ne2d": 2488, - "ne3d": 20783, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 26, 94, 208, 408, 708, 1158, 1848, 2485, 3200, 3251, 3127, 2474, 1418, 376]", - "total_badness": 28813.276387 + "ne2d": 2446, + "ne3d": 20376, + "quality_histogram": "[0, 0, 0, 0, 0, 4, 30, 124, 254, 467, 838, 1358, 1902, 2621, 2988, 3092, 2912, 2176, 1289, 321]", + "total_badness": 28732.001319 }, { "ne1d": 64, - "ne2d": 642, - "ne3d": 3214, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 7, 13, 34, 74, 140, 230, 351, 455, 533, 531, 378, 284, 151, 31]", - "total_badness": 4592.7629352 + "ne2d": 610, + "ne3d": 3095, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 9, 21, 39, 75, 144, 238, 340, 436, 489, 491, 378, 261, 140, 34]", + "total_badness": 4458.1067866 }, { "ne1d": 102, - "ne2d": 1402, - "ne3d": 8234, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 12, 30, 67, 143, 309, 586, 856, 1050, 1271, 1291, 1179, 825, 462, 151]", - "total_badness": 11552.618825 + "ne2d": 1370, + "ne3d": 7955, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 11, 63, 157, 297, 497, 895, 1095, 1296, 1215, 1069, 758, 452, 148]", + "total_badness": 11150.474701 }, { "ne1d": 142, - "ne2d": 2488, - "ne3d": 19499, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 5, 27, 106, 226, 529, 1209, 2008, 2862, 3440, 3576, 3083, 1921, 507]", - "total_badness": 25390.546576 + "ne2d": 2446, + "ne3d": 18903, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 9, 52, 134, 343, 650, 1168, 2032, 2738, 3338, 3304, 2846, 1788, 501]", + "total_badness": 24879.568157 }, { "ne1d": 210, - "ne2d": 5508, - "ne3d": 88767, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 26, 120, 352, 982, 2386, 5436, 9851, 14528, 18286, 19003, 13703, 4092]", - "total_badness": 109764.47526 + "ne2d": 5438, + "ne3d": 88766, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 6, 29, 124, 395, 1107, 2534, 5743, 9904, 14438, 18388, 18815, 13214, 4069]", + "total_badness": 110093.18284 }, { "ne1d": 362, - "ne2d": 15122, - "ne3d": 524413, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 23, 86, 347, 1131, 3167, 9094, 23844, 49271, 81498, 111440, 122044, 93488, 28977]", - "total_badness": 636787.56071 + "ne2d": 14996, + "ne3d": 526308, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 18, 83, 344, 1098, 3118, 9070, 23211, 48496, 81254, 110846, 122403, 95673, 30692]", + "total_badness": 638104.66873 } ], "cubemsphere.geo": [ { "ne1d": 90, - "ne2d": 702, - "ne3d": 4867, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 5, 17, 43, 80, 172, 274, 422, 600, 765, 725, 748, 588, 317, 111]", - "total_badness": 6717.4363413 + "ne2d": 658, + "ne3d": 4711, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 10, 27, 50, 94, 180, 303, 459, 591, 709, 689, 658, 536, 328, 77]", + "total_badness": 6607.5525427 }, { "ne1d": 44, - "ne2d": 274, - "ne3d": 768, - "quality_histogram": "[0, 0, 0, 0, 1, 5, 9, 11, 26, 62, 72, 78, 114, 95, 91, 78, 74, 24, 22, 6]", - "total_badness": 1237.8358347 + "ne2d": 230, + "ne3d": 615, + "quality_histogram": "[0, 0, 0, 0, 2, 3, 14, 27, 47, 71, 83, 96, 66, 62, 49, 38, 29, 11, 14, 3]", + "total_badness": 1101.3768112 }, { "ne1d": 68, - "ne2d": 402, - "ne3d": 1600, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 4, 26, 61, 119, 170, 232, 277, 269, 214, 148, 71, 7]", - "total_badness": 2248.6479915 + "ne2d": 382, + "ne3d": 1582, + "quality_histogram": "[0, 0, 0, 1, 0, 0, 1, 8, 21, 35, 80, 112, 189, 245, 243, 240, 193, 125, 74, 15]", + "total_badness": 2282.2332329 }, { "ne1d": 90, - "ne2d": 702, - "ne3d": 4618, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 4, 24, 53, 140, 293, 465, 706, 805, 841, 747, 418, 120]", - "total_badness": 6022.3952178 + "ne2d": 658, + "ne3d": 4427, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 3, 12, 34, 88, 172, 319, 479, 662, 739, 759, 614, 420, 124]", + "total_badness": 5868.6109754 }, { "ne1d": 146, - "ne2d": 1492, - "ne3d": 17800, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 7, 23, 89, 208, 524, 1085, 1942, 2969, 3729, 3811, 2675, 736]", - "total_badness": 22074.204803 + "ne2d": 1400, + "ne3d": 17593, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 11, 29, 113, 227, 554, 1165, 1970, 2907, 3573, 3694, 2609, 740]", + "total_badness": 21904.812218 }, { "ne1d": 248, - "ne2d": 4354, - "ne3d": 113716, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 5, 12, 43, 136, 381, 909, 2353, 5720, 11280, 18112, 23886, 25957, 19090, 5832]", - "total_badness": 139103.15382 + "ne2d": 4228, + "ne3d": 113220, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 13, 44, 146, 376, 952, 2444, 5872, 11431, 17868, 23828, 25460, 19207, 5578]", + "total_badness": 138667.4834 } ], "cylinder.geo": [ { "ne1d": 52, "ne2d": 288, - "ne3d": 410, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 2, 8, 14, 31, 47, 57, 67, 64, 53, 44, 13, 9]", - "total_badness": 577.74781759 + "ne3d": 373, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 6, 17, 48, 41, 57, 46, 46, 40, 40, 21, 10, 1]", + "total_badness": 570.55070099 }, { "ne1d": 24, "ne2d": 66, - "ne3d": 124, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 9, 12, 16, 23, 39, 12, 5]", - "total_badness": 153.9684245 + "ne3d": 113, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 5, 11, 14, 21, 20, 26, 5, 7]", + "total_badness": 144.11768709 }, { "ne1d": 36, "ne2d": 152, - "ne3d": 376, - "quality_histogram": "[0, 0, 0, 8, 18, 19, 17, 43, 35, 17, 29, 16, 18, 42, 20, 21, 38, 16, 12, 7]", - "total_badness": 793.09247202 + "ne3d": 350, + "quality_histogram": "[7, 11, 19, 25, 33, 33, 23, 20, 37, 19, 9, 14, 28, 12, 12, 4, 32, 4, 6, 2]", + "total_badness": 1478.5840853 }, { "ne1d": 52, "ne2d": 288, - "ne3d": 404, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 2, 4, 15, 25, 38, 68, 66, 55, 55, 52, 15, 8]", - "total_badness": 562.71987918 + "ne3d": 373, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 6, 17, 48, 40, 56, 45, 48, 40, 40, 22, 10, 1]", + "total_badness": 570.48747936 }, { "ne1d": 76, "ne2d": 636, - "ne3d": 1146, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 34, 57, 101, 121, 179, 190, 199, 137, 96, 17]", - "total_badness": 1547.7672308 + "ne3d": 1137, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 7, 27, 48, 71, 98, 132, 182, 156, 180, 136, 79, 19]", + "total_badness": 1578.5996937 }, { "ne1d": 124, - "ne2d": 1672, - "ne3d": 8039, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 16, 52, 160, 405, 772, 1246, 1710, 1808, 1421, 444]", - "total_badness": 9788.5339464 + "ne2d": 1668, + "ne3d": 8144, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 1, 6, 20, 64, 189, 420, 858, 1386, 1685, 1693, 1360, 461]", + "total_badness": 9978.9003582 } ], "cylsphere.geo": [ { "ne1d": 104, "ne2d": 496, - "ne3d": 711, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 9, 15, 36, 63, 90, 107, 103, 99, 56, 60, 50, 17, 2]", - "total_badness": 1105.8880942 + "ne3d": 769, + "quality_histogram": "[0, 0, 0, 0, 1, 1, 8, 10, 20, 31, 64, 104, 111, 105, 113, 63, 69, 47, 18, 4]", + "total_badness": 1205.3563502 }, { "ne1d": 48, - "ne2d": 142, - "ne3d": 242, - "quality_histogram": "[0, 0, 0, 16, 20, 29, 22, 22, 6, 8, 6, 14, 5, 13, 14, 25, 18, 13, 11, 0]", - "total_badness": 604.89450225 + "ne2d": 136, + "ne3d": 211, + "quality_histogram": "[0, 0, 1, 11, 19, 15, 23, 13, 14, 8, 12, 6, 9, 17, 11, 8, 12, 26, 6, 0]", + "total_badness": 508.6341945 }, { "ne1d": 104, "ne2d": 496, - "ne3d": 709, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 5, 15, 29, 63, 86, 110, 109, 89, 69, 66, 45, 15, 4]", - "total_badness": 1092.3394563 + "ne3d": 763, + "quality_histogram": "[0, 0, 0, 0, 1, 1, 6, 8, 15, 24, 53, 92, 109, 105, 114, 87, 71, 48, 28, 1]", + "total_badness": 1166.824818 }, { "ne1d": 152, - "ne2d": 1084, - "ne3d": 2798, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 5, 19, 44, 91, 162, 267, 345, 422, 507, 505, 322, 108]", - "total_badness": 3620.8176099 + "ne2d": 1082, + "ne3d": 2764, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 6, 17, 47, 113, 184, 268, 318, 434, 511, 462, 305, 96]", + "total_badness": 3608.4305823 }, { "ne1d": 248, - "ne2d": 2820, - "ne3d": 17745, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 2, 20, 57, 142, 331, 880, 1771, 2788, 3668, 3998, 3037, 1049]", - "total_badness": 21647.214644 + "ne2d": 2798, + "ne3d": 17399, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 51, 181, 398, 941, 1798, 2813, 3642, 3802, 2815, 930]", + "total_badness": 21362.004145 } ], "ellipsoid.geo": [ { "ne1d": 0, - "ne2d": 704, - "ne3d": 1297, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 7, 14, 42, 76, 119, 157, 154, 160, 158, 142, 111, 89, 54, 14]", - "total_badness": 2009.8527353 + "ne2d": 686, + "ne3d": 1267, + "quality_histogram": "[0, 0, 0, 0, 1, 3, 9, 22, 59, 98, 116, 117, 161, 168, 150, 127, 117, 65, 41, 13]", + "total_badness": 2020.1005544 }, { "ne1d": 0, - "ne2d": 192, - "ne3d": 915, - "quality_histogram": "[24, 146, 135, 112, 105, 65, 62, 41, 46, 43, 32, 26, 19, 24, 15, 10, 6, 1, 3, 0]", - "total_badness": 5760.7267346 + "ne2d": 182, + "ne3d": 847, + "quality_histogram": "[16, 151, 142, 110, 54, 76, 47, 43, 37, 39, 25, 31, 26, 15, 11, 10, 4, 6, 1, 3]", + "total_badness": 5395.4074386 }, { "ne1d": 0, - "ne2d": 394, - "ne3d": 592, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 5, 9, 21, 38, 80, 86, 90, 99, 53, 48, 29, 22, 12]", - "total_badness": 893.18441542 + "ne2d": 384, + "ne3d": 581, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 8, 17, 29, 58, 73, 91, 80, 78, 65, 33, 27, 19, 2]", + "total_badness": 912.08491356 }, { "ne1d": 0, - "ne2d": 704, - "ne3d": 1282, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 10, 33, 59, 108, 136, 158, 156, 163, 153, 115, 97, 69, 23]", - "total_badness": 1929.3894181 + "ne2d": 686, + "ne3d": 1249, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 7, 14, 45, 79, 96, 114, 162, 158, 141, 155, 123, 88, 52, 14]", + "total_badness": 1922.5886374 }, { "ne1d": 0, - "ne2d": 1618, - "ne3d": 5569, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 23, 73, 130, 303, 511, 700, 922, 1025, 989, 693, 195]", - "total_badness": 7142.2540344 + "ne2d": 1598, + "ne3d": 5214, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 16, 32, 97, 186, 312, 520, 658, 859, 914, 857, 604, 157]", + "total_badness": 6803.6112693 }, { "ne1d": 0, - "ne2d": 4236, - "ne3d": 37387, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 3, 17, 75, 239, 644, 1587, 3545, 5826, 7874, 8638, 6846, 2092]", - "total_badness": 45341.992565 + "ne2d": 4194, + "ne3d": 37370, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 8, 19, 44, 111, 311, 846, 1867, 3637, 5870, 7895, 8585, 6262, 1912]", + "total_badness": 45726.525344 } ], "ellipticcone.geo": [ { "ne1d": 174, - "ne2d": 1562, - "ne3d": 5180, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 18, 65, 115, 211, 361, 589, 766, 881, 904, 732, 405, 130]", - "total_badness": 6920.4601657 + "ne2d": 1528, + "ne3d": 5118, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 16, 33, 75, 139, 240, 434, 619, 759, 884, 814, 643, 366, 93]", + "total_badness": 6977.8809322 }, { "ne1d": 86, - "ne2d": 380, + "ne2d": 374, "ne3d": 585, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 1, 5, 13, 17, 32, 57, 64, 73, 84, 89, 68, 47, 22, 12]", - "total_badness": 860.61770269 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 9, 13, 24, 46, 63, 60, 85, 82, 78, 61, 38, 19, 5]", + "total_badness": 887.43996754 }, { "ne1d": 130, - "ne2d": 864, - "ne3d": 1734, - "quality_histogram": "[0, 0, 0, 0, 0, 7, 9, 28, 37, 57, 85, 135, 132, 216, 225, 256, 238, 177, 100, 32]", - "total_badness": 2535.8367438 + "ne2d": 846, + "ne3d": 1680, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 18, 28, 47, 86, 139, 185, 232, 222, 255, 201, 164, 77, 23]", + "total_badness": 2436.7946247 }, { "ne1d": 174, - "ne2d": 1562, - "ne3d": 4943, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 15, 49, 116, 255, 456, 635, 917, 1005, 806, 517, 167]", - "total_badness": 6347.4280983 + "ne2d": 1528, + "ne3d": 4853, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 9, 32, 61, 129, 296, 505, 739, 906, 892, 704, 453, 126]", + "total_badness": 6344.0542598 }, { "ne1d": 258, - "ne2d": 3468, - "ne3d": 13314, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 33, 103, 197, 351, 652, 1077, 1619, 2280, 2518, 2361, 1583, 535]", - "total_badness": 17113.967555 + "ne2d": 3378, + "ne3d": 13096, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 12, 37, 100, 226, 405, 741, 1138, 1694, 2154, 2382, 2242, 1503, 461]", + "total_badness": 16999.928783 }, { "ne1d": 432, - "ne2d": 9544, - "ne3d": 69891, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 9, 37, 119, 313, 839, 1927, 4086, 7715, 11454, 14338, 14977, 10816, 3260]", - "total_badness": 86472.194086 + "ne2d": 9384, + "ne3d": 69399, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 10, 40, 159, 347, 879, 2068, 4096, 7587, 11297, 14016, 14721, 10764, 3413]", + "total_badness": 86005.445455 } ], "ellipticcyl.geo": [ { "ne1d": 156, - "ne2d": 996, - "ne3d": 2299, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 12, 15, 55, 86, 117, 235, 272, 372, 360, 358, 240, 144, 33]", - "total_badness": 3202.1380209 + "ne2d": 978, + "ne3d": 2173, + "quality_histogram": "[0, 0, 0, 0, 1, 2, 6, 21, 39, 80, 120, 163, 228, 297, 314, 272, 277, 200, 116, 37]", + "total_badness": 3176.0734083 }, { "ne1d": 76, - "ne2d": 238, - "ne3d": 325, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 18, 28, 26, 38, 68, 55, 45, 28, 11, 2]", - "total_badness": 459.61476239 + "ne2d": 234, + "ne3d": 318, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 16, 23, 26, 47, 60, 57, 36, 31, 15, 2]", + "total_badness": 445.78992995 }, { "ne1d": 116, - "ne2d": 596, - "ne3d": 1129, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 2, 10, 28, 38, 75, 130, 159, 208, 199, 162, 100, 17]", - "total_badness": 1500.1384781 + "ne2d": 590, + "ne3d": 1110, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 9, 20, 40, 76, 108, 163, 174, 169, 154, 96, 82, 17]", + "total_badness": 1550.1402117 }, { "ne1d": 156, - "ne2d": 996, - "ne3d": 2214, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 4, 40, 47, 89, 182, 262, 324, 362, 381, 279, 196, 46]", - "total_badness": 2974.3073079 + "ne2d": 978, + "ne3d": 2116, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 2, 12, 24, 53, 88, 148, 204, 264, 307, 311, 310, 212, 134, 45]", + "total_badness": 2990.2292327 }, { "ne1d": 232, - "ne2d": 2212, - "ne3d": 8313, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 15, 37, 113, 263, 626, 1005, 1387, 1743, 1660, 1133, 327]", - "total_badness": 10392.004794 + "ne2d": 2152, + "ne3d": 8180, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 4, 13, 75, 162, 340, 621, 998, 1438, 1633, 1538, 1036, 320]", + "total_badness": 10345.93668 }, { "ne1d": 388, - "ne2d": 6142, - "ne3d": 54975, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 12, 45, 127, 329, 844, 2554, 5100, 8469, 11479, 12855, 9876, 3283]", - "total_badness": 66669.096677 + "ne2d": 6032, + "ne3d": 55282, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 17, 55, 134, 358, 1019, 2431, 5189, 8900, 11545, 12575, 9809, 3249]", + "total_badness": 67200.497687 } ], "fichera.geo": [ { "ne1d": 50, "ne2d": 38, - "ne3d": 40, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 1, 3, 2, 4, 3, 5, 7, 8, 2, 1, 0, 2]", - "total_badness": 62.361996939 + "ne3d": 35, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 3, 0, 14, 6, 4, 3, 0, 0, 0]", + "total_badness": 52.723984269 }, { "ne1d": 42, @@ -633,90 +633,90 @@ { "ne1d": 50, "ne2d": 38, - "ne3d": 40, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 1, 3, 2, 4, 3, 5, 7, 8, 2, 1, 0, 2]", - "total_badness": 62.361996939 + "ne3d": 35, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 3, 0, 14, 6, 4, 3, 0, 0, 0]", + "total_badness": 52.723984269 }, { "ne1d": 96, - "ne2d": 120, - "ne3d": 211, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 14, 22, 26, 38, 37, 41, 14, 9]", - "total_badness": 273.06134659 + "ne2d": 106, + "ne3d": 179, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 10, 22, 29, 29, 24, 32, 16, 10, 4]", + "total_badness": 244.43517202 }, { "ne1d": 144, - "ne2d": 274, - "ne3d": 510, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 8, 16, 34, 67, 79, 99, 78, 66, 48, 12]", - "total_badness": 673.19970182 + "ne2d": 256, + "ne3d": 488, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 16, 33, 67, 69, 87, 83, 64, 51, 8]", + "total_badness": 644.18548378 } ], "frame.step": [ { "ne1d": 12694, - "ne2d": 40530, - "ne3d": 221097, - "quality_histogram": "[3, 7, 7, 7, 8, 40, 245, 708, 1672, 3552, 6310, 10581, 17667, 25348, 32001, 36224, 35008, 29057, 18076, 4576]", - "total_badness": 301373.46714 + "ne2d": 40032, + "ne3d": 217255, + "quality_histogram": "[5, 13, 31, 61, 130, 279, 648, 1439, 2748, 4927, 8104, 12603, 18825, 26189, 30309, 33468, 31719, 25459, 15756, 4542]", + "total_badness": 305515.07817 }, { "ne1d": 6026, - "ne2d": 11334, - "ne3d": 30593, - "quality_histogram": "[4, 5, 3, 10, 18, 39, 99, 258, 685, 1029, 1688, 2632, 3417, 4292, 4551, 4273, 3404, 2499, 1366, 321]", - "total_badness": 45414.634083 + "ne2d": 11524, + "ne3d": 30642, + "quality_histogram": "[5, 17, 33, 55, 112, 215, 294, 601, 966, 1480, 2132, 3064, 3480, 3813, 3959, 3899, 2963, 2077, 1083, 394]", + "total_badness": 48718.851933 }, { "ne1d": 9704, - "ne2d": 24442, - "ne3d": 85741, - "quality_histogram": "[1, 6, 6, 9, 8, 30, 83, 164, 483, 1017, 2377, 4530, 7838, 10925, 13440, 14326, 13095, 10227, 5737, 1439]", - "total_badness": 117664.34461 + "ne2d": 24306, + "ne3d": 84372, + "quality_histogram": "[5, 24, 44, 72, 114, 182, 376, 582, 1183, 2141, 3538, 5817, 8397, 11162, 12283, 12562, 11075, 8571, 4984, 1260]", + "total_badness": 122228.21207 } ], "hinge.stl": [ { "ne1d": 456, - "ne2d": 1218, - "ne3d": 2007, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 7, 22, 35, 43, 69, 124, 175, 266, 301, 273, 272, 226, 144, 48]", - "total_badness": 2839.693559 + "ne2d": 1220, + "ne3d": 1980, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 11, 19, 47, 65, 135, 159, 254, 309, 289, 269, 237, 142, 44]", + "total_badness": 2756.1867742 }, { "ne1d": 298, - "ne2d": 606, - "ne3d": 782, - "quality_histogram": "[0, 0, 1, 9, 6, 5, 18, 17, 33, 53, 60, 95, 99, 112, 83, 73, 47, 49, 20, 2]", - "total_badness": 1342.4305041 + "ne2d": 610, + "ne3d": 798, + "quality_histogram": "[0, 0, 1, 9, 10, 6, 28, 14, 41, 51, 72, 81, 97, 98, 79, 82, 52, 48, 25, 4]", + "total_badness": 1395.9318106 }, { "ne1d": 370, - "ne2d": 854, - "ne3d": 1136, - "quality_histogram": "[0, 0, 0, 1, 3, 9, 21, 24, 34, 44, 70, 113, 151, 137, 158, 154, 97, 68, 43, 9]", - "total_badness": 1798.68351 + "ne2d": 856, + "ne3d": 1144, + "quality_histogram": "[0, 0, 0, 1, 4, 6, 18, 28, 41, 51, 76, 117, 140, 147, 147, 148, 99, 70, 43, 8]", + "total_badness": 1817.5662995 }, { "ne1d": 516, "ne2d": 1574, - "ne3d": 2551, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 4, 9, 22, 56, 91, 150, 262, 288, 378, 368, 350, 304, 214, 53]", - "total_badness": 3546.3587224 + "ne3d": 2625, + "quality_histogram": "[0, 0, 0, 0, 1, 2, 4, 10, 41, 66, 110, 179, 253, 312, 372, 380, 333, 296, 218, 48]", + "total_badness": 3701.4387818 }, { "ne1d": 722, - "ne2d": 2872, - "ne3d": 6679, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 22, 38, 58, 158, 368, 659, 826, 1064, 1147, 1157, 900, 277]", - "total_badness": 8576.0981512 + "ne2d": 2866, + "ne3d": 6605, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 1, 25, 48, 59, 177, 334, 665, 897, 1055, 1130, 1130, 838, 242]", + "total_badness": 8524.0032138 }, { "ne1d": 1862, - "ne2d": 19494, - "ne3d": 137231, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 7, 48, 161, 424, 1135, 2966, 6918, 13385, 21373, 28847, 31139, 23298, 7529]", - "total_badness": 167698.91174 + "ne2d": 19474, + "ne3d": 136180, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 7, 31, 132, 391, 1019, 2826, 6825, 13187, 21357, 28846, 30587, 23490, 7479]", + "total_badness": 166221.42387 } ], "lshape3d.geo": [ @@ -750,93 +750,93 @@ }, { "ne1d": 80, - "ne2d": 76, - "ne3d": 88, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 9, 21, 23, 7, 6, 1, 4]", - "total_badness": 121.1271847 + "ne2d": 68, + "ne3d": 76, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10, 5, 11, 21, 12, 4, 3, 6]", + "total_badness": 100.74904328 }, { "ne1d": 122, - "ne2d": 204, - "ne3d": 326, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 11, 17, 43, 51, 53, 55, 51, 33, 6]", - "total_badness": 427.73309234 + "ne2d": 194, + "ne3d": 314, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 16, 30, 35, 37, 52, 48, 43, 28, 11]", + "total_badness": 424.01540745 } ], "manyholes.geo": [ { "ne1d": 5886, - "ne2d": 48052, - "ne3d": 179262, - "quality_histogram": "[0, 0, 0, 0, 7, 34, 52, 190, 559, 1394, 3332, 7622, 12534, 20021, 27619, 30066, 29961, 25045, 16810, 4016]", - "total_badness": 238415.32571 + "ne2d": 47108, + "ne3d": 178892, + "quality_histogram": "[0, 0, 0, 0, 9, 49, 344, 271, 1077, 1746, 4315, 9252, 12828, 22104, 26682, 30142, 28475, 22329, 13211, 6058]", + "total_badness": 242036.00946 }, { "ne1d": 2746, - "ne2d": 13866, - "ne3d": 29255, - "quality_histogram": "[0, 0, 0, 0, 12, 22, 36, 163, 382, 903, 1510, 2377, 3268, 4375, 4191, 3761, 3120, 2567, 1846, 722]", - "total_badness": 42256.964101 + "ne2d": 13444, + "ne3d": 29535, + "quality_histogram": "[0, 0, 0, 0, 17, 37, 130, 275, 644, 995, 1649, 2438, 3005, 3915, 4857, 4110, 2759, 2067, 1198, 1439]", + "total_badness": 43431.404115 }, { "ne1d": 4106, - "ne2d": 27994, - "ne3d": 70558, - "quality_histogram": "[0, 0, 0, 2, 32, 84, 194, 406, 841, 1669, 2783, 4416, 6997, 9372, 10151, 10346, 9564, 7474, 4487, 1740]", - "total_badness": 99764.452235 + "ne2d": 27422, + "ne3d": 69306, + "quality_histogram": "[0, 0, 0, 6, 39, 119, 211, 574, 1050, 1823, 3574, 5064, 7229, 10576, 9132, 9351, 8299, 6328, 3426, 2505]", + "total_badness": 100153.49841 } ], "manyholes2.geo": [ { "ne1d": 10202, - "ne2d": 55380, - "ne3d": 127866, - "quality_histogram": "[0, 0, 0, 0, 5, 32, 101, 306, 842, 2081, 4519, 7983, 11838, 17786, 18634, 18254, 16922, 14537, 10444, 3582]", - "total_badness": 176665.61274 + "ne2d": 53806, + "ne3d": 128979, + "quality_histogram": "[0, 0, 1, 15, 52, 115, 343, 600, 1518, 2768, 4832, 8179, 11632, 16124, 22272, 20407, 15327, 11446, 6833, 6515]", + "total_badness": 181571.22116 } ], "matrix.geo": [ { "ne1d": 174, - "ne2d": 1198, - "ne3d": 5246, - "quality_histogram": "[0, 0, 39, 136, 119, 93, 134, 174, 148, 224, 329, 399, 532, 581, 603, 563, 474, 398, 241, 59]", - "total_badness": 9567.4544817 + "ne2d": 1112, + "ne3d": 4664, + "quality_histogram": "[0, 0, 20, 71, 60, 66, 112, 199, 239, 366, 369, 455, 446, 506, 495, 423, 362, 273, 145, 57]", + "total_badness": 8426.3306839 }, { "ne1d": 106, - "ne2d": 610, - "ne3d": 1936, - "quality_histogram": "[0, 1, 11, 66, 104, 143, 140, 142, 192, 179, 201, 199, 161, 135, 74, 57, 51, 46, 29, 5]", - "total_badness": 4606.0709672 + "ne2d": 586, + "ne3d": 1974, + "quality_histogram": "[0, 13, 51, 99, 155, 168, 180, 193, 176, 168, 201, 132, 122, 102, 68, 51, 25, 29, 29, 12]", + "total_badness": 5471.3255025 }, { "ne1d": 132, - "ne2d": 830, - "ne3d": 2751, - "quality_histogram": "[0, 0, 4, 57, 63, 116, 124, 163, 226, 230, 333, 307, 270, 240, 206, 164, 105, 82, 43, 18]", - "total_badness": 5616.8677502 + "ne2d": 778, + "ne3d": 2548, + "quality_histogram": "[0, 0, 12, 54, 87, 126, 142, 175, 269, 295, 255, 257, 215, 201, 152, 122, 80, 54, 38, 14]", + "total_badness": 5547.4387913 }, { "ne1d": 174, - "ne2d": 1198, - "ne3d": 5176, - "quality_histogram": "[0, 0, 31, 113, 115, 69, 111, 172, 123, 209, 285, 339, 485, 597, 595, 628, 503, 468, 254, 79]", - "total_badness": 9086.4626755 + "ne2d": 1112, + "ne3d": 4528, + "quality_histogram": "[0, 0, 15, 52, 50, 61, 91, 184, 216, 326, 320, 439, 425, 505, 497, 419, 412, 289, 168, 59]", + "total_badness": 7915.0764915 }, { "ne1d": 248, - "ne2d": 2324, - "ne3d": 16341, - "quality_histogram": "[0, 0, 0, 0, 0, 7, 23, 64, 122, 219, 336, 666, 982, 1584, 2204, 2586, 2786, 2581, 1637, 544]", - "total_badness": 21749.164857 + "ne2d": 2234, + "ne3d": 15738, + "quality_histogram": "[0, 0, 0, 1, 4, 9, 49, 111, 189, 286, 466, 759, 1180, 1558, 2068, 2417, 2414, 2223, 1548, 456]", + "total_badness": 21524.074952 }, { "ne1d": 418, - "ne2d": 5968, - "ne3d": 100573, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 6, 18, 78, 192, 438, 1216, 2786, 6112, 10628, 15970, 20785, 21682, 15766, 4896]", - "total_badness": 124376.56219 + "ne2d": 5836, + "ne3d": 99039, + "quality_histogram": "[0, 0, 0, 1, 1, 3, 15, 45, 125, 259, 646, 1399, 3028, 6125, 10634, 15783, 20056, 20888, 15273, 4758]", + "total_badness": 123167.25076 } ], "ortho.geo": [ @@ -877,466 +877,466 @@ }, { "ne1d": 72, - "ne2d": 116, - "ne3d": 180, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 11, 12, 24, 35, 36, 29, 16, 9]", - "total_badness": 231.52239849 + "ne2d": 108, + "ne3d": 169, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 10, 12, 23, 26, 26, 30, 23, 10, 4]", + "total_badness": 227.08316059 } ], "part1.stl": [ { "ne1d": 170, "ne2d": 448, - "ne3d": 1242, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 3, 9, 14, 27, 62, 80, 118, 165, 171, 191, 160, 126, 91, 23]", - "total_badness": 1762.3248217 + "ne3d": 1260, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 6, 18, 26, 49, 88, 123, 148, 183, 193, 167, 145, 87, 23]", + "total_badness": 1772.4232339 }, { "ne1d": 134, "ne2d": 288, - "ne3d": 521, - "quality_histogram": "[0, 0, 1, 2, 5, 7, 6, 10, 18, 23, 40, 41, 47, 59, 72, 76, 56, 37, 18, 3]", - "total_badness": 839.17126404 + "ne3d": 528, + "quality_histogram": "[0, 0, 0, 1, 3, 3, 5, 6, 14, 33, 36, 50, 63, 70, 69, 69, 55, 27, 20, 4]", + "total_badness": 830.65240856 }, { "ne1d": 194, "ne2d": 594, - "ne3d": 1666, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 5, 16, 23, 59, 118, 160, 264, 288, 282, 255, 167, 27]", - "total_badness": 2197.5763632 + "ne3d": 1710, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 10, 15, 40, 73, 127, 207, 260, 276, 284, 223, 153, 40]", + "total_badness": 2293.663372 }, { "ne1d": 266, "ne2d": 986, - "ne3d": 4090, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 2, 11, 35, 59, 152, 324, 579, 738, 770, 768, 506, 145]", - "total_badness": 5178.06234 + "ne3d": 4084, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 3, 7, 32, 69, 144, 306, 518, 709, 824, 785, 548, 138]", + "total_badness": 5147.3961968 }, { "ne1d": 674, - "ne2d": 6856, - "ne3d": 82761, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 3, 10, 84, 220, 616, 1785, 4044, 8183, 13189, 17574, 18506, 14181, 4365]", - "total_badness": 101090.57562 + "ne2d": 6854, + "ne3d": 82879, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 3, 24, 61, 236, 636, 1697, 4041, 8182, 13143, 17498, 18865, 14126, 4366]", + "total_badness": 101181.66513 } ], "period.geo": [ { "ne1d": 344, - "ne2d": 1136, - "ne3d": 3291, - "quality_histogram": "[0, 0, 0, 0, 1, 6, 24, 38, 73, 142, 237, 280, 363, 430, 473, 394, 337, 293, 163, 37]", - "total_badness": 4941.6426523 + "ne2d": 1092, + "ne3d": 3101, + "quality_histogram": "[0, 0, 0, 0, 4, 13, 23, 64, 104, 148, 235, 320, 331, 363, 393, 363, 304, 218, 161, 57]", + "total_badness": 4789.6346919 }, { "ne1d": 160, - "ne2d": 286, - "ne3d": 642, - "quality_histogram": "[0, 0, 4, 7, 11, 22, 28, 28, 40, 61, 66, 58, 59, 55, 53, 53, 40, 36, 16, 5]", - "total_badness": 1235.2259283 + "ne2d": 272, + "ne3d": 588, + "quality_histogram": "[0, 0, 1, 7, 13, 20, 23, 41, 47, 50, 42, 56, 45, 47, 50, 51, 22, 47, 15, 11]", + "total_badness": 1132.5775066 }, { "ne1d": 232, - "ne2d": 598, - "ne3d": 1654, - "quality_histogram": "[5, 18, 43, 57, 47, 59, 62, 79, 117, 120, 126, 148, 134, 159, 134, 113, 117, 66, 39, 11]", - "total_badness": 3928.2006441 + "ne2d": 552, + "ne3d": 1329, + "quality_histogram": "[0, 0, 4, 13, 23, 41, 64, 69, 81, 107, 118, 125, 143, 114, 102, 95, 117, 58, 32, 23]", + "total_badness": 2516.6683318 }, { "ne1d": 344, - "ne2d": 1136, - "ne3d": 3221, - "quality_histogram": "[0, 0, 0, 0, 0, 3, 20, 24, 54, 111, 178, 268, 317, 453, 436, 450, 365, 311, 187, 44]", - "total_badness": 4704.9518805 + "ne2d": 1092, + "ne3d": 3060, + "quality_histogram": "[0, 0, 0, 0, 4, 9, 20, 47, 94, 129, 219, 274, 328, 371, 378, 370, 334, 265, 162, 56]", + "total_badness": 4632.1450094 }, { "ne1d": 480, - "ne2d": 2256, - "ne3d": 11709, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 9, 15, 51, 115, 243, 547, 966, 1489, 2032, 2273, 2081, 1459, 426]", - "total_badness": 14941.96653 + "ne2d": 2172, + "ne3d": 11163, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 5, 40, 73, 170, 308, 663, 985, 1444, 1852, 2071, 1910, 1223, 416]", + "total_badness": 14472.357604 }, { "ne1d": 820, - "ne2d": 6226, - "ne3d": 68532, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 18, 76, 261, 684, 1675, 3888, 7222, 11072, 14234, 14852, 11076, 3469]", - "total_badness": 84325.408672 + "ne2d": 6098, + "ne3d": 67286, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 7, 26, 114, 290, 816, 1898, 4057, 7076, 10984, 13871, 14152, 10618, 3377]", + "total_badness": 83173.133848 } ], "plane.stl": [ { "ne1d": 890, - "ne2d": 2620, - "ne3d": 8323, - "quality_histogram": "[5, 21, 28, 32, 53, 48, 47, 80, 151, 239, 321, 490, 681, 901, 1189, 1198, 1208, 892, 597, 142]", - "total_badness": 12887.967725 + "ne2d": 2626, + "ne3d": 8421, + "quality_histogram": "[6, 18, 26, 29, 58, 43, 65, 85, 138, 214, 343, 464, 720, 908, 1097, 1315, 1209, 968, 575, 140]", + "total_badness": 12967.318277 }, { - "ne1d": 572, - "ne2d": 1196, - "ne3d": 1793, - "quality_histogram": "[11, 31, 38, 55, 69, 104, 109, 132, 143, 150, 154, 158, 135, 136, 121, 82, 79, 51, 30, 5]", - "total_badness": 4800.1708991 + "ne1d": 570, + "ne2d": 1202, + "ne3d": 1774, + "quality_histogram": "[8, 27, 47, 59, 51, 69, 95, 141, 155, 166, 171, 148, 140, 137, 118, 85, 69, 60, 22, 6]", + "total_badness": 4640.8658317 }, { "ne1d": 724, - "ne2d": 1726, - "ne3d": 3259, - "quality_histogram": "[5, 19, 38, 39, 48, 38, 53, 68, 126, 153, 210, 276, 357, 394, 388, 356, 323, 218, 123, 27]", - "total_badness": 6069.660571 + "ne2d": 1730, + "ne3d": 3248, + "quality_histogram": "[6, 18, 34, 44, 44, 41, 60, 72, 119, 162, 214, 264, 370, 387, 415, 400, 299, 174, 99, 26]", + "total_badness": 6101.8771518 }, { "ne1d": 956, - "ne2d": 2820, - "ne3d": 8391, - "quality_histogram": "[3, 12, 32, 49, 46, 54, 59, 63, 86, 144, 250, 389, 575, 816, 1238, 1375, 1331, 1047, 665, 157]", - "total_badness": 12510.073302 + "ne2d": 2828, + "ne3d": 8439, + "quality_histogram": "[3, 11, 37, 49, 40, 52, 58, 66, 92, 139, 212, 389, 524, 821, 1168, 1367, 1403, 1167, 678, 163]", + "total_badness": 12501.380591 }, { "ne1d": 1554, - "ne2d": 6388, - "ne3d": 31455, - "quality_histogram": "[3, 7, 11, 8, 27, 51, 59, 79, 108, 196, 350, 697, 1388, 2535, 4050, 5292, 6175, 5518, 3822, 1079]", - "total_badness": 40980.318629 + "ne2d": 6372, + "ne3d": 31592, + "quality_histogram": "[4, 7, 14, 6, 20, 51, 59, 69, 107, 192, 374, 768, 1364, 2471, 3945, 5450, 6033, 5767, 3797, 1094]", + "total_badness": 41134.059548 }, { "ne1d": 2992, - "ne2d": 23328, - "ne3d": 276363, - "quality_histogram": "[4, 10, 12, 10, 7, 20, 37, 80, 203, 470, 1122, 2731, 6675, 14971, 28708, 44685, 57676, 60478, 45018, 13446]", - "total_badness": 340678.17837 + "ne2d": 23322, + "ne3d": 281009, + "quality_histogram": "[4, 10, 12, 10, 7, 26, 35, 86, 167, 454, 1176, 2879, 6743, 15159, 28763, 45456, 58769, 61389, 45901, 13963]", + "total_badness": 346296.38075 } ], "revolution.geo": [ { "ne1d": 320, - "ne2d": 3110, - "ne3d": 8443, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 12, 45, 144, 318, 519, 804, 967, 1078, 1145, 1112, 987, 738, 454, 119]", - "total_badness": 12356.528396 + "ne2d": 2976, + "ne3d": 8188, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 16, 79, 152, 311, 565, 736, 920, 1083, 1080, 1027, 960, 678, 480, 99]", + "total_badness": 12075.726682 }, { "ne1d": 160, - "ne2d": 822, - "ne3d": 1279, - "quality_histogram": "[0, 0, 0, 0, 2, 14, 52, 81, 100, 116, 148, 146, 167, 114, 92, 74, 92, 44, 25, 12]", - "total_badness": 2305.3064983 + "ne2d": 800, + "ne3d": 1311, + "quality_histogram": "[0, 0, 1, 2, 6, 25, 68, 91, 144, 135, 132, 130, 126, 109, 101, 88, 79, 40, 31, 3]", + "total_badness": 2483.2141758 }, { "ne1d": 240, - "ne2d": 1830, - "ne3d": 3870, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 5, 29, 108, 195, 310, 445, 521, 478, 473, 425, 351, 292, 195, 41]", - "total_badness": 5884.7598106 + "ne2d": 1768, + "ne3d": 3842, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 8, 29, 95, 175, 307, 416, 446, 505, 495, 424, 392, 324, 178, 48]", + "total_badness": 5778.3652899 }, { "ne1d": 320, - "ne2d": 3110, - "ne3d": 8269, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 0, 24, 69, 199, 438, 654, 876, 1057, 1127, 1199, 1061, 888, 548, 128]", - "total_badness": 11704.49421 + "ne2d": 2976, + "ne3d": 8011, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 5, 23, 86, 233, 422, 652, 798, 1026, 1099, 1107, 1023, 849, 566, 122]", + "total_badness": 11388.557884 }, { "ne1d": 480, - "ne2d": 6864, - "ne3d": 33003, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 5, 20, 80, 243, 674, 1446, 2651, 4133, 5647, 6385, 6118, 4423, 1178]", - "total_badness": 41802.827145 + "ne2d": 6626, + "ne3d": 32594, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 5, 18, 105, 295, 716, 1448, 2646, 4240, 5435, 6192, 6037, 4244, 1212]", + "total_badness": 41402.678067 }, { "ne1d": 800, - "ne2d": 17934, - "ne3d": 201498, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 44, 148, 603, 1656, 4364, 10078, 19992, 31915, 42284, 45543, 34094, 10774]", - "total_badness": 246262.93603 + "ne2d": 17454, + "ne3d": 200716, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 14, 52, 179, 608, 1704, 4559, 10434, 19984, 31785, 41963, 45605, 33701, 10126]", + "total_badness": 245716.04369 } ], "screw.step": [ { "ne1d": 400, - "ne2d": 1434, - "ne3d": 2427, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 14, 92, 79, 162, 203, 243, 285, 278, 277, 276, 216, 178, 97, 26]", - "total_badness": 3828.4168327 + "ne2d": 1480, + "ne3d": 2651, + "quality_histogram": "[0, 0, 2, 0, 7, 15, 48, 74, 114, 189, 194, 241, 282, 297, 335, 308, 242, 172, 102, 29]", + "total_badness": 4282.6220755 }, { "ne1d": 530, - "ne2d": 2702, - "ne3d": 7966, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 8, 30, 75, 152, 297, 462, 754, 1064, 1384, 1434, 1253, 807, 242]", - "total_badness": 10467.778337 + "ne2d": 2746, + "ne3d": 7967, + "quality_histogram": "[0, 2, 3, 1, 10, 18, 34, 59, 110, 180, 278, 411, 575, 811, 1049, 1251, 1297, 972, 713, 193]", + "total_badness": 11136.799459 }, { "ne1d": 668, - "ne2d": 5008, - "ne3d": 31630, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 5, 20, 43, 129, 317, 796, 1773, 3387, 5061, 6627, 6931, 5011, 1528]", - "total_badness": 38978.120895 + "ne2d": 5066, + "ne3d": 31896, + "quality_histogram": "[0, 0, 0, 0, 2, 7, 10, 24, 43, 106, 221, 502, 969, 2036, 3531, 5162, 6478, 6558, 4810, 1437]", + "total_badness": 39857.410858 } ], "sculpture.geo": [ { "ne1d": 192, - "ne2d": 414, - "ne3d": 475, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 5, 17, 18, 32, 62, 64, 97, 98, 41, 25, 11, 2]", - "total_badness": 692.44104062 + "ne2d": 398, + "ne3d": 456, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 2, 2, 11, 20, 37, 45, 57, 71, 77, 71, 38, 14, 9, 0]", + "total_badness": 702.3804118 }, { "ne1d": 102, - "ne2d": 146, - "ne3d": 141, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 5, 11, 19, 19, 36, 29, 17, 2]", - "total_badness": 178.07603683 + "ne2d": 144, + "ne3d": 137, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 10, 16, 17, 22, 29, 18, 18, 2]", + "total_badness": 178.33154961 }, { "ne1d": 144, - "ne2d": 250, - "ne3d": 263, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 7, 14, 24, 29, 53, 46, 49, 24, 7]", - "total_badness": 343.8094424 + "ne2d": 234, + "ne3d": 235, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 7, 11, 11, 25, 36, 49, 37, 32, 18, 2]", + "total_badness": 319.02266286 }, { "ne1d": 192, - "ne2d": 414, - "ne3d": 475, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 5, 17, 18, 32, 62, 64, 97, 98, 41, 25, 11, 2]", - "total_badness": 692.44104062 + "ne2d": 398, + "ne3d": 456, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 1, 2, 11, 21, 39, 46, 57, 70, 77, 70, 37, 14, 9, 0]", + "total_badness": 702.94908258 }, { "ne1d": 288, - "ne2d": 962, - "ne3d": 1326, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 6, 24, 53, 87, 122, 149, 125, 142, 117, 141, 144, 119, 80, 15]", - "total_badness": 2054.7475159 + "ne2d": 938, + "ne3d": 1253, + "quality_histogram": "[0, 0, 1, 0, 2, 6, 15, 34, 68, 89, 152, 139, 125, 125, 138, 126, 99, 59, 53, 22]", + "total_badness": 2054.7201979 }, { "ne1d": 480, - "ne2d": 2394, - "ne3d": 6791, - "quality_histogram": "[0, 0, 0, 0, 2, 3, 12, 10, 30, 33, 80, 135, 286, 503, 747, 1080, 1312, 1266, 984, 308]", - "total_badness": 8649.5978251 + "ne2d": 2324, + "ne3d": 6464, + "quality_histogram": "[0, 0, 0, 3, 7, 8, 17, 14, 20, 52, 96, 165, 302, 547, 852, 1076, 1204, 1135, 726, 240]", + "total_badness": 8431.4328551 } ], "shaft.geo": [ { "ne1d": 708, - "ne2d": 1722, - "ne3d": 2757, - "quality_histogram": "[22, 11, 27, 30, 41, 40, 46, 62, 79, 140, 264, 373, 303, 274, 231, 291, 233, 179, 86, 25]", - "total_badness": 6328.6329226 + "ne2d": 1674, + "ne3d": 2489, + "quality_histogram": "[0, 0, 0, 2, 3, 14, 17, 34, 79, 156, 378, 332, 260, 273, 229, 266, 219, 132, 70, 25]", + "total_badness": 4028.4511449 }, { "ne1d": 410, - "ne2d": 606, - "ne3d": 933, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 4, 1, 17, 25, 47, 58, 90, 116, 155, 146, 124, 96, 36, 17]", - "total_badness": 1336.5110795 + "ne2d": 586, + "ne3d": 869, + "quality_histogram": "[0, 0, 0, 0, 1, 2, 4, 17, 30, 46, 53, 64, 85, 80, 90, 104, 108, 115, 46, 24]", + "total_badness": 1295.3186437 }, { "ne1d": 510, - "ne2d": 1004, - "ne3d": 2048, - "quality_histogram": "[11, 74, 88, 69, 81, 94, 99, 125, 99, 122, 96, 133, 133, 165, 190, 186, 163, 67, 45, 8]", - "total_badness": 5937.4200337 + "ne2d": 970, + "ne3d": 1686, + "quality_histogram": "[0, 0, 12, 26, 56, 51, 61, 87, 109, 113, 134, 139, 159, 175, 176, 150, 125, 58, 39, 16]", + "total_badness": 3309.2557071 }, { "ne1d": 708, - "ne2d": 1722, - "ne3d": 2733, - "quality_histogram": "[6, 8, 10, 17, 29, 39, 34, 40, 80, 132, 254, 397, 302, 295, 238, 297, 250, 192, 88, 25]", - "total_badness": 4814.5951096 + "ne2d": 1674, + "ne3d": 2477, + "quality_histogram": "[0, 0, 0, 2, 1, 9, 15, 36, 69, 148, 389, 328, 265, 262, 218, 288, 215, 130, 77, 25]", + "total_badness": 3983.0754336 }, { "ne1d": 1138, - "ne2d": 4220, - "ne3d": 11242, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 1, 27, 78, 178, 382, 607, 934, 1459, 1772, 2147, 1927, 1325, 403]", - "total_badness": 14539.392197 + "ne2d": 4078, + "ne3d": 10809, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 7, 19, 55, 142, 282, 437, 680, 1039, 1406, 1781, 1874, 1704, 1061, 321]", + "total_badness": 14354.482904 }, { "ne1d": 1792, - "ne2d": 10600, - "ne3d": 63895, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 18, 53, 198, 529, 1486, 3387, 6482, 10124, 13426, 13922, 10754, 3514]", - "total_badness": 78232.724768 + "ne2d": 10390, + "ne3d": 61428, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 7, 36, 113, 262, 726, 1670, 3519, 6476, 9764, 12505, 13045, 10002, 3302]", + "total_badness": 75768.180822 } ], "sphere.geo": [ { "ne1d": 0, - "ne2d": 126, - "ne3d": 126, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 6, 25, 47, 33, 12, 1, 2, 0, 0, 0, 0, 0]", - "total_badness": 237.42979301 + "ne2d": 110, + "ne3d": 110, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 29, 47, 6, 7, 6, 2, 4, 0, 1, 3, 0]", + "total_badness": 205.55211745 }, { "ne1d": 0, - "ne2d": 56, - "ne3d": 56, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 18, 19, 15, 0, 0]", - "total_badness": 68.826138928 + "ne2d": 52, + "ne3d": 52, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 4, 13, 14, 13, 3, 0]", + "total_badness": 65.101112061 }, { "ne1d": 0, - "ne2d": 72, - "ne3d": 72, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14, 27, 22, 7, 0, 0, 0]", - "total_badness": 97.572347502 + "ne2d": 68, + "ne3d": 68, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 14, 24, 8, 7, 5, 4, 1, 2]", + "total_badness": 96.707948617 }, { "ne1d": 0, - "ne2d": 126, - "ne3d": 126, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 6, 25, 47, 33, 12, 1, 2, 0, 0, 0, 0, 0]", - "total_badness": 237.42979301 + "ne2d": 110, + "ne3d": 110, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 29, 47, 6, 7, 6, 2, 4, 0, 1, 3, 0]", + "total_badness": 205.55211745 }, { "ne1d": 0, - "ne2d": 258, - "ne3d": 366, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 6, 22, 32, 55, 47, 62, 28, 39, 31, 22, 15, 6]", - "total_badness": 562.00749621 + "ne2d": 254, + "ne3d": 350, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 8, 28, 47, 48, 43, 51, 47, 20, 20, 20, 10, 6]", + "total_badness": 555.65023551 }, { "ne1d": 0, - "ne2d": 660, - "ne3d": 2329, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 10, 28, 76, 158, 282, 415, 502, 433, 327, 91]", - "total_badness": 2913.3426209 + "ne2d": 656, + "ne3d": 2286, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 15, 37, 92, 152, 276, 397, 471, 429, 303, 111]", + "total_badness": 2868.3272967 } ], "sphereincube.geo": [ { "ne1d": 46, - "ne2d": 202, - "ne3d": 490, - "quality_histogram": "[0, 0, 8, 59, 42, 29, 53, 45, 55, 46, 33, 14, 16, 11, 15, 12, 12, 24, 11, 5]", - "total_badness": 1429.7083119 + "ne2d": 182, + "ne3d": 445, + "quality_histogram": "[0, 0, 7, 60, 44, 43, 53, 44, 55, 33, 27, 23, 10, 12, 11, 12, 5, 2, 4, 0]", + "total_badness": 1401.4502735 }, { "ne1d": 24, "ne2d": 60, "ne3d": 166, - "quality_histogram": "[0, 0, 5, 12, 14, 15, 31, 10, 2, 1, 3, 2, 7, 9, 13, 13, 15, 9, 4, 1]", - "total_badness": 454.94795255 + "quality_histogram": "[0, 0, 8, 15, 17, 13, 17, 7, 5, 4, 3, 4, 14, 4, 10, 15, 9, 15, 5, 1]", + "total_badness": 472.78592323 }, { "ne1d": 30, - "ne2d": 116, - "ne3d": 345, - "quality_histogram": "[0, 0, 5, 24, 43, 41, 26, 26, 38, 32, 20, 18, 24, 14, 8, 9, 5, 7, 4, 1]", - "total_badness": 988.81847916 + "ne2d": 104, + "ne3d": 294, + "quality_histogram": "[0, 0, 6, 19, 18, 35, 35, 32, 30, 29, 22, 15, 12, 6, 16, 5, 7, 4, 3, 0]", + "total_badness": 831.78873831 }, { "ne1d": 46, - "ne2d": 202, - "ne3d": 498, - "quality_histogram": "[0, 0, 8, 41, 27, 29, 50, 44, 55, 58, 44, 25, 20, 15, 14, 15, 13, 24, 11, 5]", - "total_badness": 1326.92489 + "ne2d": 182, + "ne3d": 443, + "quality_histogram": "[0, 0, 6, 47, 35, 45, 57, 44, 50, 34, 25, 31, 13, 15, 15, 13, 6, 3, 4, 0]", + "total_badness": 1315.3011324 }, { "ne1d": 74, - "ne2d": 418, - "ne3d": 1788, - "quality_histogram": "[0, 0, 0, 0, 0, 6, 6, 21, 28, 38, 73, 98, 167, 213, 251, 273, 258, 200, 112, 44]", - "total_badness": 2540.547751 + "ne2d": 384, + "ne3d": 1597, + "quality_histogram": "[0, 0, 0, 0, 2, 7, 12, 21, 27, 49, 80, 121, 170, 205, 219, 215, 191, 158, 92, 28]", + "total_badness": 2350.3326171 }, { "ne1d": 122, - "ne2d": 1082, - "ne3d": 14039, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 5, 31, 105, 218, 465, 893, 1497, 2202, 2857, 2912, 2179, 674]", - "total_badness": 17464.78638 + "ne2d": 1048, + "ne3d": 13579, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 8, 17, 66, 160, 274, 542, 950, 1530, 2203, 2751, 2677, 1867, 534]", + "total_badness": 17161.325004 } ], "torus.geo": [ { "ne1d": 0, - "ne2d": 2534, - "ne3d": 5745, - "quality_histogram": "[0, 0, 0, 0, 0, 4, 19, 59, 148, 286, 440, 581, 679, 796, 742, 668, 583, 418, 238, 84]", - "total_badness": 8709.4458795 + "ne2d": 2514, + "ne3d": 5726, + "quality_histogram": "[0, 0, 0, 0, 0, 22, 36, 90, 173, 330, 475, 680, 762, 771, 679, 619, 489, 354, 187, 59]", + "total_badness": 8967.2870294 }, { "ne1d": 0, - "ne2d": 692, - "ne3d": 3181, - "quality_histogram": "[166, 714, 477, 367, 312, 232, 199, 167, 108, 100, 92, 66, 48, 39, 30, 27, 18, 13, 6, 0]", - "total_badness": 24641.250872 + "ne2d": 670, + "ne3d": 2988, + "quality_histogram": "[127, 598, 433, 338, 287, 207, 194, 144, 150, 118, 102, 79, 66, 48, 36, 23, 15, 15, 6, 2]", + "total_badness": 21069.350308 }, { "ne1d": 0, - "ne2d": 1446, - "ne3d": 2743, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 14, 62, 135, 247, 356, 403, 430, 384, 298, 200, 152, 59]", - "total_badness": 3928.1549928 + "ne2d": 1426, + "ne3d": 2701, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 7, 25, 75, 171, 327, 369, 435, 378, 339, 263, 179, 101, 31]", + "total_badness": 3988.6535111 }, { "ne1d": 0, - "ne2d": 2534, - "ne3d": 5584, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 27, 78, 171, 346, 509, 649, 760, 771, 771, 646, 472, 283, 100]", - "total_badness": 8111.5941443 + "ne2d": 2514, + "ne3d": 5554, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 9, 46, 105, 218, 384, 584, 704, 751, 700, 704, 577, 454, 249, 67]", + "total_badness": 8273.8939465 }, { "ne1d": 0, - "ne2d": 5894, - "ne3d": 25294, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 9, 32, 149, 417, 947, 1723, 2990, 4145, 5146, 5002, 3604, 1129]", - "total_badness": 31642.969488 + "ne2d": 5842, + "ne3d": 24282, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 19, 81, 228, 548, 1135, 1947, 3128, 4133, 4719, 4422, 3081, 838]", + "total_badness": 30913.936434 }, { "ne1d": 0, - "ne2d": 16296, - "ne3d": 175351, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 7, 36, 115, 401, 1106, 3230, 8059, 16480, 27460, 37219, 40628, 30958, 9652]", - "total_badness": 213157.95506 + "ne2d": 16170, + "ne3d": 174079, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 6, 34, 138, 426, 1276, 3495, 8503, 16924, 27371, 37192, 39797, 29753, 9164]", + "total_badness": 212322.15571 } ], "trafo.geo": [ { "ne1d": 690, - "ne2d": 1684, - "ne3d": 5231, - "quality_histogram": "[0, 2, 2, 2, 8, 24, 37, 50, 114, 203, 267, 363, 472, 583, 649, 706, 623, 527, 462, 137]", - "total_badness": 7683.599832 + "ne2d": 1650, + "ne3d": 5153, + "quality_histogram": "[1, 4, 0, 2, 6, 22, 48, 90, 149, 211, 324, 377, 461, 583, 666, 681, 571, 443, 413, 101]", + "total_badness": 7797.9450152 }, { "ne1d": 390, - "ne2d": 522, + "ne2d": 518, "ne3d": 1353, - "quality_histogram": "[0, 0, 3, 17, 15, 42, 75, 123, 130, 146, 161, 124, 147, 105, 84, 88, 47, 33, 11, 2]", - "total_badness": 2768.022266 + "quality_histogram": "[0, 0, 4, 13, 32, 32, 71, 125, 125, 144, 170, 148, 134, 115, 95, 68, 33, 21, 22, 1]", + "total_badness": 2785.2527917 }, { "ne1d": 512, - "ne2d": 874, - "ne3d": 2397, - "quality_histogram": "[0, 0, 1, 3, 9, 23, 41, 72, 132, 142, 188, 204, 304, 389, 343, 237, 138, 97, 48, 26]", - "total_badness": 3983.5650135 + "ne2d": 858, + "ne3d": 2354, + "quality_histogram": "[0, 0, 1, 2, 11, 27, 57, 67, 161, 182, 217, 250, 264, 284, 290, 258, 140, 47, 59, 37]", + "total_badness": 4028.6466008 }, { "ne1d": 690, - "ne2d": 1684, - "ne3d": 5147, - "quality_histogram": "[0, 0, 0, 1, 3, 12, 26, 40, 106, 188, 272, 357, 422, 561, 671, 714, 608, 558, 474, 134]", - "total_badness": 7408.6135626 + "ne2d": 1650, + "ne3d": 5071, + "quality_histogram": "[0, 0, 0, 1, 3, 16, 36, 81, 130, 210, 298, 368, 444, 592, 658, 654, 583, 456, 437, 104]", + "total_badness": 7501.8324545 }, { "ne1d": 1050, - "ne2d": 3812, - "ne3d": 18010, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 29, 42, 57, 198, 540, 1405, 2251, 2392, 2790, 2784, 2612, 2242, 664]", - "total_badness": 23560.24016 + "ne2d": 3712, + "ne3d": 17430, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 7, 31, 58, 112, 236, 621, 1624, 2131, 2389, 2547, 2560, 2483, 2004, 627]", + "total_badness": 23088.888517 }, { "ne1d": 1722, - "ne2d": 10042, - "ne3d": 84690, - "quality_histogram": "[0, 0, 0, 0, 2, 3, 54, 1424, 754, 408, 795, 1316, 2637, 5766, 9155, 13453, 16224, 16583, 12169, 3947]", - "total_badness": 108937.41902 + "ne2d": 9888, + "ne3d": 83916, + "quality_histogram": "[0, 0, 0, 2, 3, 9, 103, 1417, 624, 529, 1028, 1656, 3206, 6128, 9176, 13176, 15913, 15495, 11729, 3722]", + "total_badness": 108897.74798 } ], "twobricks.geo": [ @@ -1370,17 +1370,17 @@ }, { "ne1d": 116, - "ne2d": 134, - "ne3d": 177, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 10, 18, 38, 22, 27, 22, 18, 7]", - "total_badness": 234.47359 + "ne2d": 122, + "ne3d": 149, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 10, 25, 25, 30, 19, 17, 7, 7, 4]", + "total_badness": 210.92258874 }, { "ne1d": 186, - "ne2d": 346, - "ne3d": 603, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 25, 42, 66, 89, 101, 110, 93, 56, 10]", - "total_badness": 792.88605666 + "ne2d": 308, + "ne3d": 535, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 18, 51, 66, 92, 87, 77, 61, 61, 10]", + "total_badness": 711.81286081 } ], "twocubes.geo": [ @@ -1414,61 +1414,61 @@ }, { "ne1d": 116, - "ne2d": 134, - "ne3d": 177, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 10, 18, 38, 22, 27, 22, 18, 7]", - "total_badness": 234.47359 + "ne2d": 122, + "ne3d": 149, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 10, 25, 25, 30, 19, 17, 7, 7, 4]", + "total_badness": 210.92258874 }, { "ne1d": 186, - "ne2d": 346, - "ne3d": 603, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 25, 42, 66, 89, 101, 110, 93, 56, 10]", - "total_badness": 792.88605666 + "ne2d": 308, + "ne3d": 535, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 18, 51, 66, 92, 87, 77, 61, 61, 10]", + "total_badness": 711.81286081 } ], "twocyl.geo": [ { "ne1d": 144, - "ne2d": 408, - "ne3d": 576, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 12, 19, 19, 17, 36, 50, 59, 82, 90, 73, 69, 34, 13, 1]", - "total_badness": 901.75131743 + "ne2d": 406, + "ne3d": 539, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 5, 12, 24, 30, 56, 49, 74, 67, 67, 60, 43, 38, 12, 1]", + "total_badness": 858.68248624 }, { "ne1d": 68, "ne2d": 100, - "ne3d": 209, - "quality_histogram": "[0, 0, 0, 1, 3, 6, 11, 2, 8, 5, 15, 18, 12, 28, 28, 27, 24, 17, 3, 1]", - "total_badness": 357.15447323 + "ne3d": 188, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 6, 14, 23, 27, 28, 25, 22, 28, 8, 0]", + "total_badness": 267.41201716 }, { "ne1d": 102, - "ne2d": 238, - "ne3d": 548, - "quality_histogram": "[5, 24, 23, 35, 33, 46, 49, 52, 63, 39, 19, 20, 19, 22, 19, 24, 40, 14, 2, 0]", - "total_badness": 1932.6124156 + "ne2d": 236, + "ne3d": 561, + "quality_histogram": "[1, 8, 41, 60, 42, 46, 41, 50, 53, 36, 27, 27, 22, 15, 18, 17, 38, 5, 11, 3]", + "total_badness": 1876.9984411 }, { "ne1d": 144, - "ne2d": 408, - "ne3d": 576, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 12, 10, 12, 24, 41, 69, 88, 108, 88, 65, 40, 13, 2]", - "total_badness": 853.37034747 + "ne2d": 406, + "ne3d": 538, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 3, 12, 20, 25, 50, 52, 82, 65, 67, 64, 41, 39, 14, 2]", + "total_badness": 848.06909289 }, { "ne1d": 214, - "ne2d": 910, - "ne3d": 1921, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 33, 75, 117, 230, 320, 358, 348, 243, 159, 28]", - "total_badness": 2544.8927759 + "ne2d": 900, + "ne3d": 1820, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 43, 103, 172, 235, 307, 303, 304, 187, 120, 28]", + "total_badness": 2474.9963091 }, { "ne1d": 350, - "ne2d": 2374, - "ne3d": 13509, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 11, 29, 98, 286, 655, 1353, 2161, 2913, 3068, 2220, 713]", - "total_badness": 16499.785789 + "ne2d": 2350, + "ne3d": 13336, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 12, 34, 122, 330, 749, 1426, 2105, 2852, 2877, 2178, 649]", + "total_badness": 16385.529152 } ] } \ No newline at end of file diff --git a/tests/pytest/test_tutorials.py b/tests/pytest/test_tutorials.py index 32d53d50..169a8856 100644 --- a/tests/pytest/test_tutorials.py +++ b/tests/pytest/test_tutorials.py @@ -28,7 +28,7 @@ def checkData(mesh, mp, ref): assert ref['ne1d'] == data['ne1d'] assert ref['ne2d'] == data['ne2d'] assert ref['ne3d'] == data['ne3d'] - assert ref['quality_histogram'] == data['quality_histogram'] + assert json.loads(ref['quality_histogram']) == pytest.approx(json.loads(data['quality_histogram']), abs=1, rel=0.4) assert ref['total_badness'] == pytest.approx(data['total_badness'], rel=1e-5) # get tutorials