diff --git a/Common/Context.h b/Common/Context.h index f5c79550cc1ef3e7b0ae8209d1065284164264af..c521b4507b8a9a86f0e27650fc042a61aa0b6740 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -48,6 +48,7 @@ struct contextMeshOptions { std::map<int,int> curvature_control_per_face; int bunin; int ignorePartBound; + double delaunayQ; }; struct contextGeometryOptions { diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index a0a4327b064be6c67ee939280909531e791f72e6..19399b623f9bda1ea1cf0497894660e7870af9c0 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -900,6 +900,8 @@ StringXNumber MeshOptions_Number[] = { { F, "CpuTime" , opt_mesh_cpu_time , 0. , "CPU time (in seconds) for the generation of the current mesh (read-only)" }, + { F|O, "DelaunayQ" , opt_mesh_delaunay_q , 3.5 , + "Quality factor for initial Delaunay tetrahedralization" }, { F|O, "DrawSkinOnly" , opt_mesh_draw_skin_only , 0. , "Draw only the skin of 3D meshes?" }, { F|O, "Dual" , opt_mesh_dual , 0. , diff --git a/Common/Options.cpp b/Common/Options.cpp index fa1671862f3f6b4fa24d532216882f86db70824b..d910c42fa26b3580ddcfb21792666bc0d1ae29b4 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -4586,6 +4586,13 @@ double opt_mesh_rand_factor(OPT_ARGS_NUM) return CTX::instance()->mesh.randFactor; } +double opt_mesh_delaunay_q(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->mesh.delaunayQ = val; + return CTX::instance()->mesh.delaunayQ; +} + double opt_mesh_quality_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { diff --git a/Common/Options.h b/Common/Options.h index 834016f61274f4edeaae73402007523d5c44573b..78cb4ecad10b7a9028d225dde73afde01856ff44 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -364,6 +364,7 @@ double opt_mesh_rand_factor(OPT_ARGS_NUM); double opt_mesh_quality_inf(OPT_ARGS_NUM); double opt_mesh_quality_sup(OPT_ARGS_NUM); double opt_mesh_quality_type(OPT_ARGS_NUM); +double opt_mesh_delaunay_q(OPT_ARGS_NUM); double opt_mesh_radius_inf(OPT_ARGS_NUM); double opt_mesh_radius_sup(OPT_ARGS_NUM); double opt_mesh_label_type(OPT_ARGS_NUM); diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp index 8faa8f434fe2a8727152c348bdb0923639c9df53..97eadb06339e4f153bb1527772defb22a8a169f0 100644 --- a/Mesh/meshGRegion.cpp +++ b/Mesh/meshGRegion.cpp @@ -564,8 +564,9 @@ void MeshDelaunayVolume(std::vector<GRegion*> ®ions) (Msg::GetVerbosity() > 6) ? 'V': '\0'); } else { - sprintf(opts, "Ype%c", (Msg::GetVerbosity() < 3) ? 'Q': - (Msg::GetVerbosity() > 6) ? 'V': '\0'); + sprintf(opts, "-q%gYpe%c", CTX::instance()->mesh.delaunayQ, + (Msg::GetVerbosity() < 3) ? 'Q': + (Msg::GetVerbosity() > 6) ? 'V': '\0'); } try{ tetrahedralize(opts, &in, &out);