14 bool preserve_topology =
false;
15 std::string output_path;
17 double epsr_simplify = 2e-3;
18 double eps_simplify = -1.;
24 double splitting_l2 = -1.;
25 double collapsing_l2 =
26 std::numeric_limits<double>::max();
28 double stop_energy = 10;
29 bool stop_at_float =
false;
31 bool debug_output =
false;
32 bool perform_sanity_checks =
false;
35 double w_amips = 1e-4;
36 double w_envelope = 0;
38 std::string operation =
"remeshing";
40 bool skip_simplify =
true;
41 bool use_sample_envelope =
false;
44 bool write_vtu =
false;
45 bool write_envelope =
true;
51 output_path = json_params[
"output"];
52 skip_simplify = json_params[
"skip_simplify"];
53 use_sample_envelope = json_params[
"use_sample_envelope"];
54 NUM_THREADS = json_params[
"num_threads"];
55 max_its = json_params[
"max_iterations"];
56 write_vtu = json_params[
"write_vtu"];
57 write_envelope = json_params[
"write_envelope"];
59 epsr = json_params[
"eps_rel"];
60 eps = json_params[
"eps"];
61 lr = json_params[
"length_rel"];
62 l = json_params[
"length"];
63 stop_energy = json_params[
"stop_energy"];
64 stop_at_float = json_params[
"stop_at_float"];
65 preserve_topology = json_params[
"preserve_topology"];
67 epsr_simplify = json_params[
"eps_simplify_rel"];
68 eps_simplify = json_params[
"eps_simplify"];
70 w_amips = json_params[
"w_amips"];
72 debug_output = json_params[
"DEBUG_output"];
73 perform_sanity_checks = json_params[
"DEBUG_sanity_checks"];
75 operation = json_params[
"operation"];
78 void init(
const VectorXd& min_,
const VectorXd& max_)
82 diag_l = (box_max - box_min).norm();
87 splitting_l2 = l * l * (16 / 9.);
88 collapsing_l2 = l * l * (16 / 25.);
96 if (eps_simplify > 0) {
97 epsr_simplify = eps_simplify / diag_l;
99 eps_simplify = epsr_simplify * diag_l;
105 const std::vector<Vector3d>& vertices,
106 const std::vector<std::array<size_t, 3>>& faces)
109 for (
size_t i = 0; i < vertices.size(); i++) {
115 for (
int j = 0; j < 3; j++) {
116 if (vertices[i][j] < min_[j]) min_[j] = vertices[i][j];
117 if (vertices[i][j] > max_[j]) max_[j] = vertices[i][j];