SimWild

/ (object)

/

Description

README

Required

/application (string)

/application

Description

Application name must be simwild.

Options: ['simwild']

/input (list)

/input

Description

List of input files. A .msh is an already-tagged mesh and is used as-is. Anything else is inserted by VolumeRemesher: a triangular surface mesh in 3D, or an OBJ curve network (‘v’/’l’ polylines) in 2D. See /dimension.

/input/* (string)

/input/*

Description

One input file.

Optional

/operation (string)

/operation

Description

Image simulation contains multiple operations for modifying the image. Depending on the operation, more parameters might be required.

Default: 'remeshing'

Options: ['remeshing', 'fill_holes_topo', 'tight_seal_topo', 'keep_lcc', 'resolve_overlaps', 'replace_tags', 'tag_priority']

/output (string)

/output

Description

Output file name (without extension).

Default: 'out'

/input_names (list)

/input_names

Description

List of names for the input meshes. If no names are assigned, the meshes will be named tag_0, tag_1, etc.

/input_names/* (string)

/input_names/*

Description

Name for one input mesh.

/input_transform (list)

/input_transform

Description

Transformation matrices for the inputs. Transformations are optional and don’t need to be described for all inputs.

/input_transform/* (list)

/input_transform/*

Description

Homogeneous transformation matrix for one input: 4x4 for a 3D input, 3x3 for a 2D one. An empty list means identity.

/input_transform/*/* (list)

/input_transform/*/*

Description

FIXME: Missing documentation in the specification.

/input_transform/*/*/* (float)

/input_transform/*/*/*

Description

FIXME: Missing documentation in the specification.

/input_dir (string)

/input_dir

Description

Directory where the input files are located. This is injected by the application and should not be set by the user.

Default: ''

/skip_simplify (bool)

/skip_simplify

Description

If true, input simplification will be skipped. Only surface input may be simplified. If the input is already a tet mesh (.msh), it will never be simplified.

Default: False

/tag_from_winding_number (bool)

/tag_from_winding_number

Description

How the cells of the arrangement are tagged. True evaluates the winding number of every input at each cell’s centroid. False propagates the tags across the arrangement’s own surface provenance instead: combinatorial and exact, starting from a cell of the padded box (which is outside everything) and flipping membership of an input whenever a face belonging to that input is crossed. The provenance route needs every input surface to be closed, and says which crossings disagree rather than returning a tagging that depends on the traversal order. 3D surface input only – a .msh input arrives already tagged.

Default: True

/use_sample_envelope (bool)

/use_sample_envelope

Description

Use the sampled envelope instead of the exact one. Governs both the 3D surface envelope and, since the exact envelope gained support for edges, the order-2 (open boundary and non-manifold) curve envelope and the 2D polyline envelope – all three are containment tests against the same input at the same epsilon, so they follow one flag. The sampled test places points along the query and asks whether each is within eps of the input, so it cannot see what happens between two samples and shrinks its acceptance radius to compensate; the exact one decides coverage by the union of the eps-neighbourhoods without sampling, so it uses the full eps and is strictly sharper.

Default: False

/num_threads (int)

/num_threads

Description

Number of threads used by the application

Default: 0

/max_iterations (int)

/max_iterations

Description

Maximum iterations before stopping.

Default: 80

/eps_rel (float)

/eps_rel

Description

Envelope thickness relative to the bounding box

Default: 0.002

/eps (float)

/eps

Description

Absolute envelope thickness. If this value is negative, the relative envelope thickness is used to compute the absolute one.

Default: -1

/eps_simplify_rel (float)

/eps_simplify_rel

Description

Envelope thickness relative to the bounding box for the initial simplification. Will be ignored if skip_simplify is true or the input is already a tet mesh.

Default: 0.0002

/optimize_envelope_around_simplified (bool)

/optimize_envelope_around_simplified

Description

Build the optimizer’s envelope around the SIMPLIFIED geometry at the remaining tolerance (eps - simplify_eps) instead of around the original input at the full eps. The deviation budget is identical by the triangle inequality, but the geometry starts at the CENTRE of the envelope it is judged against rather than somewhere inside it. The envelope is a hard veto rather than a penalty, so a mesh handed over close to the boundary has most of its moves refused. Costs elements: holding the surface within eps/2 of the simplified geometry is stricter than eps of the input wherever simplification smoothed detail away, measured at 2-3x the output tets on tetwild at unchanged final quality. Off by default.

Default: False

/eps_simplify (float)

/eps_simplify

Description

Absolute envelope thickness for the initial simplification. If this value is negative, the relative envelope thickness is used to compute the absolute one. Will be ignored if skip_simplify is true or the input is already a tet mesh.

Default: -1

/order2_envelope_ratio (float)

/order2_envelope_ratio

Description

Envelope thickness for the order-2 envelope – the open boundaries of the surface and non-manifold edges – as a fraction of the one used for the surface. Kept below 1 deliberately, unlike the surface envelope which uses the full eps. The two are not symmetric: on the surface a wider envelope REMOVES a constraint that was blocking collapses, whereas a boundary curve has no such blockage to relieve, so the extra room is only freedom for the boundary to wander within eps – more geometry to resolve at the same final quality. Measured in tetwild on Thingi10K 36075 at stop_energy 5: 14 iterations and 31125 tets at 0.5, against 24 iterations and 41463 tets at 1.0, both converging to a max energy of about 4.95. 1.0 gives the boundary curves the full eps.

Default: 0.5

/length (float)

/length

Description

Absolute target edge length. If this value is negative, the relative length is used to compute the absolute one.

Default: -1

/length_rel (float)

/length_rel

Description

Target edge length relative to the bounding box

Default: 0.05

/sizing_field (list)

/sizing_field

Description

Prescribe a length for a specific region defined by tags. The length can be absolute (length) or relative (length_rel). The smallest prescibed length will be used for each vertex. Example: [{“tags”: “tag_0 & tag_1”, “length”: 0.1}, {“tags”: “tag_2”, “length_rel”: 0.05}]

/sizing_field/* (object)

/sizing_field/*

Description

A region and its target length.

Required

/sizing_field/*/tags (string)

