]> SALOME platform Git repositories - plugins/netgenplugin.git/blobdiff - src/NETGENPlugin/NETGENPlugin_Remesher_2D.cxx
Salome HOME
Prevent failure of the second compute in case of not closed 2D mesh
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Remesher_2D.cxx
index aff9f00f5cbc165c3b08da5e900896c355aa4c2c..03141b112fd2be960cd480ffcf78ca4f27f026ba 100644 (file)
@@ -43,7 +43,7 @@
 #include <occgeom.hpp>
 #include <meshing.hpp>
 #include <stlgeom.hpp>
-//#include <stltool.hxx>
+//#include <stltool.hpp>
 
 #include <boost/container/flat_set.hpp>
 
@@ -56,6 +56,10 @@ using namespace nglib;
 // #endif
 //   extern STLParameters stlparam;
 // }
+namespace nglib
+{
+  extern netgen::Array<netgen::Point<3> > readedges;
+}
 
 namespace
 {
@@ -215,6 +219,8 @@ namespace
 
   void HoleFiller::AddHoleBorders( Ng_STL_Geometry * ngStlGeo )
   {
+    nglib::readedges.SetSize(0);
+
     for ( size_t i = 0; i < myHole.size(); ++i )
       for ( size_t iP = 1; iP < myHole[i].size(); ++iP )
       {
@@ -591,6 +597,12 @@ bool NETGENPlugin_Remesher_2D::Compute(SMESH_Mesh&         theMesh,
     netgen::mparam.minh = netgen::mparam.maxh;
   }
 
+  // TODO: expose stlparam.resth* to the user
+  // netgen::stlparam.resthcloseedgeenable = 0; // Restrict H due to close edges
+  // netgen::stlparam.resthlinelengthenable = 0; // Restrict H due to line-length
+  // netgen::stlparam.resthatlasenable = 0;
+  // //netgen::stlparam.resthchartdistenable = 0;
+
   double h = netgen::mparam.maxh;
   ngMesh->SetGlobalH( h );
   ngMesh->SetMinimalH( netgen::mparam.minh );