Loading...
Searching...
No Matches
mesh::GenerationOptions Struct Reference

Quality knobs surfaced to the user dialog. More...

#include <mesh/meshgenerator.h>

Collaboration diagram for mesh::GenerationOptions:

Public Attributes

double maxArea = 0.0
 0 = no global cap; else upper bound on triangle area.
 
double minCellSize = 0.0
 Floor cell size h_min (map units): the lower clamp of the size function.
 
double minAngleDeg = 30.0
 Every triangle's smallest angle reaches this (degrees), except in the wedge of two constraints meeting at a smaller angle and next to quad strip edges (MESH_TRIANGLE_ENGINE_PLAN_2026-09-30.md D10).
 
bool prioritizeQuality = true
 Worst angle buckets before ordinary size/error work.
 
int maxCells = 20'000'000
 Resource ceiling; reported if reached.
 
bool latticeSeeding = false
 Seed free vertices on hexagonal lattices graded by the size field before refinement, so open areas come out near-equilateral (MESH_REGIONAL_TRIQUAD_PLAN D-R6).
 
int smoothingPasses = 0
 Passes of non-degrading smoothing on free vertices after refinement (ConstrainedDelaunay::QualityOptions::smoothingPasses).
 
bool diagnosticProvenance = false
 Review harness only; no effect on geometry.
 
int coarsenPasses = 0
 Bounded attempts to remove unnecessary free vertices; 0 = off.
 
CoarseningOrder coarseningOrder =CoarseningOrder::LegacyFlatness
 Order in which coarsening visits free vertices: LegacyFlatness by star flatness; ResolutionAware by normal departure weighted by actual / target size, with RefineHook::footprintMaximumSize (or the maxArea size) as the target.
 
double coarseningReferenceSize =10
 XY-unit size ResolutionAware ordering uses where the target is 0 (unbounded).
 
double normalVerticalToXY =1
 Factor turning elevation differences into XY units for ResolutionAware facet normals (vertical / horizontal metres per unit); finite and > 0 with that order.
 
double channelSpacing = 0.0
 Smallest spacing between distinct channel corridor vertices (lattice offsets and stations).
 
bool quadsBetweenBreaklines = false
 Two terrain break lines that face each other with lower ground between them become a bank-pair quad strip (needs RefineHook::elevationAt).
 
double patchSnapEps = 0.0
 Snap radius (map units) used to match patch vertices against the output vertices.
 
double terrainMinLineLength = 0.0
 0 = four times minimum target size.
 
bool allowQuads = true
 Global cell-shape gate.
 
bool preserveConstraintCoordinates = false
 Only exact junctions/crossings are joined.
 
bool verifiedSizing = false
 Also cap every triangle's area by its footprint: RefineHook::footprintMaximumSize over its bounding box (required when targetAreaAt is set), else the sampled size and region spacings.
 
bool unifiedCellPlanning = false
 Plan all quad regions jointly before triangulation, gate every patch and regenerate (at most three retries) after interface conflicts.
 
double minimumRequiredEdge = 0
 Shortest permitted quad patch cell edge, XY units; 0 = no check.
 
double maximumAdjacentRatio = 0
 Largest size ratio, sqrt of the area ratio, between neighbouring triangles, enforced by the sizing repair passes (verifiedSizing only).
 
int sizingRepairPasses = 2
 Re-examination passes (0..3) of every live triangle against the size, footprint and adjacent-ratio bounds after refinement, smoothing and coarsening (verifiedSizing only).
 
int maximumSizingRepairInsertions = 200000
 Cap on vertices the repair passes may insert, >= 0; reaching it (or 0) stops the repair and sets GenerationStats::sizingRepairLimited.
 

Detailed Description

Quality knobs surfaced to the user dialog.

Member Data Documentation

◆ allowQuads

bool mesh::GenerationOptions::allowQuads = true

Global cell-shape gate.

False retains region outlines, tags and local spacing but disables generated quad regions and all strips. Explicit prebuilt quad patches conflict with this mode and cause a clear failure.

◆ channelSpacing

double mesh::GenerationOptions::channelSpacing = 0.0

Smallest spacing between distinct channel corridor vertices (lattice offsets and stations).

Constraint joining stays below a tenth of it so a narrow bank crest is never welded to its toe. 0 = derive it from the shortest "channel:" edge (clip fragments then shrink it for the whole mesh).

◆ coarseningOrder

CoarseningOrder mesh::GenerationOptions::coarseningOrder =CoarseningOrder::LegacyFlatness

Order in which coarsening visits free vertices: LegacyFlatness by star flatness; ResolutionAware by normal departure weighted by actual / target size, with RefineHook::footprintMaximumSize (or the maxArea size) as the target.

Ordering only; the removal checks are the same.

◆ coarseningReferenceSize

double mesh::GenerationOptions::coarseningReferenceSize =10

XY-unit size ResolutionAware ordering uses where the target is 0 (unbounded).

