pub struct PointDistance(/* private fields */);Expand description
A shape’s boundary gathered once, to measure many points against.
Implementations§
Source§impl PointDistance
impl PointDistance
Sourcepub fn of(model: &Model, shape: &Shape, tol: Tolerances) -> OgeomResult<Self>
pub fn of(model: &Model, shape: &Shape, tol: Tolerances) -> OgeomResult<Self>
The vertices, edges and faces of shape, placed.
§Errors
OgeomError::Dangling if a handle fails to
resolve.
Sourcepub fn nearest(&self, p: Point, tol: Tolerances) -> OgeomResult<(f64, Point)>
pub fn nearest(&self, p: Point, tol: Tolerances) -> OgeomResult<(f64, Point)>
The least distance from p to the shape’s boundary and a point of it
at that distance, as distance_between_shapes measures it from a
vertex at p: to each vertex, the foot on each edge, and the foot on
each face where it lands inside the face’s trimming. Where a curved
face’s foot stands outside its trim, its local feet inside it, sought
from samples of the face, are candidates too.
§Errors
OgeomError::Construction if the shape
has no vertex, edge or face foot to measure to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PointDistance
impl RefUnwindSafe for PointDistance
impl Send for PointDistance
impl Sync for PointDistance
impl Unpin for PointDistance
impl UnsafeUnpin for PointDistance
impl UnwindSafe for PointDistance
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
§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.