/sizing_field/*/tags

Description

A region of tags.

Optional

/sizing_field/*/length (float)

/sizing_field/*/length

Description

Absolute target edge length for the region.

Default: -1

/sizing_field/*/length_rel (float)

/sizing_field/*/length_rel

Description

Target edge length relative to the bounding box for the region.

Default: 0.05

/quality_field (list)

/quality_field

Description

Prescribe a target quality for a specific region defined by tags. The last prescibed quality will be used for each element. Example: [{“tags”: “tag_0 & tag_1”, “quality”: 100}, {“tags”: “tag_2”, “quality”: 50}]

/quality_field/* (object)

/quality_field/*

Description

A region and its target quality.

Required

/quality_field/*/tags (string)

/quality_field/*/tags

Description

A region of tags.

/quality_field/*/quality (float)

/quality_field/*/quality

Description

Target quality for the region.

Range: [0, inf]

/stop_energy (float)

/stop_energy

Description

Target energy. If all tets have an energy below this, tetwild will stop.

Default: 10

/stop_at_float (bool)

/stop_at_float

Description

Stop when all vertices are in floating point precision, i.e., no more rational numbers are needed. stop_energy will be ignored when this is true.

Default: False

/preserve_topology (bool)

/preserve_topology

Description

Preserve topology of input.

Default: True

/w_amips (float)

/w_amips

Description

AMIPS energy

Default: 0.0001

Range: [0, 1]

/smoothing_mode (string)

/smoothing_mode

Description

How smoothing places a surface vertex. ‘projected’: smooth with AMIPS alone as if interior, then walk back toward the start projecting each candidate onto the input; accept the first projected candidate that does not invert and strictly lowers the worst incident element, else do not move. Lands exactly on the input; no weights. ‘exact’: minimize w_amips * AMIPS + (1-w_amips) * (d/eps)^2 with the true region-wise Hessian of the distance to the piecewise-linear input; sliding is free where the input is flat, held at corners, constrained along 3D edges and curve segments. Rests a w_amips-proportional distance off the input.

Default: 'projected'

Options: ['projected', 'exact']

/project_line_search_steps (int)

/project_line_search_steps

Description

Bisections tried by the projected line search before it gives up on a vertex: the step along the Newton direction is halved this many times, each candidate projected onto the input, and the first that does not invert and lowers the worst incident element is taken.

Default: 12

/project_line_search_nested_steps (int)

/project_line_search_nested_steps

Description

After the projected line search gives up, revisit each candidate and bisect between the interpolated point and its projection this many times, taking the longest step toward the input that still does not invert and still lowers the worst element. Lets a vertex whose one-ring cannot tolerate a full projection still travel toward the input, instead of being refused every pass from the same place. 0 disables the pass.

Default: 0

/num_smoothing_passes (int)

/num_smoothing_passes

Description

Smoothing passes per optimization iteration when interleaved_smoothing is disabled. Matches the Wild driver.

Default: 2

Range: [0, inf]

/interleaved_smoothing (bool)

/interleaved_smoothing

Description

Run smoothing after each topology phase, matching TetWild and TriWild, instead of batching it after all topology operations.

Default: True

/interleaved_smoothing_passes (int)

/interleaved_smoothing_passes

Description

Smoothing passes after each topology phase when interleaved_smoothing is enabled.

Default: 1

Range: [0, inf]

/coarsen_pass (bool)

/coarsen_pass

Description

Run a final coarsening pass after the optimization has converged. The ordinary collapse judges a candidate on the raw post-collapse geometry – the worst moment in the operation’s life, before smoothing has absorbed any of the damage – so a collapse that would be fine once its neighbourhood relaxes is never taken, and the converged mesh keeps vertices it does not need. This pass takes the collapse optimistically, re-smooths coarsen_smooth_ring around the merged vertex, and keeps it only if the worst element in the region it touched is no worse than before; every element outside that region is untouched, so ‘no worse locally’ is exactly ‘no worse globally’. Alternates with ordinary smoothing passes, as the main optimization does.

Default: False

/coarsen_unbounded (bool)

/coarsen_unbounded

Description

Coarsen as far as the quality guarantee allows, instead of stopping at the target edge length. The pass answers ‘how few elements can hold this max energy’, and that is a more aggressive question than it sounds – the answer ignores how big the elements become. Measured on the registered tetwild models it takes them from 348k to 60k cells (-82.7%) at max energy raised on none of them, against -43.2% with this off, because a converged mesh is sized by length_rel and the adaptive sizing field rather than by what the quality target strictly requires. On by default: the element count is the thing worth having. Turned off, the pass leaves alone any edge already at or past the collapse threshold (0.8 * the target length, the same one the ordinary collapse uses), since collapsing it only makes its neighbours longer still. The sizing FIELD is deliberately not applied either way: that is the optimizer’s own refinement scratch work, and honouring it here would leave the pass unable to undo refinement that turned out to be unnecessary.

Default: True

/coarsen_local_smoothing_passes (int)

/coarsen_local_smoothing_passes

Description

Smoothing sweeps over the ring, inside each candidate collapse, before judging it. 0 by default, which means the pass judges the collapse on its raw post-collapse geometry and never smooths inside the operation. At the level of a single candidate that matters – the composite’s reject rate rises from 25% to 39% without it – but it does not cost coarsening, because the pass runs to a fixed point: a candidate the smoothing would have rescued is replaced by another the pass finds instead, and the relaxation the mesh actually needs comes from the global smoothing between rounds. What it costs is time. The smoothed ball averaged 98 vertices on tetwild’s octocat, so at the old default of 2 sweeps one candidate ran ~200 nonlinear smoothing solves and the pass ran 1.4 million of them to accept 5173 collapses. Over seven tetwild models, dropping this to 0 (with coarsen_max_inner_passes 1) made the pass 9.7x to 31.9x faster for about 1 percentage point of cell reduction.

Default: 0

/coarsen_smooth_ring (int)

/coarsen_smooth_ring

Description

Radius smoothed inside the collapse, and the radius the accept test measures over. The lock claims one more ring than this. With coarsen_local_smoothing_passes at 0 nothing is smoothed, so this only sets how wide a region the accept test compares; a wider region is a more permissive test (it admits untouched cells to both the before and after maxima, which is still sound) so ring 2 coarsens slightly more, but it also makes the pass lock 3 rings per operation where the ordinary collapse locks 2, which is the worst thing for its parallel scaling. 1 by default: on octocat that is 2.3x faster than ring 2 for 1.5 percentage points of cell reduction, and it puts the lock footprint back in line with every other pass.

Default: 1

/coarsen_global_smoothing_passes (int)

/coarsen_global_smoothing_passes

Description

Ordinary whole-mesh smoothing passes run between coarsening rounds. This is what makes a second round worth running at all – see coarsen_max_rounds – so setting it to 0 collapses the rounds to one.

Default: 1

/coarsen_max_rounds (int)

/coarsen_max_rounds

Description

Cap on the coarsen/smooth alternation; the pass also stops as soon as a round accepts no collapse. A round does NOT exist to finish what the previous one started: within a round the collapse pass already runs to a fixed point, so repeating the collapse alone finds nothing. What a round adds is the global smoothing in between, which moves that fixed point – the dirty-epoch retry only re-offers failures next to a SUCCESSFUL collapse, so a whole-mesh smoothing pass is invisible to it, and a rejected composite is rolled back in full so rejections never accumulate progress within a round. Returns decay fast: measured over the 16 challenging triwild models at five rounds, accepted collapses by round were 68.8% / 21.7% / 7.2% / 1.8% / 0.5%. Every round costs a full pre-check sweep over all edges plus a smoothing pass, so the default is two – they carry 90.5% of the coarsening, and the three that would follow are worth 9.5% for 60% of the pass’s budget.

Default: 2

/coarsen_max_inner_passes (int)

/coarsen_max_inner_passes

Description

Cap on the collapse pass’s own dirty-epoch retry loop within one coarsening round; 0 is uncapped. Distinct from coarsen_max_rounds, which counts collapse+global-smoothing alternations. This counts the passes the retry loop makes inside a single collapse pass, re-offering failures whose neighbourhood a successful collapse disturbed. That filter asks only whether the neighbourhood MOVED, not whether it moved helpfully, so a productive first pass re-offers most of the mesh. 1 by default, i.e. one pass per round and no retry within it: on octocat the first pass found 5110 collapses in 135.8s and the three that followed found 27 in 38.4s. Rounds still repeat the pass, and those do pay off, because the global smoothing between them moves the fixed point in a way this filter cannot see.

Default: 1

/write_vtu (bool)

/write_vtu

Description

Write not just MSH but also VTU output.

Default: False

/write_envelope (bool)

/write_envelope

Description

Save the envelope in the MSH output (as a separate physical group with tag ‘envelope’).

Default: True

/log_file (string)

/log_file

Description

Logs are not just printed on the terminal but also saved in this file.

Default: ''

/report (string)

/report

Description

A JSON file that stores information about the result and the method execution, e.g., runtime.

Default: ''

/DEBUG_output (bool)

/DEBUG_output

Description

Write the mesh as debug_{}.vtu after every operation.

Default: False

/DEBUG_sanity_checks (bool)

/DEBUG_sanity_checks

Description

Perform sanity checks after every operation. This can be very slow and should only be used for debugging.

Default: False

/DEBUG_envelope_sanity_check (bool)

/DEBUG_envelope_sanity_check

Description

Sanity Check: for the 2D remeshing path, verify at init that every surface edge already lies inside the envelope, and abort if one does not. Everything downstream assumes it – an operation vetoed by the envelope only means something if the mesh started inside it – but the check costs one sampled segment query per surface edge, serially, on every run. Measured in triwild’s 2D sweep, where the same check cost 22s on a 3.5M-edge input and 5m07s on a 7.6M-edge one, the latter 8.5% of that model’s entire budget. Off by default; turn it on when changing the input simplification or the envelope. Note the 3D path’s superficially similar check is not governed by this flag: there the result selects whether to rebuild the envelope from the tet tags, so it is a decision rather than an assertion and always runs.

Default: False

/allow_surface_swap (bool)

/allow_surface_swap

Description

Allow surface edge swapping.

Default: True

/check_surface_topology (bool)

/check_surface_topology

Description

Check if the surface topology is preserved after each operation. This can be very slow and should only be used for debugging.

Default: False

/stuck_refine_stall_eps (float)

/stuck_refine_stall_eps

Description

Refine when the last iteration’s improvement was at most this fraction of the distance the max energy still has to cover: (prev_max - max) <= eps * (max - stop_energy). Equivalently, refine unless the mesh is on course to reach the target within about 1/eps more iterations. 0 => only when it does not improve at all.

Default: 0.1

/stuck_refine_cooldown (int)

/stuck_refine_cooldown

Description

After a refinement, skip this many improvement iterations before refining again (let the operations act on the new sizing field).

Default: 0

/stuck_refine_num_worst (int)

/stuck_refine_num_worst

Description

Number of worst tets whose neighborhoods are refined when stuck. 0 => refine all tets with energy above the filter_energy.

Default: 0

Range: [0, inf]

/stuck_refine_rings (int)

/stuck_refine_rings

Description

Graph rings around each worst tet included in the stuck refinement. 0 => only the worst tet itself, 1 => its neighbors, 2 => neighbors of neighbors, etc.

Default: 0

Range: [0, inf]

/stuck_refine_factor (float)

/stuck_refine_factor

Description

Multiplicative reduction of the sizing scalar per stuck refinement (0.5 => halve).

Default: 0.5

/stuck_refine_min_scalar (float)

/stuck_refine_min_scalar

Description

Lower bound on the sizing scalar during stuck refinement.

Default: 0.001

/stuck_refine_gradation (float)

/stuck_refine_gradation

Description

Gradation cap for the monotone sizing smoothing: adjacent sizings may differ by at most this factor (smoothing only lowers values).

Default: 2.0

/stuck_refine_force_split (bool)

/stuck_refine_force_split

Description

When the max energy stalls, split each worst tet’s longest edge once, bypassing the split length gate, to unstick a sliver without changing the sizing field. Adds at most one split per worst tet per stall.

Default: True

/skip_good_regions (bool)

/skip_good_regions

Description

Only smooth vertices incident to a tet whose energy is at least skip_good_regions_margin * stop_energy; skip smoothing already-good regions. OFF by default: smoothing is the only phase that improves quality without changing connectivity, and the premise that a vertex surrounded by good elements has nothing to gain is not reliable – for surface vertices the move is driven by the envelope term rather than by element quality, which is why active_vertices() has to append every surface vertex unconditionally to keep the filter from freezing them outright. With the filter off that special case stops carrying the correctness of the pass. Measured in 2D on 122839 at stop_energy 20, filtering also cost more than it saved: 60 iterations ending at max energy 21.03 with it on, against convergence to 19.9998 in 54 iterations and less wall time (875s vs 947s) with it off. Note the threshold scales with stop_energy, so the filter skips far more at 100 than at 20.

Default: False

/skip_good_regions_margin (float)

/skip_good_regions_margin

Description

A tet is ‘active’ (worth smoothing around) when its energy is at least this fraction of stop_energy.

Default: 0.9

/fill_holes_tags (list)

/fill_holes_tags

Description

For fill_holes_topo: list of tag values used to fill enclosed connected components (processed in order).

/fill_holes_tags/* (string)

/fill_holes_tags/*

Description

An intersection of tag values to fill holes.

/fill_holes_threshold (float)

/fill_holes_threshold

Description

For fill_holes_topo: only fill a connected component if its area is less than this threshold. Negative value means no threshold (fill all enclosed components).

Default: -1

/tight_seal_tag_sets (list)

/tight_seal_tag_sets

Description

For tight_seal_topo: list of tag sets. Each inner list defines a group of tags whose enclosed holes are filled, e.g. [[1,2],[3]].

/tight_seal_tag_sets/* (list)

/tight_seal_tag_sets/*

Description

One tag set: a list of tag values that are treated as a group for hole filling.

/tight_seal_tag_sets/*/* (string)

