pub struct NormalCone {
pub axis: [f64; 3],
pub half_angle: f64,
}Expand description
A normal cone: represents the range of normals in a region.
Defined by an axis (average normal) and a half-angle (max deviation).
Fields§
§axis: [f64; 3]Axis of the cone (unit vector).
half_angle: f64Half-angle of the cone in radians.
Implementations§
Source§impl NormalCone
impl NormalCone
Sourcepub fn from_normal(n: [f64; 3]) -> Self
pub fn from_normal(n: [f64; 3]) -> Self
Create a normal cone from a single normal vector.
Sourcepub fn merge(&self, other: &NormalCone) -> NormalCone
pub fn merge(&self, other: &NormalCone) -> NormalCone
Merge two normal cones into a bounding cone.
Sourcepub fn contains(&self, n: [f64; 3], tol: f64) -> bool
pub fn contains(&self, n: [f64; 3], tol: f64) -> bool
Check whether a new normal falls within this cone (with tolerance tol).
Sourcepub fn half_angle_deg(&self) -> f64
pub fn half_angle_deg(&self) -> f64
Convert half-angle to degrees.
Trait Implementations§
Source§impl Clone for NormalCone
impl Clone for NormalCone
Source§fn clone(&self) -> NormalCone
fn clone(&self) -> NormalCone
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NormalCone
impl Debug for NormalCone
impl Copy for NormalCone
Auto Trait Implementations§
impl Freeze for NormalCone
impl RefUnwindSafe for NormalCone
impl Send for NormalCone
impl Sync for NormalCone
impl Unpin for NormalCone
impl UnsafeUnpin for NormalCone
impl UnwindSafe for NormalCone
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.