Skip to main content

Module topology

Module topology 

Source
Expand description

Topology of a triangle mesh, per connected component (#144).

genus answers one number for one closed orientable surface and refuses everything else. This reports every component of a two-manifold mesh, with or without boundary and whether or not it is orientable: its counts, Euler characteristic, boundary loops, orientability and the surface it is (genus g orientable, or k crosscaps). Every component also gets a basis of its first homology with Z2 (GF(2)) coefficients: closed edge loops by the tree-cotree construction (Eppstein, “Dynamic generators of topologically embedded graphs”, 2003), generalised past its closed-orientable origin to a closed non-orientable component (the construction never reads orientability, only that every interior edge is shared by exactly two triangles) and to a component with b >= 1 boundary loops (b - 1 of them close out the rest; all b sum to zero over Z2, being the boundary of the component’s triangles taken all at once).

Everything is combinatorial: positions are never read, so the answers are exact. A mesh that is not a two-manifold – an edge on three or more triangles, or a vertex whose triangles form more than one fan – is refused, since the classification of surfaces does not describe it.

Not provided: homotopy questions (whether a given closed path is contractible, or two paths homotopic).

Structs§

ComponentTopology
The topology of one connected component.
MeshTopology
The topology of a two-manifold triangle mesh.

Enums§

SurfaceKind
Which closed surface a component is, with its boundary loops filled in.
TopologyError
Why a mesh’s topology could not be classified.

Functions§

topology
Classify every connected component of mesh.

Type Aliases§

EdgeLoop
A closed loop of mesh edges, as its vertices in order: consecutive vertices, and the last and the first, are joined by an edge.