Automatic mesh generation requires a couple of algorithms.
Emphasis is given to the reusable parts.
The strategy is top down, first corners, then edges, faces and finally the volume. Depending on the type of geometry description, the first two steps are more or less involved. Surface mesh generation is performed by the advancing front method. By providing a few functions, the same code can be adapted to various classes of surface models. The volume mesh is generated by the Delaunay algorithm, boundary constraints are achieved by backtracking strategies.