pub struct Mesh {
pub vertices: Vec<Vertex>,
pub vertex_count: usize,
pub faces: Vec<Face>,
pub face_count: usize,
pub halfedges: Vec<Halfedge>,
pub halfedge_count: usize,
pub edges: FnvHashMap<EdgeEndpoints, Id>,
}
Fields
vertices: Vec<Vertex>
vertex_count: usize
faces: Vec<Face>
face_count: usize
halfedges: Vec<Halfedge>
halfedge_count: usize
edges: FnvHashMap<EdgeEndpoints, Id>
Implementations
sourceimpl Mesh
impl Mesh
pub fn new() -> Self
pub fn vertex(&self, id: Id) -> Option<&Vertex>
pub fn vertex_mut(&mut self, id: Id) -> Option<&mut Vertex>
pub fn peek_same_halfedge(&self, any_paired_id: Id) -> Id
pub fn edge_center(&self, id: Id) -> Point3<f32>
pub fn face_center(&self, id: Id) -> Point3<f32>
pub fn face_norm(&self, id: Id) -> Vector3<f32>
pub fn face(&self, id: Id) -> Option<&Face>
pub fn face_adj_id(&self, id: Id) -> Option<Id>
pub fn face_adj(&self, id: Id) -> Option<&Face>
pub fn halfedge_next_id(&self, id: Id) -> Option<Id>
pub fn halfedge_prev_id(&self, id: Id) -> Option<Id>
pub fn halfedge_opposite_id(&self, id: Id) -> Option<Id>
pub fn face_first_halfedge_id(&self, id: Id) -> Option<Id>
pub fn halfedge_start_vertex_id(&self, id: Id) -> Option<Id>
pub fn halfedge_face_id(&self, id: Id) -> Option<Id>
pub fn halfedge_opposite_face_id(&self, id: Id) -> Option<Id>
pub fn halfedge_direct(&self, id: Id) -> Vector3<f32>
pub fn set_halfedge_start_vertex_id(&mut self, halfedge_id: Id, vertex_id: Id)
pub fn halfedge_start_vertex_mut(&mut self, id: Id) -> Option<&mut Vertex>
pub fn halfedge_start_vertex(&self, id: Id) -> Option<&Vertex>
pub fn set_halfedge_opposite_id(&mut self, halfedge_id: Id, opposite_id: Id)
pub fn halfedge_start_vertex_alt_halfedge_id(
&self,
halfedge_id: Id
) -> Option<Id>
pub fn remove_face(&mut self, id: Id)
pub fn face_mut(&mut self, id: Id) -> Option<&mut Face>
pub fn halfedge(&self, id: Id) -> Option<&Halfedge>
pub fn halfedge_mut(&mut self, id: Id) -> Option<&mut Halfedge>
pub fn add_vertex(&mut self, position: Point3<f32>) -> usize
pub fn add_halfedge(&mut self) -> Id
pub fn pair_halfedges(&mut self, first: Id, second: Id)
pub fn unpair_halfedges(&mut self, first: Id, second: Id)
pub fn link_halfedges(&mut self, first: Id, second: Id)
pub fn add_face(&mut self) -> Id
pub fn add_linked_vertices(
&mut self,
linked_vertices: &mut HashMap<Id, Id>
) -> Id
pub fn add_vertices(&mut self, added_vertices: Vec<Id>) -> Id
pub fn add_positions(&mut self, added_positions: Vec<Point3<f32>>) -> Id
pub fn add_halfedges_and_vertices(&mut self, added_halfedges: &[(Id, Id)]) -> Id
pub fn extrude_halfedges(
&mut self,
halfedges: &Vec<Id>,
normal: Vector3<f32>,
amount: f32
)
pub fn extrude_face(
&mut self,
face_id: Id,
normal: Vector3<f32>,
amount: f32
) -> &mut Self
pub fn add_plane(&mut self, width: f32, depth: f32) -> Id
pub fn transform(&mut self, mat: &Matrix4<f32>) -> &mut Self
pub fn translate(&mut self, x: f32, y: f32, z: f32) -> &mut Self
pub fn scale(&mut self, value: f32) -> &mut Self
pub fn weld(&self) -> Self
pub fn add_mesh(&mut self, other: &Mesh)
pub fn flip_mesh(&self) -> Mesh
pub fn split_mesh_by_other(&self, other: &Mesh) -> (Mesh, Mesh)
pub fn union_convex_mesh(&self, other: &Mesh) -> Mesh
pub fn diff_convex_mesh(&self, other: &Mesh) -> Mesh
pub fn intersect_convex_mesh(&self, other: &Mesh) -> Mesh
pub fn split_mesh_by_plane(
&self,
pt_on_plane: Point3<f32>,
norm: Vector3<f32>,
fill_cut: bool
) -> (Mesh, Mesh)
pub fn fix_tjunction(&mut self) -> &mut Self
pub fn remove_extra_vertices(&self) -> Self
pub fn combine_coplanar_faces(&self) -> Self
pub fn combine_adj_faces_round(&self) -> (bool, Self)
pub fn combine_adj_faces(&self) -> Self
pub fn trim(&self, normalize: bool) -> Self
pub fn is_triangulated_mesh_manifold(&self) -> bool
pub fn broken_face_set(&self) -> HashSet<Id>
pub fn mirror_in_x(&self, center_x: f32) -> Self
pub fn mirror_in_z(&self, center_z: f32) -> Self
pub fn fix_hole(&self) -> Self
pub fn smooth(&mut self, factor: f32, limit_vertices: Option<&HashSet<usize>>)
Trait Implementations
sourceimpl AddAssign<Mesh> for Mesh
impl AddAssign<Mesh> for Mesh
sourcefn add_assign(&mut self, other: Mesh)
fn add_assign(&mut self, other: Mesh)
Performs the
+=
operation. Read moresourceimpl Triangulate for Mesh
impl Triangulate for Mesh
sourcefn triangulate(&self) -> Self
fn triangulate(&self) -> Self
Triangulate without knowing stats about the input mesh.
Auto Trait Implementations
impl RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl UnwindSafe for Mesh
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more