PolyFEM
Loading...
Searching...
No Matches
MMGRemesh.hpp
Go to the documentation of this file.
1// Original source from cellogram (https://github.com/cellogram/cellogram/blob/master/src/cellogram/remesh_adaptive.h)
2// Authors: Tobias Lendenmann, Teseo Schneider, Jérémie Dumas, Marco Tarini
3// License: MIT (https://github.com/cellogram/cellogram/blob/master/LICENSE)
4
5#pragma once
6
7#ifdef POLYFEM_WITH_MMG
8
10#include <Eigen/Dense>
11
12#include <vector>
14
15namespace polyfem::mesh
16{
17
18 // See MmgTools documentation for interpreation
19 // https://www.mmgtools.org/mmg-remesher-try-mmg/mmg-remesher-options
20 //
21 struct MmgOptions
22 {
23 /* Remeshing */
24 bool angle_detection = true;
25 double angle_value = 45.;
26 double hausd = 0.01;
27 double hsiz = 0.0; /* using hmin and hmax if set to 0 */
28 double hmin = 0.01;
29 double hmax = 2.;
30 double hgrad = 1.105171;
31 bool enable_anisotropy = false;
32 bool optim = false;
33 bool optimLES = false;
34 bool opnbdy = false;
35 bool noinsert = false;
36 bool noswap = false;
37 bool nomove = false;
38 bool nosurf = false;
39 std::string metric_attribute = "no_metric";
40 /* Level set extraction */
41 bool level_set = false;
42 std::string ls_attribute = "no_ls";
43 double ls_value = 0.;
44 };
45
53 bool remesh_2d(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F,
54 Eigen::MatrixXd &OV, Eigen::MatrixXi &OF,
55 MmgOptions opt = MmgOptions(),
56 const std::vector<int> *pinned_vertices = nullptr);
57
66 void remesh_adaptive_2d(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::VectorXd &S,
67 Eigen::MatrixXd &OV, Eigen::MatrixXi &OF, MmgOptions opt = MmgOptions());
68
76 bool remesh_3d(const Eigen::MatrixXd &V, const Eigen::MatrixXi &T,
77 Eigen::MatrixXd &OV, Eigen::MatrixXi &OF, Eigen::MatrixXi &OT,
78 MmgOptions opt = MmgOptions(),
79 const std::vector<int> *pinned_vertices = nullptr);
80
91 void remesh_adaptive_3d(const Eigen::MatrixXd &V, const Eigen::MatrixXi &T, const Eigen::VectorXd &S,
92 Eigen::MatrixXd &OV, Eigen::MatrixXi &OF, Eigen::MatrixXi &OT, MmgOptions opt = MmgOptions());
93
94} // namespace polyfem::mesh
95
96#endif
int V