275ConstraintSimplificationResult
277 const ConstraintSimplificationOptions &options);
std::vector<T> with the QVector-style member names the CDT kernel and plan model use.
Definition storage.hpp:31
Owned byte string with the QString-style helpers used for tags and diagnostics.
Definition planmodel.hpp:21
Storage policies and containers for the constrained Delaunay kernel and the plan model: StandardStora...
ConstraintSimplificationResult simplifySharedConstraints(const Vector< SimplificationFeature > &features, const ConstraintSimplificationOptions &options)
Shared-edge path of simplifyConstraints().
Definition constraintshared.cpp:91
Planning algorithms on standard containers: quad patch planning and placement, size fields,...
ConstraintSimplificationResult simplifyConstraints(const Vector< SimplificationFeature > &features, const ConstraintSimplificationOptions &options={})
Remove redundant constraint vertices within each feature's policy without moving any coordinate.
Definition constraints.cpp:282
Optional per-source changes to a parent ConstraintSimplificationPolicy, applied by resolve().
Definition constraints.hpp:58
std::optional< double > minimumClearance
Replaces ConstraintSimplificationPolicy::minimumClearance when set.
Definition constraints.hpp:76
std::optional< double > maxTurnDegrees
Replaces ConstraintSimplificationPolicy::maxTurnDegrees when set.
Definition constraints.hpp:75
std::optional< double > maxDeviation
Replaces ConstraintSimplificationPolicy::maxDeviation when set.
Definition constraints.hpp:75
std::optional< double > maxAreaChangeFraction
Replaces ConstraintSimplificationPolicy::maxAreaChangeFraction when set; must be >= 0,...
Definition constraints.hpp:75
int mode
Mode override: -1 inherits (default), 0 Preserve, 1 Simplify; other values fail validate().
Definition constraints.hpp:61
ConstraintSimplificationPolicy resolve(ConstraintSimplificationPolicy parent) const
Merge this override into a parent policy without validation.
Definition constraints.cpp:14
std::optional< double > maxZDeviation
Replaces ConstraintSimplificationPolicy::maxZDeviation when set.
Definition constraints.hpp:75
Text validate() const
Check mode, a set maxAreaChangeFraction, and this override resolved against a default-constructed pol...
Definition constraints.cpp:31
Pins, cancellation and resource limits for simplifyConstraints().
Definition constraints.hpp:178
std::uint64_t maximumWorkspaceBytes
Estimated shared-edge workspace limit in bytes (default 1 GiB); exceeding it keeps every original fea...
Definition constraints.hpp:197
Vector< Point2 > protectedPoints
Finite XY points a shortcut must not pass through (except at an endpoint), sweep over or (with minimu...
Definition constraints.hpp:181
std::function< bool()> cancelled
Optional; polled before work starts and every 4096 work units.
Definition constraints.hpp:184
bool canonicalizeSharedEdges
True (default): with several features, exact shared segments are simplified once as chains (detail::s...
Definition constraints.hpp:193
std::uint64_t workBudget
Work units allowed; 0 selects 256 per input vertex plus 100,000.
Definition constraints.hpp:189
Per-feature limits for constraint simplification.
Definition constraints.hpp:14
double minimumClearance
XY distance a shortcut must keep from original segments outside its span and from protected points,...
Definition constraints.hpp:44
Mode mode
Preserve (default) or Simplify.
Definition constraints.hpp:25
double maxAreaChange
Rings only: largest absolute area change in squared XY units; default -1 (disabled),...
Definition constraints.hpp:40
Mode
Whether vertices of a feature may be removed.
Definition constraints.hpp:21
@ Preserve
Keep every vertex (default).
Definition constraints.hpp:22
@ Simplify
Remove vertices whose replacing shortcut passes every limit.
Definition constraints.hpp:23
Text validate() const
Check the mode and the ranges documented on each field.
Definition constraints.cpp:39
double maxDeviation
Largest XY distance from a removed vertex to the shortcut segment replacing it; 0 removes only vertic...
Definition constraints.hpp:28
double maxZDeviation
Largest |z - linear interpolation along the shortcut| of a removed vertex, in Z units; used only for ...
Definition constraints.hpp:31
double maxTurnDegrees
Vertices turning by more than this many degrees (0 = straight on, 180 = reversal) are kept as corners...
Definition constraints.hpp:34
double maxAreaChangeFraction
Rings only: largest |area change| / |original area|; a failing ring is restored.
Definition constraints.hpp:37
Output of simplifyConstraints().
Definition constraints.hpp:202
bool cancelled
ConstraintSimplificationOptions::cancelled stopped the run; ok is false.
Definition constraints.hpp:210
Vector< SimplificationFeature > features
One feature per input, in input order; the original wherever no edit was accepted.
Definition constraints.hpp:216
bool ok
The call finished without input error or cancellation, including runs that kept the originals because...
Definition constraints.hpp:210
Text error
Empty unless the input was rejected; then an English message, usually prefixed with the feature id.
Definition constraints.hpp:213
std::uint64_t workUsed
Work units consumed.
Definition constraints.hpp:227
Vector< SimplificationChange > changes
One entry per input feature, in input order.
Definition constraints.hpp:217
std::uint64_t sharedSegments
Exact segments owned by more than one feature (shared-edge path only; can be partial when the run kep...
Definition constraints.hpp:227
std::uint64_t sharedChains
Canonical chains owned by more than one feature (shared-edge path only).
Definition constraints.hpp:227
Per-feature outcome of simplifyConstraints(); changes are in input order.
Definition constraints.hpp:140
std::ptrdiff_t rejectedShortcuts
Candidate shortcuts rejected; each is split at its worst (or middle) vertex and both halves are retri...
Definition constraints.hpp:149
Text id
Copy of the feature's id.
Definition constraints.hpp:141
double areaChange
Rings: absolute area change in squared XY units; 0 for open lines and reverted edits.
Definition constraints.hpp:161
double maxZDeviation
Largest Z deviation of a removed vertex from linear interpolation along its shortcut,...
Definition constraints.hpp:161
double maxDeviation
Largest XY distance of a removed vertex from its accepted shortcut; 0 when nothing was removed or the...
Definition constraints.hpp:161
Vector< int > sourceVertices
Input index of each output vertex; empty means identity.
Definition constraints.hpp:173
bool budgetRetained
The original geometry was kept because the work budget or workspace limit ran out,...
Definition constraints.hpp:171
std::ptrdiff_t removed
Vertices removed (input XY count minus output XY count); 0 when unchanged.
Definition constraints.hpp:149
bool rolledBack
An accepted edit was reverted: ring area/orientation limit failed, output shortcuts of different feat...
Definition constraints.hpp:171
One constraint polyline or ring for simplification and the constraint audits.
Definition constraints.hpp:96
Vector< double > z
Optional authored elevations in Z units; compared with maxZDeviation, never changed.
Definition constraints.hpp:102
int marker
Boundary marker, copied unchanged by simplification.
Definition constraints.hpp:129
bool closed
Treat as a ring even without a repeated closing vertex.
Definition constraints.hpp:105
Vector< Point2 > xy
Finite vertex coordinates in the common planar frame (XY units).
Definition constraints.hpp:100
Text label
Optional human-readable label; copied unchanged, not read by simplification or the audits.
Definition constraints.hpp:135
Role
Meaning of a feature for auditMeshConstraints().
Definition constraints.hpp:121
@ Line
Constraint path; only coverage by delivered edges is checked.
Definition constraints.hpp:122
@ Protected
Caller label (Python role "protected"); treated like Line.
Definition constraints.hpp:125
@ Hole
Hole ring; covered edges need an incident cell outside the hole.
Definition constraints.hpp:124
@ Domain
Outer boundary ring; covered edges need an incident cell inside.
Definition constraints.hpp:123
ConstraintSimplificationPolicy policy
Simplification limits for this feature.
Definition constraints.hpp:106
bool requiredInMesh
True (default): auditMeshConstraints() requires delivered cell edges to cover this feature; false: th...
Definition constraints.hpp:132
Vector< bool > fixed
Per-vertex flags; a true vertex is never removed. Missing trailing flags are false.
Definition constraints.hpp:104
Text id
Stable identifier: copied to SimplificationChange::id and prefixed to error messages.
Definition constraints.hpp:99
enum meshkit::plan::SimplificationFeature::Role role
Meaning for auditMeshConstraints() (default Line); copied unchanged by simplification.