Loading...
Searching...
No Matches
meshkit::plan::ConstraintSimplificationPolicy Struct Reference

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

#include <meshkit/constraints.hpp>

Collaboration diagram for meshkit::plan::ConstraintSimplificationPolicy:

Public Types

enum class  Mode {
  Preserve ,
  Simplify
}
 Whether vertices of a feature may be removed. More...
 

Public Member Functions

Text validate () const
 Check the mode and the ranges documented on each field.
 

Public Attributes

Mode mode = Mode::Preserve
 Preserve (default) or Simplify.
 
double maxDeviation = 0
 Largest XY distance from a removed vertex to the shortcut segment replacing it; 0 removes only vertices exactly on the shortcut.
 
double maxZDeviation = 0
 Largest |z - linear interpolation along the shortcut| of a removed vertex, in Z units; used only for features with z.
 
double maxTurnDegrees = 5
 Vertices turning by more than this many degrees (0 = straight on, 180 = reversal) are kept as corners, as are vertices next to a zero-length edge.
 
double maxAreaChangeFraction = .001
 Rings only: largest |area change| / |original area|; a failing ring is restored.
 
double maxAreaChange = -1
 Rings only: largest absolute area change in squared XY units; default -1 (disabled), otherwise >= 0.
 
double minimumClearance = 0
 XY distance a shortcut must keep from original segments outside its span and from protected points, unless one of its endpoints lies on them; 0 (default) disables.
 

Detailed Description

Per-feature limits for constraint simplification.

XY values use the features' common planar frame, Z values the authored elevation units; nothing is converted or clamped. Check with validate().

Member Enumeration Documentation

◆ Mode

Whether vertices of a feature may be removed.

  • Preserve: keep every vertex (default).
  • Simplify: remove vertices whose replacing shortcut passes every limit.
Enumerator
Preserve 

Keep every vertex (default).

Simplify 

Remove vertices whose replacing shortcut passes every limit.

Member Function Documentation

◆ validate()

Text meshkit::plan::ConstraintSimplificationPolicy::validate ( ) const

Check the mode and the ranges documented on each field.

Returns
Empty text when valid, otherwise an English message for the first failure.

Member Data Documentation

◆ maxAreaChange

double meshkit::plan::ConstraintSimplificationPolicy::maxAreaChange = -1

Rings only: largest absolute area change in squared XY units; default -1 (disabled), otherwise >= 0.

A ring whose area changes sign or becomes zero is always restored.

◆ maxAreaChangeFraction

double meshkit::plan::ConstraintSimplificationPolicy::maxAreaChangeFraction = .001

Rings only: largest |area change| / |original area|; a failing ring is restored.

Default 0.001; valid [0, 1], or exactly -1 to disable.

◆ maxDeviation

double meshkit::plan::ConstraintSimplificationPolicy::maxDeviation = 0

Largest XY distance from a removed vertex to the shortcut segment replacing it; 0 removes only vertices exactly on the shortcut.

Finite and >= 0.

◆ maxTurnDegrees

double meshkit::plan::ConstraintSimplificationPolicy::maxTurnDegrees = 5

Vertices turning by more than this many degrees (0 = straight on, 180 = reversal) are kept as corners, as are vertices next to a zero-length edge.

Default 5; [0, 180].

◆ maxZDeviation

double meshkit::plan::ConstraintSimplificationPolicy::maxZDeviation = 0

Largest |z - linear interpolation along the shortcut| of a removed vertex, in Z units; used only for features with z.

0 removes only exactly linear heights. Finite, >= 0.

◆ minimumClearance

double meshkit::plan::ConstraintSimplificationPolicy::minimumClearance = 0

XY distance a shortcut must keep from original segments outside its span and from protected points, unless one of its endpoints lies on them; 0 (default) disables.

Finite and >= 0.

◆ mode

Mode meshkit::plan::ConstraintSimplificationPolicy::mode = Mode::Preserve

Preserve (default) or Simplify.


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