3#include <wmtk/OptimizerParameters.h>
5#include <nlohmann/json.hpp>
7namespace wmtk::components::triwild {
11 Vector2d box_min = Vector2d::Zero();
12 Vector2d box_max = Vector2d::Ones();
82 epsr = json_params[
"eps_rel"];
83 lr = json_params[
"length_rel"];
84 stop_energy = json_params[
"stop_energy"];
85 preserve_topology = json_params[
"preserve_topology"];
90 debug_output = json_params[
"DEBUG_output"];
91 perform_sanity_checks = json_params[
"DEBUG_sanity_checks"];
96 w_amips = json_params[
"w_amips"];
101 interleaved_smoothing = json_params[
"interleaved_smoothing"];
102 interleaved_smoothing_passes = json_params[
"interleaved_smoothing_passes"];
115 stuck_refine_stall_eps = json_params[
"stuck_refine_stall_eps"];
116 stuck_refine_cooldown = json_params[
"stuck_refine_cooldown"];
117 stuck_refine_num_worst = json_params[
"stuck_refine_num_worst"];
118 stuck_refine_rings = json_params[
"stuck_refine_rings"];
119 stuck_refine_factor = json_params[
"stuck_refine_factor"];
120 stuck_refine_min_scalar = json_params[
"stuck_refine_min_scalar"];
121 stuck_refine_gradation = json_params[
"stuck_refine_gradation"];
122 stuck_refine_force_split = json_params[
"stuck_refine_force_split"];
125 skip_good_regions = json_params[
"skip_good_regions"];
126 skip_good_regions_margin = json_params[
"skip_good_regions_margin"];
129 void init(
const Vector2d& min_,
const Vector2d& max_)
137 const std::vector<Vector2d>& vertices,
138 const std::vector<std::array<size_t, 3>>& faces)
141 for (
size_t i = 0; i < vertices.size(); i++) {
147 for (
int j = 0; j < 2; j++) {
148 if (vertices[i][j] < min_[j]) {
149 min_[j] = vertices[i][j];
151 if (vertices[i][j] > max_[j]) {
152 max_[j] = vertices[i][j];
The parameters tetwild, triwild and simwild all share.
Definition OptimizerParameters.h:29
int project_line_search_nested_steps
Partial-projection bisections tried after it gives up; 0 disables that pass.
Definition OptimizerParameters.h:178
double w_amips
Definition OptimizerParameters.h:172
int coarsen_max_inner_passes
Definition OptimizerParameters.h:345
std::string smoothing_mode
"projected" or "exact"; see SmoothVertexOptions::SmoothingMode.
Definition OptimizerParameters.h:174
bool coarsen_pass
Definition OptimizerParameters.h:238
bool optimize_envelope_around_simplified
Definition OptimizerParameters.h:65
int coarsen_global_smoothing_passes
Definition OptimizerParameters.h:303
int coarsen_max_rounds
Definition OptimizerParameters.h:327
void init_lengths_from_diagonal(const double diag)
Derive the edge-length and envelope quantities from the bounding-box diagonal.
Definition OptimizerParameters.h:357
bool coarsen_unbounded
Definition OptimizerParameters.h:262
int split_high_valence_threshold
Definition OptimizerParameters.h:72
int coarsen_local_smoothing_passes
Definition OptimizerParameters.h:280
int project_line_search_steps
Bisections tried before the projected search gives up. See SmoothVertexOptions.
Definition OptimizerParameters.h:176
bool colored_smoothing
Definition OptimizerParameters.h:201
int coarsen_smooth_ring
Definition OptimizerParameters.h:296
int num_smoothing_passes
Number and placement of smoothing passes in the shared Wild optimization driver.
Definition OptimizerParameters.h:188
The fields shared with tetwild and simwild live in wmtk::OptimizerParameters.
Definition Parameters.h:10
Parameters(const nlohmann::json &json_params)
Read every optimizer knob out of the (defaults-injected) JSON.
Definition Parameters.h:80
bool allow_junction_cleanup
Definition Parameters.h:43
bool use_sample_envelope
Definition Parameters.h:71
bool preserve_feature_points
Definition Parameters.h:22
bool check_envelope_at_init
Definition Parameters.h:55