There are a number of file formats for working with meshes. They are useful since they can be used as interchange formats between CAD programs. Some of these are supported by TetGen and some by the Wolfram Language. This section reviews the formats that are supported and shows how you can work with them.
TetGen supports its own formats and also some standard formats. More information on the details of its formats and samples can be found on the TetGen website (http://tetgen.org).
|.node||input/output||a list of nodes|
|.poly||input||a piecewise linear complex|
|.smesh||input/output||a simple piecewise linear complex|
|.ele||input/output||a list of tetrahedra|
|.face||input/output||a list of triangular faces|
|.edge||output||a list of boundary faces|
|.vol||input||a list of maximum volumes|
|.var||input||a list of variant constraints for facets/segments|
|.neigh||output||a list of neighbors|
In addition to TetGen-specific formats, TetGen supports a number of other file formats. Note that STL is also supported by the Wolfram Language's Import command.
|.off||input/output||Geomview's polyhedral file format|
|.ply||input||polyhedral file format|
|.mesh||input/output||Medit's surface mesh file format|
|STL||.stl||input/output||computer-aided design and manufacturing format|
|3DS||.3ds||input/output||Autodesk format for scene description and 3D modeling|
|DXF||.dxf||input/output||AutoCAD format for 3D geometry|
These formats are often supported by CAD and other engineering applications, sometimes using them as interchange formats. Also, there are many samples of these files available on websites; one of these is http://www-roc.inria.fr/gamma/download, which has a large collection of files. For example, the gear10 example shown below comes from the "MECHANICAL" section.
This is a sample 3DS data file. You would need to obtain it from the http://www-roc.inria.fr site described above.
Second, TetGenSetMessages is used to enable messages. Then the tetrahedralization is done. It creates a lot of information, including messages that there are duplicate points in the dataset. This can sometimes create problems.