Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
wmtk::components::triwild::Parameters Struct Reference

The fields shared with tetwild and simwild live in wmtk::OptimizerParameters. More...

#include <Parameters.h>

Inheritance diagram for wmtk::components::triwild::Parameters:
wmtk::OptimizerParameters

Public Member Functions

 Parameters (const nlohmann::json &json_params)
 Read every optimizer knob out of the (defaults-injected) JSON.
 
void init (const Vector2d &min_, const Vector2d &max_)
 
void init (const std::vector< Vector2d > &vertices, const std::vector< std::array< size_t, 3 > > &faces)
 
- Public Member Functions inherited from wmtk::OptimizerParameters
void init_lengths_from_diagonal (const double diag)
 Derive the edge-length and envelope quantities from the bounding-box diagonal.
 

Public Attributes

Vector2d box_min = Vector2d::Zero()
 
Vector2d box_max = Vector2d::Ones()
 
bool preserve_feature_points = true
 
bool allow_junction_cleanup = true
 
bool check_envelope_at_init = false
 
bool use_sample_envelope = false
 
- Public Attributes inherited from wmtk::OptimizerParameters
double epsr = 1e-3
 
double eps = -1.
 
double lr = 5e-2
 
double l = -1.
 
double l_min = -1
 
double diag_l = -1.
 
bool preserve_topology = false
 
bool optimize_envelope_around_simplified = false
 
int split_high_valence_threshold = 200
 
double stuck_refine_stall_eps = 0.1
 
int stuck_refine_cooldown = 0
 
int stuck_refine_num_worst = 0
 
int stuck_refine_rings = 0
 
double stuck_refine_factor = 0.5
 
double stuck_refine_min_scalar = 1e-3
 
double stuck_refine_gradation = 2.0
 
bool stuck_refine_force_split = true
 
bool skip_good_regions = false
 
double skip_good_regions_margin = 0.9
 
double splitting_l2 = -1.
 
double collapsing_l2
 
double stop_energy = 100
 
double w_amips = 1e-4
 
std::string smoothing_mode = "projected"
 "projected" or "exact"; see SmoothVertexOptions::SmoothingMode.
 
int project_line_search_steps = 12
 Bisections tried before the projected search gives up. See SmoothVertexOptions.
 
int project_line_search_nested_steps = 0
 Partial-projection bisections tried after it gives up; 0 disables that pass.
 
double w_envelope = 1. - 1e-4
 
int num_smoothing_passes = 2
 Number and placement of smoothing passes in the shared Wild optimization driver.
 
bool interleaved_smoothing = true
 
int interleaved_smoothing_passes = 1
 
bool coarsen_pass = false
 
bool coarsen_unbounded = true
 
int coarsen_local_smoothing_passes = 0
 
int coarsen_smooth_ring = 1
 
int coarsen_global_smoothing_passes = 1
 
int coarsen_max_rounds = 2
 
int coarsen_max_inner_passes = 1
 
bool debug_output = false
 
bool perform_sanity_checks = false
 

Detailed Description

The fields shared with tetwild and simwild live in wmtk::OptimizerParameters.

Constructor & Destructor Documentation

◆ Parameters()

wmtk::components::triwild::Parameters::Parameters ( const nlohmann::json &  json_params)
inline

Read every optimizer knob out of the (defaults-injected) JSON.

Mirrors simwild's Parameters(json) so the three applications stay in step.

Member Data Documentation

◆ allow_junction_cleanup

bool wmtk::components::triwild::Parameters::allow_junction_cleanup = true

Let the operations clean up junctions, anchoring only open-polyline endpoints.

The erosion argument above is about ENDPOINTS: a polyline eats its own tip. A junction – valence >= 3 in the constrained edges – cannot erode a curve away, because every curve through it stays a constrained edge and the envelope still holds it within eps. Anchoring it buys little and costs a great deal, because on a self-intersecting input nearly every arrangement vertex is a crossing: on 2D model 242427, 79615 of 87610 vertices are junctions, so almost every edge joins two of them and collapse – the only operation that removes a bad element outright – is refused everywhere. That model then never leaves MAX_ENERGY: it sat at 1e50 for the whole run while the sizing field saturated and the split pass grew it from 13k to 621k vertices.

With junctions free it converges to max energy 10.48, fully rounded, in 12 iterations. Measured no change on the two models the endpoint guard was introduced for (215292 and 134005): identical energies, iteration counts and Euler characteristics either way.

Ignored when preserve_feature_points is off, which already anchors nothing.

◆ check_envelope_at_init

bool wmtk::components::triwild::Parameters::check_envelope_at_init = false

Verify at init that every constrained edge starts inside the envelope.

The invariant is real – the envelope is built around the input curves while the constrained edges come from the simplified ones, so it checks that the simplification stayed inside its share of eps – but it costs one sampled segment query per constrained edge, serially. On a 3.5M-edge input that is 22s locally and 63s on a slower machine, paid on every run to catch something that has fired once in 15665 models. Off by default; turn it on when changing the simplification or the envelope.

◆ preserve_feature_points

bool wmtk::components::triwild::Parameters::preserve_feature_points = true

Keep the curve network's 0-dimensional features – open polyline endpoints and junctions – within eps of where the arrangement put them.

Without it the collapse pass deletes open polylines outright: a polyline erodes into its own tip until one segment is left, and that segment has a feature at both ends, which nothing else refuses. Off only for A/B against the old behaviour.

◆ use_sample_envelope

bool wmtk::components::triwild::Parameters::use_sample_envelope = false

Use the sampled envelope rather than the exact one for the mesh optimization.

The two answer a different question. The sampled test places points along the query segment and asks whether each is within eps of the input; it therefore cannot see anything that happens between two samples, and pays for that by shrinking its acceptance radius to eps/2 (see SampleEnvelope::eps2_edge). The exact one asks whether the segment is covered by the union of the eps-rectangles around the input segments and decides it without sampling, so it uses the full eps and answers a strictly sharper question – notably it rejects a segment that bridges a gap between two input curves, which the sampled test accepts whenever the gap is narrow enough to fall between samples.

Exact by default, matching tetwild.


The documentation for this struct was generated from the following file: