Most problems in computational conformal geometry can be formulated as solving Partial Differential Equations
(PDE) on surfaces. In practice, surfaces are approximated by triangle meshes, geometric quatities are represented by attributes
of vertices, edges and faces of the meshes, the PDE is approximated by large sparse linear systems. The main three
central data structures of CCGL are
- Halfedge data structure to represent triangle meshes.
- Traits on vertices, edges, halfedges and faces.
- Sparse matrix.
Halfedge Data Structure
The connectivity of mesh is represented by halfedge data structure. The primitives, such as vertex, edge and face are connected
using pointers. The halfedge data structure is designed for efficient access adjacent primitives. All the topological
information are encoded by the halfedge data structure, for example
- Fundamental group
- Homology Groups
- Cohomology Groups
- Euler number
CCGL also offers different iterators for accessing adjacent primitives conveniently. Most frequently used topological quantities are
special closed curves on the surface, represented as a set of consequtive edges, marked as sharp edges.
Traits
Different geometric quantities are represented as different attributes of vertices, edges or faces.
The followings are the common ones
- Riemannian metric - edge lengths
- Gaussian curvature - vertex curvature
- Differential forms - functions defined on halfedges
- Harmonic maps - planar points defined on vertices
Different applications require different attributes. Therefore, CCGL offers a base Trait class, any
noval attributes can be defined as the inheriated class from it. Each vertex, edge, halfedge and face
has a pointer to a trait object. The traits can be dynamically allocated or delocated.
The trait valuces can be recorded as strings and save to the mesh files. CCGL offers a parser class, which can be used
to read in or write out trait values from or to the files.
Sparse Matrixs
The geometric processing problems are converted to solve large scale sparse linear systems. CCGL offers a generic sparse linear matrix
class, which can be used as the interface to linear system solvers.
Examples
The whole design of CCGL is tried to be as simple as possible. The principles are simple and effective. The codes are self-evident.
Users can understand it immediately after reading the code of viewer or harmonic map.