Struct spade::AngleLimit

source ·
pub struct AngleLimit { /* private fields */ }
Expand description

Specifies the minimum allowed angle that should be kept after a refinement procedure.

The refinement algorithm will attempt to keep the minimum angle in the triangulation greater than an angle limit specified with this struct.

See ConstrainedDelaunayTriangulation::refine, RefinementParameters::with_angle_limit

Implementations§

source§

impl AngleLimit

source

pub fn from_deg(degree: f64) -> Self

Create a new angle limit from an angle given in degrees.

Note that angles larger than 30 degrees will quickly lead to overrefinement as the algorithm cannot necessarily guarantee termination (other than by limiting the number of additional inserted vertices).

Defaults to 30°. An angle of 0 degrees will disable refining due to small angles.

See also from_rad

source

pub fn from_rad(rad: f64) -> Self

Create a new angle limit from an angle given in radians.

Note angles larger than 30 degrees (≈0.52rad = PI / 6) will quickly lead to poor refinement quality. Passing in an angle of 0rad will disable refining due to small angles.

See also from_deg

source

pub fn radius_to_shortest_edge_limit(&self) -> f64

Returns the radius to shortest edge limit corresponding to this angle limit.

See from_radius_to_shortest_edge_ratio for more information.

source

pub fn from_radius_to_shortest_edge_ratio(ratio: f64) -> Self

Creates a new angle limit by specifying the circumradius to shortest edge ratio that must be kept.

For each face, this ratio is calculated by dividing the circumradius of the face by the length of its shortest edge. This ratio is related directly to the minimum allowed angle by the formula ratio = 1 / (2 sin * (min_angle)). The larger the allowed min angle is, the smaller ratio becomes.

Larger ratio values will lead to a less refined triangulation. Passing in f64::INFINITY will disable refining due to small angles.

Defaults to 1.0 (30 degrees).

§Example values
ratioBound on smallest angle (deg)Bound on smallest angle (rad)
0.5860.00°1.05
0.6056.44°0.99
0.7045.58°0.80
0.8038.68°0.68
0.9033.75°0.59
1.0030.00°0.52
1.1027.04°0.47
1.2024.62°0.43
1.3022.62°0.39
+INF0

Trait Implementations§

source§

impl Clone for AngleLimit

source§

fn clone(&self) -> AngleLimit

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AngleLimit

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AngleLimit

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for AngleLimit

source§

fn eq(&self, other: &AngleLimit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AngleLimit

source§

fn partial_cmp(&self, other: &AngleLimit) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for AngleLimit

source§

impl StructuralPartialEq for AngleLimit

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.