Loading...
Searching...
No Matches
meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions Struct Reference

Options for refineQuality(). More...

#include <meshkit/cdt.hpp>

Collaboration diagram for meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions:

Public Attributes

std::function< double(double, double)> hAt
 Target edge length h at (x, y): a triangle is split when its area exceeds the equilateral triangle of side h(centroid).
 
std::function< double(const Point *)> maximumAreaForTriangle
 Optional per-triangle area cap in squared XY units.
 
double maximumAdjacentRatio = 0
 Sizing-repair only.
 
std::function< double(int, int)> fixedNeighbourSize
 Sizing-repair only (needs maximumAdjacentRatio >= 1).
 
int sizingRepairPasses = 0
 Passes of bounded size repair after smoothing, terrain insertion and coarsening; clamped to [0, 3], 0 = off.
 
int maximumSizingRepairInsertions = 200000
 Cap on vertices (segment splits included) inserted by sizing repair; reaching it sets QualityReport::sizingRepairLimited.
 
std::function< double(const Point *, const double *, Point *)> terrainError
 Actual surface error at the reference DEM samples covered by a triangle.
 
std::function< double(double, double)> terrainElevationAt
 Reference elevation (Z units) at XY (x, y).
 
double terrainTolerance = 0.0
 Allowed terrain residual in Z units; a triangle whose terrainError exceeds it is refined.
 
std::function< double(const Box &)> terrainToleranceForFootprint
 Positive immutable tolerance for a whole footprint box, replacing terrainTolerance.
 
double terrainMinSpacing = 0.0
 Minimum XY distance from a terrain-driven point to existing vertices; the spacing used is max(terrainMinSpacing, minEdge), and 0 for both disables the check.
 
bool terrainWorstFirst = false
 Refine size and angle first, then insert terrain points worst error first until the tolerance or maxTriangles is reached, so a capped run spends its budget where the surface error is largest.
 
bool terrainFinalCheck = true
 After refinement, measure every live triangle's terrain error for Report::terrainUnresolved / terrainUnknown / maxTerrainError.
 
int smoothingPasses = 0
 Passes of non-degrading smoothing after size and angle refinement: each free vertex (inserted after build(), on no constraint) moves to the area-weighted centroid of its star when that raises the star's worst angle, then the star is made Delaunay again.
 
int coarsenPasses = 0
 Maximum attempts per free vertex; 0 = off.
 
CoarseningOrder coarseningOrder = CoarseningOrder::LegacyFlatness
 Order of coarsening candidates.
 
std::function< double(const Box &)> coarseningTargetSize
 Prescribed size; zero means unbounded, never evolving geometry.
 
double coarseningReferenceSize = 10
 ResolutionAware only: target size in XY units used for a star's priority when coarseningTargetSize() returns 0 (unbounded).
 
double normalVerticalToXY = 1
 ResolutionAware only: factor applied to elevation differences before facet normals are compared, converting Z units into XY units.
 
std::function< bool(const Point &)> protectedLocation
 Coarsening gate: a vertex whose position returns true is never removed.
 
Set< int > protectedVertices
 Additional template vertices to retain.
 
std::function< double(const Point *, const double *)> terrainErrorBound
 Certified maximum residual INCLUDING coverage, unlike terrainError's refinement witness.
 
bool prioritizeQuality = true
 True (default) with minAngleDeg > 0: queue triangles in 32 buckets of sin(smallest angle) / sin(minAngleDeg) and refine the worst-shaped first.
 
int maxTriangles = std::numeric_limits<int>::max()
 Cap on liveTriangleCount(), checked before refinement and after every insertion.
 
double minAngleDeg = 30.0
 Smallest angle every triangle must reach (degrees); 0 = size only.
 
int maxInsertions = std::numeric_limits<int>::max()
 Safety cap on inserted vertices (segment splits included).
 
double minEdge = 0.0
 Floor against refinement cascades (an angle bound near the limit on an awkward input can otherwise shrink edges towards rounding error): a triangle whose shortest edge is below this is not split for its angle, and a subsegment shorter than twice this is not split.
 
