DCEL

The DCEL functionality exists under the namespace EBGeometry::DCEL and contains the following functionality:

  • Fundamental data types like vertices, half-edges, polygons, and entire surface grids.

  • BVH functionality for putting DCEL grids into bounding volume hierarchies.

Important

The DCEL functionality is not restricted to triangles, but supports N-sided polygons, including meta-data attached to the vertices, edges, and facets. The latter is particularly useful in case on wants to associate e.g. boundary conditions to specific triangles.

Main types

The main DCEL functionality (vertices, edges, faces) is provided by the following classes:

  • Vertices are implemented as a template EBGeometry::DCEL::EdgeT

template <class T, class Meta>
class VertexT

The DCEL vertex class stores the vertex position, normal vector, and the outgoing half-edge from the vertex. Note that the class has member functions for computing the vertex pseudonormal, see Normal vectors.

The full API is given in the doxygen documentation here.

  • Edges are implemented as a template EBGeometry::DCEL::EdgeT

template <class T, class Meta>
class EdgeT

The half-edges store a reference to their face, as well as pointers to the next edge, pair edge, and starting vertex.

The full API is given in the doxygen documentation here.

  • Faces are implemented as a template EBGeometry::DCEL::FaceT

template <class T, class Meta>
class FaceT

Faces also store

  • The normal vector.

  • A 2D embedding of the polygon face.

  • Centroid position.

The normal vector and 2D embedding of the facet exist because the signed distance computation requires them. The centroid position exists only because BVH partitioners will use it for partitioning the surface mesh.

The full API is given in the doxygen documentation here.

  • Mesh is implemented as a template EBGeometry::DCEL::MeshT

template <class T, class Meta>
class MeshT : public SignedDistanceFunction<T>

The mesh stores all the vertices, half-edges, and faces, and if it is watertight and orientable it is also a signed distance function. Typically, the mesh is not created by the user but automatically created when reading the mesh from an input file.

The above DCEL classes have member functions of the type:

T signedDistance(const Vec3T<T>& a_point) const noexcept;
T unsignedDistance2(const Vec3T<T>& a_point) const noexcept;

which can be used to compute the distance to the various features on the mesh.

Meta-data can be attached to the DCEL primitives by selecting an appropriate type for Meta above.

BVH integration

DCEL grids can easily be embedded in BVHs by enclosing bounding volumes around the polygons (e.g., triangles). Partitioning and bounding volume constructors are provided in Source/EBGeometry_MeshDistanceFunctions.hpp.