MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / TriMesh3dExt

Interface TriMesh3dExt

splashsurf_lib/src/mesh.rs:123–150  ·  view source on GitHub ↗

Utility functions for triangles meshes

Source from the content-addressed store, hash-verified

121
122/// Utility functions for triangles meshes
123pub trait TriMesh3dExt<R: Real> {
124 /// Returns the slice of all triangle vertices of the mesh
125 fn tri_vertices(&self) -> &[Vector3<R>];
126
127 /// Computes the area of the triangle with the given vertices
128 fn tri_area_ijk<RComp: Real>(&self, ijk: &[usize; 3]) -> RComp {
129 let v = self.tri_vertices();
130 tri_area(&v[ijk[0]], &v[ijk[1]], &v[ijk[2]])
131 }
132
133 /// Computes the face normal of the triangle with the given vertices
134 fn tri_normal_ijk<RComp: Real>(&self, ijk: &[usize; 3]) -> Vector3<RComp> {
135 let v = self.tri_vertices();
136 tri_normal(&v[ijk[0]], &v[ijk[1]], &v[ijk[2]])
137 }
138
139 /// Computes the minimum and maximum angle in the triangle with the given vertices
140 fn tri_min_max_angles_ijk<RComp: Real>(&self, ijk: &[usize; 3]) -> (RComp, RComp) {
141 let v = self.tri_vertices();
142 tri_min_max_angles(&v[ijk[0]], &v[ijk[1]], &v[ijk[2]])
143 }
144
145 /// Computes the aspect ratio of the triangle with the given vertices
146 fn tri_aspect_ratio<RComp: Real>(&self, ijk: &[usize; 3]) -> RComp {
147 let v = self.tri_vertices();
148 tri_aspect_ratio(&v[ijk[0]], &v[ijk[1]], &v[ijk[2]])
149 }
150}
151
152impl<R: Real> TriMesh3dExt<R> for TriMesh3d<R> {
153 fn tri_vertices(&self) -> &[Vector3<R>] {

Callers

nothing calls this directly

Implementers 2

halfedge_mesh.rssplashsurf_lib/src/halfedge_mesh.rs
mesh.rssplashsurf_lib/src/mesh.rs

Calls

no outgoing calls

Tested by

no test coverage detected