pub struct Polyhedron { /* private fields */ }Expand description
A closed solid bounded by planar polygonal faces.
Each face is a vertex ring wound counter-clockwise seen from outside, so the outward normal follows the right-hand rule. That convention is what makes containment decidable without a separate inside/outside oracle.
Implementations§
Source§impl Polyhedron
impl Polyhedron
Sourcepub fn new(faces: Vec<Vec<DVec3>>) -> Result<Polyhedron, GeomError>
pub fn new(faces: Vec<Vec<DVec3>>) -> Result<Polyhedron, GeomError>
Build from outward-wound planar faces.
Faces are validated as planar here rather than trusted, because every later decision assumes it. A non-planar ring has no single plane to classify against, so accepting one would make the exactness claim meaningless.
Trait Implementations§
Source§impl Clone for Polyhedron
impl Clone for Polyhedron
Source§fn clone(&self) -> Polyhedron
fn clone(&self) -> Polyhedron
Returns a copy 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 Polyhedron
impl Debug for Polyhedron
Source§impl PartialEq for Polyhedron
impl PartialEq for Polyhedron
impl StructuralPartialEq for Polyhedron
Auto Trait Implementations§
impl Freeze for Polyhedron
impl RefUnwindSafe for Polyhedron
impl Send for Polyhedron
impl Sync for Polyhedron
impl Unpin for Polyhedron
impl UnwindSafe for Polyhedron
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 more