HalfEdgeFaceImpl

Struct HalfEdgeFaceImpl 

Source
pub struct HalfEdgeFaceImpl<T: HalfEdgeImplMeshType> { /* private fields */ }
Expand description

A face in a mesh.

If you want to handle a non-orientable mesh, you have to use double covering.

Also, if you have inner components, you have to use multiple faces!

Implementations§

Source§

impl<T: HalfEdgeImplMeshType> HalfEdgeFaceImpl<T>

Source

pub fn new(edge: T::E, curved: bool, payload: T::FP) -> Self

Creates a new face.

Trait Implementations§

Source§

impl<T: Clone + HalfEdgeImplMeshType> Clone for HalfEdgeFaceImpl<T>
where T::F: Clone, T::E: Clone, T::FP: Clone,

Source§

fn clone(&self) -> HalfEdgeFaceImpl<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: HalfEdgeImplMeshType> Debug for HalfEdgeFaceImpl<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: HalfEdgeImplMeshType> Default for HalfEdgeFaceImpl<T>

Source§

fn default() -> Self

Creates a deleted face

Source§

impl<T: HalfEdgeImplMeshType> Deletable<<T as MeshType>::F> for HalfEdgeFaceImpl<T>

Source§

fn delete(&mut self)

Marks the element as deleted.
Source§

fn is_deleted(&self) -> bool

Returns whether the element is deleted.
Source§

fn set_id(&mut self, id: T::F)

Sets the id of the element (un-deletes it).
Source§

fn allocate() -> Self

Allocates a new, “deleted” instance (it isn’t valid)
Source§

impl<T: HalfEdgeImplMeshType> Face for HalfEdgeFaceImpl<T>

Source§

type T = T

Associated mesh type
Source§

fn triangle_touches_boundary( &self, mesh: &T::Mesh, v0: T::V, v1: T::V, v2: T::V, ) -> Option<bool>

Whether a triangle shares a halfedge with the face. Read more
Source§

fn centroid<const D: usize>( &self, mesh: &<Self::T as MeshType>::Mesh, ) -> <Self::T as EuclideanMeshType<D>>::Vec
where Self::T: EuclideanMeshType<D>,

Naive method to get the center of the face by averaging the vertices.
Source§

impl<T: HalfEdgeImplMeshType + MeshType3D> Face3d<T> for HalfEdgeFaceImpl<T>

Source§

fn vertices_crossed<'a>( &'a self, mesh: &'a T::Mesh, ) -> impl Iterator<Item = T::Vec> + 'a + Clone + ExactSizeIterator
where T::Vertex: 'a,

Get an iterator over the cross products of the vertices of the face.
Source§

fn is_convex(&self, mesh: &T::Mesh) -> bool

Whether the face is convex. Ignores order.
Source§

fn is_planar(&self, mesh: &T::Mesh, eps: T::S) -> bool

Whether the face is planar.
Source§

fn is_planar2(&self, mesh: &T::Mesh) -> bool

Whether the face is planar.
Source§

fn has_self_intersections(&self, mesh: &T::Mesh) -> bool

Whether the face is self-intersecting. This is a quite slow O(n^2) method. Use with caution.
Source§

fn is_simple(&self, mesh: &T::Mesh) -> bool

Whether the face is simple, i.e., doesn’t self-intersect or have holes. Testing this is quite slow O(n^2). Use with caution.
Source§

fn normal_naive(&self, mesh: &T::Mesh) -> T::Vec

A fast methods to get the surface normal, but will only work for convex faces.
Source§

fn normal(&self, mesh: &T::Mesh) -> T::Vec

Get the normal of the face. Assumes the face is planar. Uses Newell’s method to handle concave faces. PERF: Why not faster? Can’t we find the normal using 3 vertices?
Source§

fn vertices_2d<'a>( &'a self, mesh: &'a T::Mesh, ) -> impl Iterator<Item = (T::Vec2, T::V)> + Clone + ExactSizeIterator + 'a

