Per-feature limits for constraint simplification. More...
#include <mesh/constraintsimplifier.h>
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. | |
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.
|
strong |
| QString mesh::ConstraintSimplificationPolicy::validate | ( | ) | const |
Check every field against its valid range.
| 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.
| 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.
| 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.
| 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].
| 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.
| 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 mesh::ConstraintSimplificationPolicy::mode = Mode::Preserve |
Simplification mode; Preserve by default.