Skip to main content

euler_characteristic

Function euler_characteristic 

Source
pub fn euler_characteristic(
    vertex_count: u32,
    face_count: u32,
    half_edges: &[HalfEdge],
) -> i32
Expand description

Compute the Euler characteristic χ = V − E + F.

  • vertex_count: number of unique vertices.
  • face_count: number of faces.
  • half_edges: the half-edge array. Unique undirected edges are counted as (total half-edges + boundary half-edges) / 2, since each interior edge contributes 2 half-edges and each boundary edge contributes 1.