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