std::function< bool()> cancelled
 Polled every 4096 insertions; returning true stops refinement.
 
std::function< void(const GenerationProgress &)> onProgress
 Advisory typed counters at bounded checkpoints; no topology scans.
 

Detailed Description

template<class Storage>
struct meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions

Options for refineQuality().

Member Data Documentation

◆ cancelled

template<class Storage>
std::function<bool()> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::cancelled

Polled every 4096 insertions; returning true stops refinement.

◆ coarseningOrder

template<class Storage>
CoarseningOrder meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::coarseningOrder = CoarseningOrder::LegacyFlatness

Order of coarsening candidates.

LegacyFlatness: coarse Morton tile, then flattest terrain star first. ResolutionAware: tile, then lowest resolutionRemovalImportance() and size/target density first; it requires coarseningTargetSize and positive finite coarseningReferenceSize and normalVerticalToXY. Any other value or missing requirement sets QualityReport::invalidPolicy and refineQuality() returns without changes.

◆ coarseningReferenceSize

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::coarseningReferenceSize = 10

ResolutionAware only: target size in XY units used for a star's priority when coarseningTargetSize() returns 0 (unbounded).

Default 10.

◆ coarseningTargetSize

template<class Storage>
std::function<double(const Box &)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::coarseningTargetSize

Prescribed size; zero means unbounded, never evolving geometry.

◆ coarsenPasses

template<class Storage>
int meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::coarsenPasses = 0

Maximum attempts per free vertex; 0 = off.

◆ fixedNeighbourSize

template<class Storage>
std::function<double(int, int)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::fixedNeighbourSize

Sizing-repair only (needs maximumAdjacentRatio >= 1).

Receives the vertex ids of a triangle edge and returns the linear size, in XY units, of a cell outside this triangulation across that edge (e.g. a fixed patch quad); <= 0 skips the edge.

◆ hAt

template<class Storage>
std::function<double(double, double)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::hAt

Target edge length h at (x, y): a triangle is split when its area exceeds the equilateral triangle of side h(centroid).

Null, or <= 0 at a point, = no size bound there.

◆ maximumAdjacentRatio

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::maximumAdjacentRatio = 0

Sizing-repair only.

When >= 1, a live triangle is a size target if the square root of its area over a live, non-super neighbour's area, or its equilateral-equivalent edge length over fixedNeighbourSize(), exceeds this ratio. Below 1 (default 0) disables both checks.

◆ maximumAreaForTriangle

template<class Storage>
std::function<double(const Point *)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::maximumAreaForTriangle

Optional per-triangle area cap in squared XY units.

Receives a pointer to the triangle's three vertex positions, valid only during the call. A result > 0 makes a larger triangle a size target and rejects larger coarsening replacements; <= 0 or NaN means no cap. During sizing repair it also allows a centroid insertion when an over-cap triangle's size point is blocked only by fixed edges.

◆ maximumSizingRepairInsertions

template<class Storage>
int meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::maximumSizingRepairInsertions = 200000

Cap on vertices (segment splits included) inserted by sizing repair; reaching it sets QualityReport::sizingRepairLimited.

<= 0 sets that flag at once and runs no repair pass.

◆ maxInsertions

template<class Storage>
int meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::maxInsertions = std::numeric_limits<int>::max()

Safety cap on inserted vertices (segment splits included).

◆ maxTriangles

template<class Storage>
int meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::maxTriangles = std::numeric_limits<int>::max()

Cap on liveTriangleCount(), checked before refinement and after every insertion.

Reaching it sets QualityReport::capped and stops insertion, smoothing, terrain placement and sizing repair; coarsening and the final terrain check still run.

◆ minAngleDeg

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::minAngleDeg = 30.0

Smallest angle every triangle must reach (degrees); 0 = size only.

High bounds can exhaust the resource/cascade limits; no termination guarantee is implied by the practical 33-degree UI limit.

◆ minEdge

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::minEdge = 0.0

Floor against refinement cascades (an angle bound near the limit on an awkward input can otherwise shrink edges towards rounding error): a triangle whose shortest edge is below this is not split for its angle, and a subsegment shorter than twice this is not split.

0 = none.

