pub struct Face { /* private fields */ }Expand description
A face of a shape
Implementations
sourceimpl Face
impl Face
sourcepub fn build(surface: Surface) -> FaceBuilder
pub fn build(surface: Surface) -> FaceBuilder
Build a face using FaceBuilder
sourcepub fn new(surface: Surface) -> Self
pub fn new(surface: Surface) -> Self
Construct a new instance of Face
Creates the face with no exteriors, no interiors and the default color.
This can be overridden using the with_ methods.
sourcepub fn from_triangles(triangles: Vec<(Triangle<3>, Color)>) -> Self
pub fn from_triangles(triangles: Vec<(Triangle<3>, Color)>) -> Self
Construct an instance that uses triangle representation
Triangle representation is obsolete, and only still present because there is one last place in the kernel code that uses it. Don’t add any more of those places!
See this issue for more context: https://github.com/hannobraun/Fornjot/issues/97
sourcepub fn with_exteriors(self, exteriors: impl IntoIterator<Item = Cycle>) -> Self
pub fn with_exteriors(self, exteriors: impl IntoIterator<Item = Cycle>) -> Self
Add exterior 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.
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.
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 exteriors(&self) -> impl Iterator<Item = &Cycle> + '_
pub fn exteriors(&self) -> impl Iterator<Item = &Cycle> + '_
Access the cycles that bound the face on the outside
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
This is equivalent to chaining the iterators returned by
Face::exteriors and Face::interiors.
Trait Implementations
sourceimpl Approx for Face
impl Approx for Face
type Approximation = FaceApprox
type Approximation = FaceApprox
The approximation of the object
sourcefn approx(&self, tolerance: Tolerance) -> Self::Approximation
fn approx(&self, tolerance: Tolerance) -> Self::Approximation
Approximate the object Read more
sourceimpl From<FacePolygon> for Face
impl From<FacePolygon> for Face
sourcefn from(polygon: FacePolygon) -> Self
fn from(polygon: FacePolygon) -> Self
Converts to this type from the input type.
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<'_>>
Return all objects that this one references
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;
Iterate over all faces
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;
Iterate over all curves
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;
Iterate over all cycles
sourcefn edge_iter(&'r self) -> Iter<&'r Edge>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn edge_iter(&'r self) -> Iter<&'r Edge>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
Iterate over all edges
sourcefn global_curve_iter(&'r self) -> Iter<&'r GlobalCurve>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
fn global_curve_iter(&'r self) -> Iter<&'r GlobalCurve>ⓘNotable traits for Iter<T>impl<T> Iterator for Iter<T> type Item = T;
Iterate over all global curves
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;
Iterate over all global vertices
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;
Iterate over all shells
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;
Iterate over all sketches
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;
Iterate over all solids
sourceimpl Ord for Face
impl Ord for Face
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Face> for Face
impl PartialEq<Face> for Face
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>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
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>
Convert 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 more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
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.