Prevent failure of the second compute in case of not closed 2D mesh

This commit is contained in:
eap 2018-07-20 19:36:14 +03:00
parent 671f63a4da
commit c7f8ed657c
2 changed files with 17 additions and 1 deletions

View File

@ -47,6 +47,10 @@
<source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D</source> <source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D</source>
<translation>mesh_tree_hypo_netgen_2d.png</translation> <translation>mesh_tree_hypo_netgen_2d.png</translation>
</message> </message>
<message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_RemesherParameters_2D</source>
<translation>mesh_tree_hypo_netgen_2d.png</translation>
</message>
<message> <message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D_ONLY</source> <source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D_ONLY</source>
<translation>mesh_tree_hypo_netgen_2d.png</translation> <translation>mesh_tree_hypo_netgen_2d.png</translation>

View File

@ -43,7 +43,7 @@
#include <occgeom.hpp> #include <occgeom.hpp>
#include <meshing.hpp> #include <meshing.hpp>
#include <stlgeom.hpp> #include <stlgeom.hpp>
//#include <stltool.hxx> //#include <stltool.hpp>
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
@ -56,6 +56,10 @@ using namespace nglib;
// #endif // #endif
// extern STLParameters stlparam; // extern STLParameters stlparam;
// } // }
namespace nglib
{
extern netgen::Array<netgen::Point<3> > readedges;
}
namespace namespace
{ {
@ -215,6 +219,8 @@ namespace
void HoleFiller::AddHoleBorders( Ng_STL_Geometry * ngStlGeo ) void HoleFiller::AddHoleBorders( Ng_STL_Geometry * ngStlGeo )
{ {
nglib::readedges.SetSize(0);
for ( size_t i = 0; i < myHole.size(); ++i ) for ( size_t i = 0; i < myHole.size(); ++i )
for ( size_t iP = 1; iP < myHole[i].size(); ++iP ) 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; 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; double h = netgen::mparam.maxh;
ngMesh->SetGlobalH( h ); ngMesh->SetGlobalH( h );
ngMesh->SetMinimalH( netgen::mparam.minh ); ngMesh->SetMinimalH( netgen::mparam.minh );