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

Per-feature limits for constraint simplification. More...

#include <mesh/constraintsimplifier.h>

Collaboration diagram for mesh::ConstraintSimplificationPolicy:

Public Types

enum class  Mode {
  Preserve ,
  Simplify
}
 Whether a feature may lose vertices. More...
 

Public Member Functions

QString validate () const
 Check every field against its valid range.
 

Public Attributes

Mode mode = Mode::Preserve
 Simplification mode; Preserve by default.
 
double maxDeviation = 0
 Largest XY distance a removed vertex may lie from the shortcut replacing it; 0 allows removing only exactly collinear vertices.
 
double maxZDeviation = 0
 Largest difference between a removed vertex's z and the height interpolated linearly along the shortcut at its projected position.
 
double maxTurnDegrees = 5
 Corner limit in degrees (0 = straight on): a vertex whose direction change exceeds it, or that has a zero-length neighbouring edge, is kept.
 
double maxAreaChangeFraction = .001
 Rings only: largest |area change| as a fraction of |original area|, in [0, 1] or exactly -1.
 
double maxAreaChange = -1
 Rings only: largest |area change|; must be finite and nonnegative or exactly -1.
 
double minimumClearance = 0
 XY distance a shortcut must keep from other original segments and protected points that do not touch its endpoints; 0 disables the check.
 

Detailed Description

Per-feature limits for constraint simplification.

Simplification only removes vertices; retained coordinates never move. In Mode::Simplify a vertex can be removed when it is not the first vertex, not the last vertex of an open feature, not flagged in SimplificationFeature::fixed, does not turn more than maxTurnDegrees, and the shortcut replacing it passes every limit below plus the topology checks of simplifyConstraints(). XY limits use the features' common planar frame and Z limits the units of SimplificationFeature::z; no unit conversion is applied.

Member Enumeration Documentation

◆ Mode

Whether a feature may lose vertices.

Enumerator
Preserve 

Keep every vertex; the feature is returned unchanged.

Simplify 

Remove vertices wherever this policy and the topology checks allow it.

Member Function Documentation

◆ validate()

QString mesh::ConstraintSimplificationPolicy::validate ( ) const

Check every field against its valid range.

Returns
Empty string when the policy is valid, otherwise an English message for the first failed group of checks: unknown mode; nonfinite or negative maxDeviation, maxZDeviation or minimumClearance; maxTurnDegrees outside [0, 180]; an area limit that is nonfinite, above 1 (fraction only) or negative other than exactly -1.

Member Data Documentation

◆ maxAreaChange

double mesh::ConstraintSimplificationPolicy::maxAreaChange = -1

Rings only: largest |area change|; must be finite and nonnegative or exactly -1.

A ring exceeding it is rolled back to its original geometry.

◆ maxAreaChangeFraction

double mesh::ConstraintSimplificationPolicy::maxAreaChangeFraction = .001

Rings only: largest |area change| as a fraction of |original area|, in [0, 1] or exactly -1.

A ring exceeding it is rolled back to its original geometry.

◆ maxDeviation

double mesh::ConstraintSimplificationPolicy::maxDeviation = 0

Largest XY distance a removed vertex may lie from the shortcut replacing it; 0 allows removing only exactly collinear vertices.

Must be finite and nonnegative.

◆ maxTurnDegrees

double mesh::ConstraintSimplificationPolicy::maxTurnDegrees = 5

Corner limit in degrees (0 = straight on): a vertex whose direction change exceeds it, or that has a zero-length neighbouring edge, is kept.

Valid range [0, 180].

◆ maxZDeviation

double mesh::ConstraintSimplificationPolicy::maxZDeviation = 0

Largest difference between a removed vertex's z and the height interpolated linearly along the shortcut at its projected position.

Ignored for features without z. Must be finite and nonnegative.

◆ minimumClearance

double mesh::ConstraintSimplificationPolicy::minimumClearance = 0

XY distance a shortcut must keep from other original segments and protected points that do not touch its endpoints; 0 disables the check.

Finite and nonnegative.

◆ mode

Mode mesh::ConstraintSimplificationPolicy::mode = Mode::Preserve

Simplification mode; Preserve by default.


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