Wildmeshing Toolkit
Loading...
Searching...
No Matches
Parameters.h
1#pragma once
2
3#include <wmtk/OptimizerParameters.h>
4
5namespace wmtk::components::tetwild {
8{
13 Vector3d min = Vector3d::Zero();
14 Vector3d max = Vector3d::Ones();
15 Vector3d box_min = Vector3d::Zero();
16 Vector3d box_max = Vector3d::Ones();
17
18 // Allow the edge swaps (3->2, 4-4, 5-6) to operate on surface edges as a
19 // topology-preserving surface diagonal flip, instead of forbidding them
20 // outright. Enabled by default; can be turned off to reproduce the old
21 // surface-frozen behavior for A/B testing.
22 bool allow_surface_swap = true;
23 // Expensive debug check: verify the global surface topology signature
24 // (connected components, Euler characteristic, boundary loops) is unchanged
25 // across each swap pass. Off by default (used by tests / debugging).
26 bool check_surface_topology = false;
27
28 void init(const Vector3d& min_, const Vector3d& max_)
29 {
30 min = min_;
31 max = max_;
32 init_lengths_from_diagonal((max - min).norm());
33 l_min = eps;
34 }
35 void init(
36 const std::vector<Vector3d>& vertices,
37 const std::vector<std::array<size_t, 3>>& faces)
38 {
39 Vector3d min_, max_;
40 for (size_t i = 0; i < vertices.size(); i++) {
41 if (i == 0) {
42 min_ = vertices[i];
43 max_ = vertices[i];
44 continue;
45 }
46 for (int j = 0; j < 3; j++) {
47 if (vertices[i][j] < min_[j]) min_[j] = vertices[i][j];
48 if (vertices[i][j] > max_[j]) max_[j] = vertices[i][j];
49 }
50 }
51
52 init(min_, max_);
53 }
54};
55} // namespace wmtk::components::tetwild
The parameters tetwild, triwild and simwild all share.
Definition OptimizerParameters.h:28
void init_lengths_from_diagonal(const double diag)
Derive the edge-length and envelope quantities from the bounding-box diagonal.
Definition OptimizerParameters.h:309
The fields shared with triwild and simwild live in wmtk::OptimizerParameters.
Definition Parameters.h:8
double order2_envelope_ratio
Definition Parameters.h:12