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
impl AngleLimit
sourcepub fn from_deg(degree: f64) -> Self
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
sourcepub fn from_rad(rad: f64) -> Self
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
sourcepub fn radius_to_shortest_edge_limit(&self) -> f64
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.
sourcepub fn from_radius_to_shortest_edge_ratio(ratio: f64) -> Self
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
ratio | Bound on smallest angle (deg) | Bound on smallest angle (rad) |
---|---|---|
0.58 | 60.00° | 1.05 |
0.60 | 56.44° | 0.99 |
0.70 | 45.58° | 0.80 |
0.80 | 38.68° | 0.68 |
0.90 | 33.75° | 0.59 |
1.00 | 30.00° | 0.52 |
1.10 | 27.04° | 0.47 |
1.20 | 24.62° | 0.43 |
1.30 | 22.62° | 0.39 |
+INF | 0° | 0 |
Trait Implementations§
source§impl Clone for AngleLimit
impl Clone for AngleLimit
source§fn clone(&self) -> AngleLimit
fn clone(&self) -> AngleLimit
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AngleLimit
impl Debug for AngleLimit
source§impl Default for AngleLimit
impl Default for AngleLimit
source§impl PartialEq for AngleLimit
impl PartialEq for AngleLimit
source§impl PartialOrd for AngleLimit
impl PartialOrd for AngleLimit
impl Copy for AngleLimit
impl StructuralPartialEq for AngleLimit
Auto Trait Implementations§
impl Freeze for AngleLimit
impl RefUnwindSafe for AngleLimit
impl Send for AngleLimit
impl Sync for AngleLimit
impl Unpin for AngleLimit
impl UnwindSafe for AngleLimit
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)