pub struct HalfEdgeMesh {
pub vertices: Vec<[f64; 3]>,
pub half_edges: Vec<HalfEdge>,
pub vertex_half_edge: Vec<usize>,
pub face_half_edge: Vec<usize>,
pub vertex_deleted: Vec<bool>,
pub face_deleted: Vec<bool>,
pub he_deleted: Vec<bool>,
}Expand description
Half-edge mesh topology.
Fields§
§vertices: Vec<[f64; 3]>Vertex positions.
half_edges: Vec<HalfEdge>Half-edge array.
vertex_half_edge: Vec<usize>For each vertex, one outgoing half-edge index.
face_half_edge: Vec<usize>For each face, one half-edge index.
vertex_deleted: Vec<bool>Marks deleted vertices.
face_deleted: Vec<bool>Marks deleted faces.
he_deleted: Vec<bool>Marks deleted half-edges.
Implementations§
Source§impl HalfEdgeMesh
impl HalfEdgeMesh
Sourcepub fn from_triangles(vertices: Vec<[f64; 3]>, triangles: &[[usize; 3]]) -> Self
pub fn from_triangles(vertices: Vec<[f64; 3]>, triangles: &[[usize; 3]]) -> Self
Build a half-edge mesh from vertices and triangle indices.
Sourcepub fn active_vertex_count(&self) -> usize
pub fn active_vertex_count(&self) -> usize
Number of active (non-deleted) vertices.
Sourcepub fn active_face_count(&self) -> usize
pub fn active_face_count(&self) -> usize
Number of active faces.
Sourcepub fn is_boundary_half_edge(&self, he_idx: usize) -> bool
pub fn is_boundary_half_edge(&self, he_idx: usize) -> bool
Check if a half-edge is on the boundary (no twin).
Sourcepub fn is_boundary_vertex(&self, v: usize) -> bool
pub fn is_boundary_vertex(&self, v: usize) -> bool
Check if a vertex is on the boundary.
Sourcepub fn vertex_faces(&self, v: usize) -> Vec<usize>
pub fn vertex_faces(&self, v: usize) -> Vec<usize>
Get all faces adjacent to a vertex.
Sourcepub fn vertex_neighbors(&self, v: usize) -> Vec<usize>
pub fn vertex_neighbors(&self, v: usize) -> Vec<usize>
Get one-ring neighbor vertices of a vertex.
Sourcepub fn face_normal(&self, fi: usize) -> [f64; 3]
pub fn face_normal(&self, fi: usize) -> [f64; 3]
Compute the face normal for a given face index.
Sourcepub fn extract_triangles(&self) -> Vec<[usize; 3]>
pub fn extract_triangles(&self) -> Vec<[usize; 3]>
Extract active triangles as index triples.
Trait Implementations§
Source§impl Clone for HalfEdgeMesh
impl Clone for HalfEdgeMesh
Source§fn clone(&self) -> HalfEdgeMesh
fn clone(&self) -> HalfEdgeMesh
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for HalfEdgeMesh
impl RefUnwindSafe for HalfEdgeMesh
impl Send for HalfEdgeMesh
impl Sync for HalfEdgeMesh
impl Unpin for HalfEdgeMesh
impl UnsafeUnpin for HalfEdgeMesh
impl UnwindSafe for HalfEdgeMesh
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.