◆ normalVerticalToXY

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::normalVerticalToXY = 1

ResolutionAware only: factor applied to elevation differences before facet normals are compared, converting Z units into XY units.

Default 1.

◆ onProgress

template<class Storage>
std::function<void(const GenerationProgress &)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::onProgress

Advisory typed counters at bounded checkpoints; no topology scans.

Callback must not throw or reenter the kernel.

◆ prioritizeQuality

template<class Storage>
bool meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::prioritizeQuality = true

True (default) with minAngleDeg > 0: queue triangles in 32 buckets of sin(smallest angle) / sin(minAngleDeg) and refine the worst-shaped first.

False: one first-in, first-out queue.

◆ protectedLocation

template<class Storage>
std::function<bool(const Point &)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::protectedLocation

Coarsening gate: a vertex whose position returns true is never removed.

Not consulted by insertion or smoothing.

◆ protectedVertices

template<class Storage>
Set<int> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::protectedVertices

Additional template vertices to retain.

◆ sizingRepairPasses

template<class Storage>
int meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::sizingRepairPasses = 0

Passes of bounded size repair after smoothing, terrain insertion and coarsening; clamped to [0, 3], 0 = off.

Each pass requeues every live triangle and stops early when it inserts nothing. Skipped after a cap or cancellation.

◆ smoothingPasses

template<class Storage>
int meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::smoothingPasses = 0

Passes of non-degrading smoothing after size and angle refinement: each free vertex (inserted after build(), on no constraint) moves to the area-weighted centroid of its star when that raises the star's worst angle, then the star is made Delaunay again.

Runs before terrain points are placed (with terrainWorstFirst, or without terrain). 0 = off.

◆ terrainElevationAt

template<class Storage>
std::function<double(double, double)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainElevationAt

Reference elevation (Z units) at XY (x, y).

Results are cached per vertex in terrainElevations(); a non-finite result marks that height unavailable. Terrain refinement needs it, terrainError and terrainTolerance > 0.

◆ terrainError

template<class Storage>
std::function<double(const Point *, const double *, Point *)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainError

Actual surface error at the reference DEM samples covered by a triangle.

Return a failing residual and its source point; NaN means unverified coverage. Elevations are cached per vertex.

◆ terrainErrorBound

template<class Storage>
std::function<double(const Point *, const double *)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainErrorBound

Certified maximum residual INCLUDING coverage, unlike terrainError's refinement witness.

Return NaN for unknown coverage. Required for coarsening with terrain; absent means skip coarsening safely.

◆ terrainFinalCheck

template<class Storage>
bool meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainFinalCheck = true

After refinement, measure every live triangle's terrain error for Report::terrainUnresolved / terrainUnknown / maxTerrainError.

A full exact read of the DEM; false leaves those counts at zero for a caller that verifies the finished mesh itself.

◆ terrainMinSpacing

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainMinSpacing = 0.0

Minimum XY distance from a terrain-driven point to existing vertices; the spacing used is max(terrainMinSpacing, minEdge), and 0 for both disables the check.

A witness too close to its own triangle is skipped and left for the final terrain counters.

◆ terrainTolerance

template<class Storage>
double meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainTolerance = 0.0

Allowed terrain residual in Z units; a triangle whose terrainError exceeds it is refined.

<= 0 (default) disables terrain refinement, and is an invalid policy when terrainToleranceForFootprint is set. That callback, when set, replaces this value per triangle.

◆ terrainToleranceForFootprint

template<class Storage>
std::function<double(const Box &)> meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainToleranceForFootprint

Positive immutable tolerance for a whole footprint box, replacing terrainTolerance.

A non-positive or non-finite result means unknown and also sets QualityReport::invalidPolicy, which stops queue refinement and coarsening.

◆ terrainWorstFirst

template<class Storage>
bool meshkit::BasicConstrainedDelaunay< Storage >::QualityOptions::terrainWorstFirst = false

Refine size and angle first, then insert terrain points worst error first until the tolerance or maxTriangles is reached, so a capped run spends its budget where the surface error is largest.

false = terrain is checked inline with size and angle (default).


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