pub struct SimplePolygon<T, D>{ /* private fields */ }
Implementations§
Source§impl<T, D> SimplePolygon<T, D>
impl<T, D> SimplePolygon<T, D>
pub fn from_vertices(vertices: Vec<OPoint<T, D>>) -> Self
pub fn vertices(&self) -> &[OPoint<T, D>]
pub fn transform_vertices<F>(&mut self, transform: F)
pub fn num_vertices(&self) -> usize
pub fn num_edges(&self) -> usize
pub fn assume_convex(&self) -> Convex<&Self>
Source§impl<T: Real> SimplePolygon<T, Const<2>>
impl<T: Real> SimplePolygon<T, Const<2>>
Sourcepub fn apply_isometry(&self, similarity: &Isometry3<T>) -> SimplePolygon3d<T>
pub fn apply_isometry(&self, similarity: &Isometry3<T>) -> SimplePolygon3d<T>
Apply a similarity transform in order to construct a 3D simple polygon.
Each 2D vertex is implicitly assumed to have z coordinate 0.
Source§impl<T: Real> SimplePolygon<T, Const<3>>
impl<T: Real> SimplePolygon<T, Const<3>>
pub fn area_vector(&self) -> Vector3<T>
pub fn area(&self) -> T
pub fn intersect_half_space( &self, half_space: &HalfSpace<T>, ) -> SimplePolygon3d<T>
Source§impl<T> SimplePolygon<T, Const<2>>where
T: Scalar,
impl<T> SimplePolygon<T, Const<2>>where
T: Scalar,
Sourcepub fn edge_iter<'a>(&'a self) -> impl 'a + Iterator<Item = LineSegment2d<T>>
pub fn edge_iter<'a>(&'a self) -> impl 'a + Iterator<Item = LineSegment2d<T>>
An iterator over edges as line segments
Trait Implementations§
Source§impl<T, D> BoundedGeometry<T> for SimplePolygon<T, D>
impl<T, D> BoundedGeometry<T> for SimplePolygon<T, D>
type Dimension = D
fn bounding_box(&self) -> AxisAlignedBoundingBox<T, D>
Source§impl<T, D> Clone for SimplePolygon<T, D>
impl<T, D> Clone for SimplePolygon<T, D>
Source§fn clone(&self) -> SimplePolygon<T, D>
fn clone(&self) -> SimplePolygon<T, D>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T, D> Debug for SimplePolygon<T, D>
impl<T, D> Debug for SimplePolygon<T, D>
Source§impl<'de, T, D> Deserialize<'de> for SimplePolygon<T, D>
impl<'de, T, D> Deserialize<'de> for SimplePolygon<T, D>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, D> PartialEq for SimplePolygon<T, D>
impl<T, D> PartialEq for SimplePolygon<T, D>
Source§impl<T, D> Serialize for SimplePolygon<T, D>
impl<T, D> Serialize for SimplePolygon<T, D>
impl<T, D> Eq for SimplePolygon<T, D>
impl<T, D> StructuralPartialEq for SimplePolygon<T, D>
Auto Trait Implementations§
impl<T, D> Freeze for SimplePolygon<T, D>where
DefaultAllocator: Sized,
impl<T, D> !RefUnwindSafe for SimplePolygon<T, D>
impl<T, D> !Send for SimplePolygon<T, D>
impl<T, D> !Sync for SimplePolygon<T, D>
impl<T, D> !Unpin for SimplePolygon<T, D>
impl<T, D> !UnwindSafe for SimplePolygon<T, D>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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.