From c7f8ed657c18bbab543e8690b79ae4098472d04d Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 20 Jul 2018 19:36:14 +0300 Subject: [PATCH] Prevent failure of the second compute in case of not closed 2D mesh --- src/GUI/NETGENPlugin_images.ts | 4 ++++ src/NETGENPlugin/NETGENPlugin_Remesher_2D.cxx | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/GUI/NETGENPlugin_images.ts b/src/GUI/NETGENPlugin_images.ts index a399bc6..7197386 100644 --- a/src/GUI/NETGENPlugin_images.ts +++ b/src/GUI/NETGENPlugin_images.ts @@ -47,6 +47,10 @@ ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D mesh_tree_hypo_netgen_2d.png + + ICON_SMESH_TREE_HYPO_NETGEN_RemesherParameters_2D + mesh_tree_hypo_netgen_2d.png + ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D_ONLY mesh_tree_hypo_netgen_2d.png diff --git a/src/NETGENPlugin/NETGENPlugin_Remesher_2D.cxx b/src/NETGENPlugin/NETGENPlugin_Remesher_2D.cxx index aff9f00..03141b1 100644 --- a/src/NETGENPlugin/NETGENPlugin_Remesher_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Remesher_2D.cxx @@ -43,7 +43,7 @@ #include #include #include -//#include +//#include #include @@ -56,6 +56,10 @@ using namespace nglib; // #endif // extern STLParameters stlparam; // } +namespace nglib +{ + extern netgen::Array > 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 ); -- 2.39.2