pub struct Mesh {
pub verts: Vec<Vertex>,
pub faces: Vec<Face>,
pub edges: Vec<HalfEdge>,
}Expand description
The half-edge mesh.
Fields§
§verts: Vec<Vertex>§faces: Vec<Face>§edges: Vec<HalfEdge>Implementations§
Source§impl Mesh
impl Mesh
Sourcepub fn in_circle(
v_s: Real,
v_t: Real,
v0_s: Real,
v0_t: Real,
v1_s: Real,
v1_t: Real,
v2_s: Real,
v2_t: Real,
) -> Real
pub fn in_circle( v_s: Real, v_t: Real, v0_s: Real, v0_t: Real, v1_s: Real, v1_t: Real, v2_s: Real, v2_t: Real, ) -> Real
Compute the in-circle predicate for Delaunay refinement.
Sourcepub fn edge_is_locally_delaunay(&self, e: EdgeIdx) -> bool
pub fn edge_is_locally_delaunay(&self, e: EdgeIdx) -> bool
Check if an edge is locally Delaunay.
Sourcepub fn refine_delaunay(&mut self)
pub fn refine_delaunay(&mut self)
Refine a valid triangulation into a Constrained Delaunay Triangulation.
Source§impl Mesh
impl Mesh
Sourcepub fn esym(&self, e: EdgeIdx) -> EdgeIdx
pub fn esym(&self, e: EdgeIdx) -> EdgeIdx
Symmetric half-edge (always the other element of the pair).
Sourcepub fn edge_goes_left(&self, e: EdgeIdx) -> bool
pub fn edge_goes_left(&self, e: EdgeIdx) -> bool
EdgeGoesLeft: VertLeq(Dst, Org)
Sourcepub fn edge_goes_right(&self, e: EdgeIdx) -> bool
pub fn edge_goes_right(&self, e: EdgeIdx) -> bool
EdgeGoesRight: VertLeq(Org, Dst)
Sourcepub fn edge_is_internal(&self, e: EdgeIdx) -> bool
pub fn edge_is_internal(&self, e: EdgeIdx) -> bool
EdgeIsInternal: e->Rface && e->Rface->inside
Sourcepub fn make_edge(&mut self) -> Option<EdgeIdx>
pub fn make_edge(&mut self) -> Option<EdgeIdx>
tessMeshMakeEdge: creates one edge, two vertices, and a loop (face).
Sourcepub fn splice(&mut self, e_org: EdgeIdx, e_dst: EdgeIdx) -> bool
pub fn splice(&mut self, e_org: EdgeIdx, e_dst: EdgeIdx) -> bool
tessMeshSplice: the fundamental connectivity-changing operation. Exchanges eOrg->Onext and eDst->Onext.
Sourcepub fn delete_edge(&mut self, e_del: EdgeIdx) -> bool
pub fn delete_edge(&mut self, e_del: EdgeIdx) -> bool
tessMeshDelete: remove edge eDel.
Sourcepub fn add_edge_vertex(&mut self, e_org: EdgeIdx) -> Option<EdgeIdx>
pub fn add_edge_vertex(&mut self, e_org: EdgeIdx) -> Option<EdgeIdx>
tessMeshAddEdgeVertex: create a new edge eNew = eOrg->Lnext, and eNew->Dst is a new vertex. eOrg and eNew share the same left face.
Sourcepub fn split_edge(&mut self, e_org: EdgeIdx) -> Option<EdgeIdx>
pub fn split_edge(&mut self, e_org: EdgeIdx) -> Option<EdgeIdx>
tessMeshSplitEdge: split eOrg into eOrg and eNew, with eNew = eOrg->Lnext.
Sourcepub fn connect(&mut self, e_org: EdgeIdx, e_dst: EdgeIdx) -> Option<EdgeIdx>
pub fn connect(&mut self, e_org: EdgeIdx, e_dst: EdgeIdx) -> Option<EdgeIdx>
tessMeshConnect: create a new edge from eOrg->Dst to eDst->Org. Returns the new half-edge.
Sourcepub fn zap_face(&mut self, f_zap: FaceIdx)
pub fn zap_face(&mut self, f_zap: FaceIdx)
tessMeshZapFace: destroy a face and remove it from the global face list. All edges of fZap get lface = INVALID. Edges whose rface is also INVALID are deleted entirely.
Sourcepub fn count_face_verts(&self, f: FaceIdx) -> usize
pub fn count_face_verts(&self, f: FaceIdx) -> usize
Count vertices in a face loop.
Sourcepub fn merge_convex_faces(&mut self, max_verts_per_face: usize) -> bool
pub fn merge_convex_faces(&mut self, max_verts_per_face: usize) -> bool
tessMeshMergeConvexFaces: merge convex adjacent faces if the result would have <= maxVertsPerFace vertices.
Sourcepub fn flip_edge(&mut self, edge: EdgeIdx)
pub fn flip_edge(&mut self, edge: EdgeIdx)
tessMeshFlipEdge: flip an internal edge (used for Delaunay refinement).
Sourcepub fn set_winding_number(
&mut self,
value: i32,
keep_only_boundary: bool,
) -> bool
pub fn set_winding_number( &mut self, value: i32, keep_only_boundary: bool, ) -> bool
tessMeshSetWindingNumber: reset winding numbers.
Sourcepub fn discard_exterior(&mut self)
pub fn discard_exterior(&mut self)
Discard all exterior faces (zap them).
Sourcepub fn tessellate_mono_region(&mut self, face: FaceIdx) -> bool
pub fn tessellate_mono_region(&mut self, face: FaceIdx) -> bool
Tessellate a single monotone region (face). The face must be a CCW-oriented simple polygon.
Sourcepub fn tessellate_interior(&mut self) -> bool
pub fn tessellate_interior(&mut self) -> bool
Tessellate all interior monotone regions.