pub struct Mesh {
pub vertices: Tensor,
pub faces: Vec<[usize; 3]>,
pub features: Option<Tensor>,
}Expand description
Mesh representation
Fields§
§vertices: TensorVertices: [num_vertices, 3] (x, y, z coordinates)
faces: Vec<[usize; 3]>Faces: [num_faces, 3] (vertex indices for triangles)
features: Option<Tensor>Vertex features: [num_vertices, feature_dim]
Implementations§
Source§impl Mesh
impl Mesh
Sourcepub fn with_features(
vertices: Tensor,
faces: Vec<[usize; 3]>,
features: Tensor,
) -> Self
pub fn with_features( vertices: Tensor, faces: Vec<[usize; 3]>, features: Tensor, ) -> Self
Create mesh with features
Sourcepub fn num_vertices(&self) -> usize
pub fn num_vertices(&self) -> usize
Get number of vertices
Sourcepub fn compute_adjacency(&self) -> Vec<Vec<usize>>
pub fn compute_adjacency(&self) -> Vec<Vec<usize>>
Compute adjacency list
Sourcepub fn compute_face_normals(&self) -> Result<Tensor, String>
pub fn compute_face_normals(&self) -> Result<Tensor, String>
Compute face normals
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mesh
impl !RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl !UnwindSafe for Mesh
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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