With ResolutionAware it must be finite and > 0, else generate() fails.

◆ coarsenPasses

int mesh::GenerationOptions::coarsenPasses = 0

Bounded attempts to remove unnecessary free vertices; 0 = off.

◆ diagnosticProvenance

bool mesh::GenerationOptions::diagnosticProvenance = false

Review harness only; no effect on geometry.

◆ latticeSeeding

bool mesh::GenerationOptions::latticeSeeding = false

Seed free vertices on hexagonal lattices graded by the size field before refinement, so open areas come out near-equilateral (MESH_REGIONAL_TRIQUAD_PLAN D-R6).

false = refinement places every point (the previous behaviour, bit-identical).

◆ maxArea

double mesh::GenerationOptions::maxArea = 0.0

0 = no global cap; else upper bound on triangle area.

Ignored when a refinement size function is installed (see MeshGenerator::setRefineHook). The target edge length is the equilateral side.

◆ maxCells

int mesh::GenerationOptions::maxCells = 20'000'000

Resource ceiling; reported if reached.

◆ maximumAdjacentRatio

double mesh::GenerationOptions::maximumAdjacentRatio = 0

Largest size ratio, sqrt of the area ratio, between neighbouring triangles, enforced by the sizing repair passes (verifiedSizing only).

0 = off, else >= 1. With unifiedCellPlanning it also bounds triangles beside fixed patch edges and is audited across patch interfaces, which can trigger a retry.

◆ maximumSizingRepairInsertions

int mesh::GenerationOptions::maximumSizingRepairInsertions = 200000

Cap on vertices the repair passes may insert, >= 0; reaching it (or 0) stops the repair and sets GenerationStats::sizingRepairLimited.

◆ minAngleDeg

double mesh::GenerationOptions::minAngleDeg = 30.0

Every triangle's smallest angle reaches this (degrees), except in the wedge of two constraints meeting at a smaller angle and next to quad strip edges (MESH_TRIANGLE_ENGINE_PLAN_2026-09-30.md D10).

The dialog offers 20–33; above 30 an awkward input may stop refining at the cascade floor (a quarter of the minimum cell size) with a few triangles under the bound (GenerationStats::trianglesBelowAngle).

◆ minCellSize

double mesh::GenerationOptions::minCellSize = 0.0

Floor cell size h_min (map units): the lower clamp of the size function.

0 = a quarter of the smallest size sampled over the inputs.

◆ minimumRequiredEdge

double mesh::GenerationOptions::minimumRequiredEdge = 0

Shortest permitted quad patch cell edge, XY units; 0 = no check.

Applied only when the patch gate is active (unifiedCellPlanning or terrainToleranceForFootprint): a failing required patch fails generation, a preferred one falls back to triangles.

◆ normalVerticalToXY

double mesh::GenerationOptions::normalVerticalToXY =1

Factor turning elevation differences into XY units for ResolutionAware facet normals (vertical / horizontal metres per unit); finite and > 0 with that order.

◆ patchSnapEps

double mesh::GenerationOptions::patchSnapEps = 0.0

Snap radius (map units) used to match patch vertices against the output vertices.

0 = 1e-7.

◆ preserveConstraintCoordinates

bool mesh::GenerationOptions::preserveConstraintCoordinates = false

Only exact junctions/crossings are joined.

◆ prioritizeQuality

bool mesh::GenerationOptions::prioritizeQuality = true

Worst angle buckets before ordinary size/error work.

◆ quadsBetweenBreaklines

bool mesh::GenerationOptions::quadsBetweenBreaklines = false

Two terrain break lines that face each other with lower ground between them become a bank-pair quad strip (needs RefineHook::elevationAt).

◆ sizingRepairPasses

int mesh::GenerationOptions::sizingRepairPasses = 2

Re-examination passes (0..3) of every live triangle against the size, footprint and adjacent-ratio bounds after refinement, smoothing and coarsening (verifiedSizing only).

◆ smoothingPasses

int mesh::GenerationOptions::smoothingPasses = 0

Passes of non-degrading smoothing on free vertices after refinement (ConstrainedDelaunay::QualityOptions::smoothingPasses).

0 = off.

◆ terrainMinLineLength

double mesh::GenerationOptions::terrainMinLineLength = 0.0

0 = four times minimum target size.

◆ unifiedCellPlanning

bool mesh::GenerationOptions::unifiedCellPlanning = false

Plan all quad regions jointly before triangulation, gate every patch and regenerate (at most three retries) after interface conflicts.

Requires verifiedSizing, implies preserveConstraintCoordinates, and is required by QuadRegion::requireMapped.

◆ verifiedSizing

bool mesh::GenerationOptions::verifiedSizing = false

Also cap every triangle's area by its footprint: RefineHook::footprintMaximumSize over its bounding box (required when targetAreaAt is set), else the sampled size and region spacings.

Enables the adjacent-ratio repair below. A non-finite or negative footprint size, or invalid repair limits, make generate() fail.


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