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§
source§impl Face
impl Face
sourcepub fn new(
exterior: Handle<Cycle>,
interiors: impl IntoIterator<Item = Handle<Cycle>>,
color: Color
) -> Self
pub fn new(
exterior: Handle<Cycle>,
interiors: impl IntoIterator<Item = Handle<Cycle>>,
color: Color
) -> Self
Construct an instance of Face
sourcepub fn interiors(&self) -> impl Iterator<Item = &Handle<Cycle>> + '_
pub fn interiors(&self) -> impl Iterator<Item = &Handle<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 = &Handle<Cycle>> + '_
pub fn all_cycles(&self) -> impl Iterator<Item = &Handle<Cycle>> + '_
Access all cycles of the 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§
source§impl Approx for &Face
impl Approx for &Face
§type Approximation = FaceApprox
type Approximation = FaceApprox
§type Cache = CurveCache
type Cache = CurveCache
source§fn 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
source§impl From<&Face> for PartialFace
impl From<&Face> for PartialFace
source§impl HasPartial for Face
impl HasPartial for Face
source§impl Ord for Face
impl Ord for Face
source§impl PartialOrd<Face> for Face
impl PartialOrd<Face> for Face
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl TransformObject for Face
impl TransformObject for Face
source§fn transform_with_cache(
self,
transform: &Transform,
objects: &mut Service<Objects>,
cache: &mut TransformCache
) -> Self
fn transform_with_cache(
self,
transform: &Transform,
objects: &mut Service<Objects>,
cache: &mut TransformCache
) -> Self
source§fn transform(self, transform: &Transform, objects: &mut Service<Objects>) -> Self
fn transform(self, transform: &Transform, objects: &mut Service<Objects>) -> Self
source§impl Validate for Face
impl Validate for Face
§type Error = FaceValidationError
type Error = FaceValidationError
source§fn validate_with_config(&self, _: &ValidationConfig) -> Result<(), Self::Error>
fn validate_with_config(&self, _: &ValidationConfig) -> Result<(), Self::Error>
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§
§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 more§fn 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 more§fn 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 more§fn 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 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>
self from the equivalent element of its
superset. Read more§fn 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.