Skip to main content

Mesh

Struct Mesh 

Source
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

Source

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.

Source

pub fn edge_is_locally_delaunay(&self, e: EdgeIdx) -> bool

Check if an edge is locally Delaunay.

Source

pub fn refine_delaunay(&mut self)

Refine a valid triangulation into a Constrained Delaunay Triangulation.

Source§

impl Mesh

Source

pub fn new() -> Self

Create a new empty mesh with dummy sentinel nodes.

Source

pub fn esym(&self, e: EdgeIdx) -> EdgeIdx

Symmetric half-edge (always the other element of the pair).

Source

pub fn rface(&self, e: EdgeIdx) -> FaceIdx

Right face of e (= lface of Sym).

Source

pub fn dst(&self, e: EdgeIdx) -> VertIdx

Destination vertex of e (= org of Sym).

Source

pub fn oprev(&self, e: EdgeIdx) -> EdgeIdx

Oprev: Sym->Lnext

Source

pub fn lprev(&self, e: EdgeIdx) -> EdgeIdx

Lprev: Onext->Sym

Source

pub fn dprev(&self, e: EdgeIdx) -> EdgeIdx

Dprev: Lnext->Sym

Source

pub fn rprev(&self, e: EdgeIdx) -> EdgeIdx

Rprev: Sym->Onext

Source

pub fn dnext(&self, e: EdgeIdx) -> EdgeIdx

Dnext: Rprev->Sym = (Sym->Onext)->Sym

Source

pub fn rnext(&self, e: EdgeIdx) -> EdgeIdx

Rnext: Oprev->Sym = (Sym->Lnext)->Sym

Source

pub fn edge_goes_left(&self, e: EdgeIdx) -> bool

EdgeGoesLeft: VertLeq(Dst, Org)

Source

pub fn edge_goes_right(&self, e: EdgeIdx) -> bool

EdgeGoesRight: VertLeq(Org, Dst)

Source

pub fn edge_is_internal(&self, e: EdgeIdx) -> bool

EdgeIsInternal: e->Rface && e->Rface->inside

Source

pub fn make_edge(&mut self) -> Option<EdgeIdx>

tessMeshMakeEdge: creates one edge, two vertices, and a loop (face).

Source

pub fn splice(&mut self, e_org: EdgeIdx, e_dst: EdgeIdx) -> bool

tessMeshSplice: the fundamental connectivity-changing operation. Exchanges eOrg->Onext and eDst->Onext.

Source

pub fn delete_edge(&mut self, e_del: EdgeIdx) -> bool

tessMeshDelete: remove edge eDel.

Source

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.

Source

pub fn split_edge(&mut self, e_org: EdgeIdx) -> Option<EdgeIdx>

tessMeshSplitEdge: split eOrg into eOrg and eNew, with eNew = eOrg->Lnext.

Source

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.

Source

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.

Source

pub fn count_face_verts(&self, f: FaceIdx) -> usize

Count vertices in a face loop.

Source

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.

Source

pub fn flip_edge(&mut self, edge: EdgeIdx)

tessMeshFlipEdge: flip an internal edge (used for Delaunay refinement).

Source

pub fn set_winding_number( &mut self, value: i32, keep_only_boundary: bool, ) -> bool

tessMeshSetWindingNumber: reset winding numbers.

Source

pub fn discard_exterior(&mut self)

Discard all exterior faces (zap them).

Source

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.

Source

pub fn tessellate_interior(&mut self) -> bool

Tessellate all interior monotone regions.

Trait Implementations§

Source§

impl Default for Mesh

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Mesh

§

impl RefUnwindSafe for Mesh

§

impl Send for Mesh

§

impl Sync for Mesh

§

impl Unpin for Mesh

§

impl UnsafeUnpin for Mesh

§

impl UnwindSafe for Mesh

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.