pub struct SurfacePoint {
pub point: Point,
pub du: Vector,
pub dv: Vector,
}Expand description
A point on a surface with its first derivatives.
Fields§
§point: PointThe position.
du: VectorDerivative along u.
dv: VectorDerivative along v.
Implementations§
Source§impl SurfacePoint
impl SurfacePoint
Sourcepub fn normal(&self, tol: Tolerances) -> OgeomResult<Direction>
pub fn normal(&self, tol: Tolerances) -> OgeomResult<Direction>
The unit normal, du x dv normalized.
§Errors
OgeomError::Construction at a
degeneracy (a sphere’s pole or a cone’s apex), where no normal is
determined by the tangents.
Sourcepub fn is_degenerate(&self, tol: Tolerances) -> bool
pub fn is_degenerate(&self, tol: Tolerances) -> bool
Whether the tangents fail to determine a normal.
Compared against the square of the larger tangent, not against the product of the two. The product test asks whether the tangents are collinear, which is only one of the two ways a surface degenerates: at a sphere’s pole or a cone’s apex one tangent vanishes, and there the product is itself near zero, so a relative-to-product test finds the cross product respectably large by comparison and declares the point healthy. Squaring the larger tangent keeps a fixed scale to judge against and catches both cases.
Trait Implementations§
Source§impl Clone for SurfacePoint
impl Clone for SurfacePoint
Source§fn clone(&self) -> SurfacePoint
fn clone(&self) -> SurfacePoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SurfacePoint
Source§impl Debug for SurfacePoint
impl Debug for SurfacePoint
Source§impl PartialEq for SurfacePoint
impl PartialEq for SurfacePoint
Source§fn eq(&self, other: &SurfacePoint) -> bool
fn eq(&self, other: &SurfacePoint) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SurfacePoint
Auto Trait Implementations§
impl Freeze for SurfacePoint
impl RefUnwindSafe for SurfacePoint
impl Send for SurfacePoint
impl Sync for SurfacePoint
impl Unpin for SurfacePoint
impl UnsafeUnpin for SurfacePoint
impl UnwindSafe for SurfacePoint
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,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.