vcg_count_edge_defects: Count boundary and non-manifold edges of a triangular mesh

View source: R/vcg.R

vcg_count_edge_defectsR Documentation

Count boundary and non-manifold edges of a triangular mesh

Description

Detects topology defects that prevent a mesh from being a closed, manifold, genus-0 surface, a hard precondition of algorithms such as mris_inflate. An edge is a boundary edge when it is referenced by exactly one face (i.e. it bounds a hole), and non-manifold when it is referenced by more than two faces.

Usage

vcg_count_edge_defects(mesh)

Arguments

mesh

triangular mesh of class 'mesh3d'.

Value

A named list with elements boundary_edges (number of boundary edges), nonmanifold_edges (number of non-manifold edges), and is_closed_manifold (TRUE when both counts are zero, i.e. the mesh is closed and manifold and ready for mris_inflate).

Examples

if (is_not_cran()) {

  sphere <- vcg_sphere()
  vcg_count_edge_defects(sphere)

  defective <- vcg_isosurface(left_hippocampus_mask)
  vcg_count_edge_defects(defective)

}


ravetools documentation built on Aug. 21, 2026, 5:06 p.m.