Get an iterator over the 2d vertices of the face rotated to the XY plane.
Source§

fn vec2s<'a>(&'a self, mesh: &'a T::Mesh) -> Vec<IndexedVertex2D<T::V, T::Vec2>>

Get a vector of 2d vertices of the face rotated to the XY plane.
Source§

fn as_polygon(&self, mesh: &T::Mesh) -> T::Poly

Returns the polygon of the face rotated to the XY plane.
Source§

impl<T: HalfEdgeImplMeshType> FaceBasics<T> for HalfEdgeFaceImpl<T>

Source§

fn edge(&self, mesh: &T::Mesh) -> T::Edge

Returns an edge incident to the face.
Source§

fn edge_id(&self) -> T::E

Returns the id of a half-edge incident to the face.
Source§

fn set_edge(&mut self, edge: T::E)

Sets the representative edge incident to the face.
Source§

fn id(&self) -> T::F

Returns the index of the face.
Source§

fn may_be_curved(&self) -> bool

Whether the face is allowed to be curved.
Source§

fn num_edges(&self, mesh: &T::Mesh) -> usize

Get the number of edges of the face.
Source§

fn num_vertices(&self, mesh: &T::Mesh) -> usize

Get the number of vertices of the face.
Source§

fn num_triangles(&self, mesh: &T::Mesh) -> usize

Get the number of triangles of the face. (n-2)*3
Source§

fn payload(&self) -> &T::FP

Returns the face payload.
Source§

fn payload_mut(&mut self) -> &mut T::FP

Returns a mutable reference to the face payload.
Source§

fn vertices<'a>( &'a self, mesh: &'a T::Mesh, ) -> impl Iterator<Item = T::Vertex> + 'a + Clone + ExactSizeIterator

Iterates all vertices adjacent to the face
Source§

fn edges<'a>(&'a self, mesh: &'a T::Mesh) -> ForwardEdgeIterator<'a, T>

Iterates all half-edges incident to the face
Source§

fn vertex_ids<'a>( &'a self, mesh: &'a T::Mesh, ) -> impl Iterator<Item = T::V> + 'a
where T: 'a,

Iterates all vertex ids adjacent to the face
Source§

fn has_holes(&self) -> bool

Whether the face has holes. The data structure (currently!) cannot represent holes, so this is always false.
Source§

fn edge_ids<'a>(&'a self, mesh: &'a T::Mesh) -> impl Iterator<Item = T::E> + 'a
where T: 'a,

Iterates all half-edge ids incident to the face
Source§

impl<T: Hash + HalfEdgeImplMeshType> Hash for HalfEdgeFaceImpl<T>
where T::F: Hash, T::E: Hash, T::FP: Hash,

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Copy + HalfEdgeImplMeshType> Copy for HalfEdgeFaceImpl<T>
where T::F: Copy, T::E: Copy, T::FP: Copy,

Auto Trait Implementations§

§

impl<T> Freeze for HalfEdgeFaceImpl<T>
where <T as MeshType>::F: Freeze, <T as MeshType>::E: Freeze, <T as MeshType>::FP: Freeze,

§

impl<T> RefUnwindSafe for HalfEdgeFaceImpl<T>

§

impl<T> Send for HalfEdgeFaceImpl<T>
where <T as MeshType>::F: Send, <T as MeshType>::E: Send, <T as MeshType>::FP: Send,

§

impl<T> Sync for HalfEdgeFaceImpl<T>
where <T as MeshType>::F: Sync, <T as MeshType>::E: Sync, <T as MeshType>::FP: Sync,

§

impl<T> Unpin for HalfEdgeFaceImpl<T>
where <T as MeshType>::F: Unpin, <T as MeshType>::E: Unpin, <T as MeshType>::FP: Unpin,

§

impl<T> UnwindSafe for HalfEdgeFaceImpl<T>
where <T as MeshType>::F: UnwindSafe, <T as MeshType>::E: UnwindSafe, <T as MeshType>::FP: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V