pub struct GeodesicMesh {
pub vertices: Vec<[f64; 3]>,
pub faces: Vec<[usize; 3]>,
}Expand description
Triangle mesh for geodesic geometry computations.
Stores vertex positions and triangle connectivity. All algorithms in this module operate on this structure.
Fields§
§vertices: Vec<[f64; 3]>Vertex positions in 3-space.
faces: Vec<[usize; 3]>Triangular faces as index triples [v0, v1, v2].
Implementations§
Source§impl GeodesicMesh
impl GeodesicMesh
Sourcepub fn new(vertices: Vec<[f64; 3]>, faces: Vec<[usize; 3]>) -> Self
pub fn new(vertices: Vec<[f64; 3]>, faces: Vec<[usize; 3]>) -> Self
Create a new geodesic mesh.
Sourcepub fn num_vertices(&self) -> usize
pub fn num_vertices(&self) -> usize
Number of vertices.
Sourcepub fn vertex_adjacency(&self) -> Vec<Vec<usize>>
pub fn vertex_adjacency(&self) -> Vec<Vec<usize>>
Build adjacency: for each vertex, the list of neighbouring vertices.
Sourcepub fn vertex_to_faces(&self) -> Vec<Vec<usize>>
pub fn vertex_to_faces(&self) -> Vec<Vec<usize>>
Build face adjacency: for each vertex, which faces contain it.
Sourcepub fn face_normal(&self, fi: usize) -> [f64; 3]
pub fn face_normal(&self, fi: usize) -> [f64; 3]
Compute the face normal of a triangle (unnormalized).
Sourcepub fn vertex_normal(&self, vi: usize) -> [f64; 3]
pub fn vertex_normal(&self, vi: usize) -> [f64; 3]
Compute area-weighted vertex normal.
Sourcepub fn total_area(&self) -> f64
pub fn total_area(&self) -> f64
Total surface area.
Sourcepub fn tangent_frame(&self, vi: usize) -> ([f64; 3], [f64; 3], [f64; 3])
pub fn tangent_frame(&self, vi: usize) -> ([f64; 3], [f64; 3], [f64; 3])
Build a local tangent frame at a vertex: returns (tangent, bitangent, normal).
Sourcepub fn cotangent_weight(&self, i: usize, j: usize) -> f64
pub fn cotangent_weight(&self, i: usize, j: usize) -> f64
Cotangent weight for edge (i, j). Returns the sum of cot(alpha) + cot(beta) where alpha, beta are the angles opposite to edge ij in the two adjacent triangles.
Sourcepub fn voronoi_area(&self, vi: usize) -> f64
pub fn voronoi_area(&self, vi: usize) -> f64
Voronoi area at vertex vi (mixed area formulation).
Trait Implementations§
Source§impl Clone for GeodesicMesh
impl Clone for GeodesicMesh
Source§fn clone(&self) -> GeodesicMesh
fn clone(&self) -> GeodesicMesh
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for GeodesicMesh
impl RefUnwindSafe for GeodesicMesh
impl Send for GeodesicMesh
impl Sync for GeodesicMesh
impl Unpin for GeodesicMesh
impl UnsafeUnpin for GeodesicMesh
impl UnwindSafe for GeodesicMesh
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
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>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.