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

Maps a reference terrain tolerance and a footprint target size to the tolerance used there. More...

#include <meshkit/terrainpolicy.hpp>

Collaboration diagram for mesh::TerrainTolerancePolicy:

Public Member Functions

bool valid () const
 Check the mode and the finite, nonnegative and ordered numeric fields.
 
double tolerance (double referenceTolerance, double h) const
 Resolve the terrain tolerance for one footprint.
 

Public Attributes

TerrainToleranceMode mode = TerrainToleranceMode::Constant
 Tolerance mode; Constant (the default) ignores the other fields except for validation.
 
double referenceSize = 10
 Target size, in XY units, at which the scaled tolerance equals the reference tolerance; must be positive and finite in both modes.
 
double minimumTolerance = 0
 Lower clamp, in Z units, for TargetSize mode; finite and >= 0 (0 = no floor).
 
double maximumTolerance = 0
 Upper clamp, in Z units, for TargetSize mode; finite and >= 0, and >= minimumTolerance unless 0.
 

Detailed Description

Maps a reference terrain tolerance and a footprint target size to the tolerance used there.

Sizes are in XY units and tolerances in Z units. In TargetSize mode the tolerance is referenceTolerance * h / referenceSize, clamped to [minimumTolerance, cap], where cap is maximumTolerance, or the reference tolerance when maximumTolerance is 0.

Member Function Documentation

◆ tolerance()

double meshkit::TerrainTolerancePolicy::tolerance ( double referenceTolerance,
double h ) const
inline

Resolve the terrain tolerance for one footprint.

Parameters
[in]referenceTolerancePositive finite base tolerance in Z units.
[in]hSmallest prescribed target size over the footprint, in XY units; finite and >= 0, where 0 means unbounded.
Returns
Constant mode: referenceTolerance. TargetSize mode: the cap for h == 0, otherwise the clamped scaled value (computed in long double). NaN when the policy is not valid(), an argument is out of range, or minimumTolerance exceeds the cap.

◆ valid()

bool meshkit::TerrainTolerancePolicy::valid ( ) const
inline

Check the mode and the finite, nonnegative and ordered numeric fields.

Returns
True when mode is a declared enumerator, referenceSize is positive and finite, both tolerances are finite and >= 0, and maximumTolerance is 0 or >= minimumTolerance.

Member Data Documentation

◆ maximumTolerance

double meshkit::TerrainTolerancePolicy::maximumTolerance = 0

Upper clamp, in Z units, for TargetSize mode; finite and >= 0, and >= minimumTolerance unless 0.

◆ minimumTolerance

double meshkit::TerrainTolerancePolicy::minimumTolerance = 0

Lower clamp, in Z units, for TargetSize mode; finite and >= 0 (0 = no floor).

◆ mode

TerrainToleranceMode meshkit::TerrainTolerancePolicy::mode = TerrainToleranceMode::Constant

Tolerance mode; Constant (the default) ignores the other fields except for validation.

◆ referenceSize

double meshkit::TerrainTolerancePolicy::referenceSize = 10

Target size, in XY units, at which the scaled tolerance equals the reference tolerance; must be positive and finite in both modes.


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