/tight_seal_tag_sets/*/*

Description

An intersection of tags.

/tight_seal_threshold (float)

/tight_seal_threshold

Description

For tight_seal_topo: only fill a hole cluster if its total area is less than this threshold. Negative value means no threshold.

Default: -1

/keep_lcc_tags (list)

/keep_lcc_tags

Description

For keep_lcc: list of tag values for which only the largest connected component is kept.

/keep_lcc_tags/* (string)

/keep_lcc_tags/*

Description

An intersection of tags whose smaller connected components will be removed.

/keep_lcc_num (int)

/keep_lcc_num

Description

Number of largest connected components that are kept. By default, only the largest one is kept.

Default: 1

/resolve_overlaps_tags (list)

/resolve_overlaps_tags

Description

Resolve intersections between tags by filling the areas with intersections with the nearest of the intersecting tags.

/resolve_overlaps_tags/* (list)

/resolve_overlaps_tags/*

Description

Two Boolean expressions that define the two intersecting regions.

/resolve_overlaps_tags/*/* (string)

/resolve_overlaps_tags/*/*

Description

A Boolean expression that defines a region of tags.

/replace_tags_in (list)

/replace_tags_in

Description

Replace the tags by the output tags.

/replace_tags_in/* (string)

/replace_tags_in/*

Description

An intersection of tags that should be replaced.

/replace_tags_out (list)

/replace_tags_out

Description

The output tags (written as intersection) that should replace the input tags. For each input tag, an output tag must be provided. The order of the output tags should correspond to the order of the input tags.

/replace_tags_out/* (string)

/replace_tags_out/*

Description

An intersection of tags that should replace the input tags.

/tag_priority (list)

/tag_priority

Description

List of tags for the tag_priority operation. Tags earlier in the list have higher priority.

/tag_priority/* (string)

/tag_priority/*

Description

A tag value.

/tags_selection (string)

/tags_selection

Description

A boolean expression that defines the input selection for intent operations. _ represents empty tags.

Default: '_ | !_'