pub struct Face { /* private fields */ }Expand description
A face of a shape
A Face is a bounded area of a Surface, the Surface itself being an
infinite 2-dimensional object in 3D space. Faces are bound by one exterior
cycle, which defines the outer boundary, and an arbitrary number of interior
cycles (i.e. holes).
Face has a defined orientation, a front and a back side. When faces are
combined into Shells, the face orientation defines what is inside and
outside of the shell. This stands in contrast to Surface, which has no
defined orientation.
You can look at a Face from two directions: front and back. The winding of
the exterior cycle will be clockwise or counter-clockwise, depending on your
perspective. The front side of the face, is the side where from which the
exterior cycle appear counter-clockwise.
Interior cycles must have the opposite winding of the exterior cycle,
meaning on the front side of the face, they must appear clockwise. This
means that all HalfEdges that bound a Face have the interior of the
face on their left side (on the face’s front side).
Implementations
sourceimpl Face
impl Face
sourcepub fn builder(stores: &Stores, surface: Handle<Surface>) -> FaceBuilder<'_>
pub fn builder(stores: &Stores, surface: Handle<Surface>) -> FaceBuilder<'_>
Build a Face using FaceBuilder
sourcepub fn from_exterior(exterior: Cycle) -> Self
pub fn from_exterior(exterior: Cycle) -> Self
Construct a new instance of Face
Creates the face with no interiors and the default color. This can be
overridden using the with_ methods.
sourcepub fn with_interiors(self, interiors: impl IntoIterator<Item = Cycle>) -> Self
pub fn with_interiors(self, interiors: impl IntoIterator<Item = Cycle>) -> Self
Add interior cycles to the face
Consumes the face and returns the updated instance.
Panics
Panics, if the added cycles are not defined in the face’s surface.
Panics, if the winding of the interior cycles is not opposite that of the exterior cycle.
sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Update the color of the face
Consumes the face and returns the updated instance.
sourcepub fn interiors(&self) -> impl Iterator<Item = &Cycle> + '_
pub fn interiors(&self) -> impl Iterator<Item = &Cycle> + '_
Access the cycles that bound the face on the inside
Each of these cycles defines a hole in the face.
sourcepub fn all_cycles(&self) -> impl Iterator<Item = &Cycle> + '_
pub fn all_cycles(&self) -> impl Iterator<Item = &Cycle> + '_
Access all cycles of this face
sourcepub fn coord_handedness(&self) -> Handedness
pub fn coord_handedness(&self) -> Handedness
Determine handed-ness of the face’s front-side coordinate system
A face is defined on a surface, which has a coordinate system. Since surfaces aren’t considered to have an orientation, their coordinate system can be considered to be left-handed or right-handed, depending on which side of the surface you’re looking at.
Faces do have an orientation, meaning they have definite front and back sides. The front side is the side, where the face’s exterior cycle is wound counter-clockwise.
Trait Implementations
sourceimpl Approx for &Face
impl Approx for &Face
type Approximation = FaceApprox
type Approximation = FaceApprox
type Cache = CurveCache
type Cache = CurveCache
sourcefn approx_with_cache(
self,
tolerance: impl Into<Tolerance>,
cache: &mut Self::Cache
) -> Self::Approximation
fn approx_with_cache(
self,
tolerance: impl Into<Tolerance>,
cache: &mut Self::Cache
) -> Self::Approximation
sourceimpl Extend<Face> for Faces
impl Extend<Face> for Faces
sourcefn extend<T: IntoIterator<Item = Face>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Face>>(&mut self, iter: T)
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)sourceimpl<'r> ObjectIters<'r> for Face
impl<'r> ObjectIters<'r> for Face
sourcefn referenced_objects(&'r self) -> Vec<&'r dyn ObjectIters<'_>>
fn referenced_objects(&'r self) -> Vec<&'r dyn ObjectIters<'_>>
sourcefn face_iter(&'r self) -> Iter<&'r Face>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn face_iter(&'r self) -> Iter<&'r Face>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn curve_iter(&'r self) -> Iter<&'r Curve>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn curve_iter(&'r self) -> Iter<&'r Curve>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn cycle_iter(&'r self) -> Iter<&'r Cycle>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn cycle_iter(&'r self) -> Iter<&'r Cycle>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn global_curve_iter(&'r self) -> Iter<&'r Handle<GlobalCurve>>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn global_curve_iter(&'r self) -> Iter<&'r Handle<GlobalCurve>>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn global_vertex_iter(&'r self) -> Iter<&'r GlobalVertex>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn global_vertex_iter(&'r self) -> Iter<&'r GlobalVertex>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn half_edge_iter(&'r self) -> Iter<&'r HalfEdge>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn half_edge_iter(&'r self) -> Iter<&'r HalfEdge>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn shell_iter(&'r self) -> Iter<&'r Shell>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn shell_iter(&'r self) -> Iter<&'r Shell>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn sketch_iter(&'r self) -> Iter<&'r Sketch>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn sketch_iter(&'r self) -> Iter<&'r Sketch>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourcefn solid_iter(&'r self) -> Iter<&'r Solid>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn solid_iter(&'r self) -> Iter<&'r Solid>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
sourceimpl Ord for Face
impl Ord for Face
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<Face> for Face
impl PartialOrd<Face> for Face
sourcefn partial_cmp(&self, other: &Face) -> Option<Ordering>
fn partial_cmp(&self, other: &Face) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl TransformObject for Face
impl TransformObject for Face
impl Eq for Face
impl StructuralEq for Face
impl StructuralPartialEq for Face
Auto Trait Implementations
impl !RefUnwindSafe for Face
impl Send for Face
impl Sync for Face
impl Unpin for Face
impl !UnwindSafe for Face
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moreimpl<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 morefn 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.