A collection of functions to read/write tetgen files and to run the tetgen program
tetgen is a quality tetrahedral mesh generator and a 3D Delaunay triangulator. See http://tetgen.org
Classes defined in module tetgen
Functions defined in module tetgen
Read a tetgen .node file.
Returns a tuple as described in readNodesBlock.
Read a tetgen .ele file.
Returns a tuple as described in readElemsBlock.
Read a tetgen .face file.
Returns a tuple as described in readFacesBlock.
Read a tetgen .smesh file.
Returns an array of triangle elements.
Read a tetgen .poly file.
Returns an array of triangle elements.
Read a tetgen surface from a .node/.face file pair.
The given filename is either the .node or .face file. Returns a tuple of (nodes,elems).
Skip comments and blank lines on a tetgen file.
Reads from a file until the first non-comment and non-empty line. Then returns the non-empty, non-comment line, stripped from possible trailing comments. Returns None if end of file is reached.
Strip blanks, newline and comments from a line of text.
Read a number of ints from a line, adding zero for omitted values.
line is a string with b;anks separated integer values. Returns a list of nint integers. The trailing ones are set to zero if the strings contains less values.
Add an element to a collection.
Read a tetgen nodes block.
Returns a tuple with:
The last two may be None.
Read a tetgen elems block.
Returns a tuple with:
The last can be None.
Read a tetgen faces block.
Returns a a tuple with:
The last can be None.
Read a tetgen .smesh facets bock.
Returns a tuple of dictionaries with plexitudes as keys:
Read a tetgen .neigh file.
Returns an arrays containing the tetrahedra neighbours:
Write a tetgen .node file.
Write a tetgen .smesh file.
Currently it only writes the facets of a triangular surface mesh. Coords should be written independently to a .node file.
Write a tetgen surface model to .node and .smesh files.
The provided file name is the .node or the .smesh filename.
Returns the next file name in a family of tetgen file names.
Run tetgen mesher on the specified file.
The input file is a closed triangulated surface. tetgen will generate a volume tetraeder mesh inside the surface, and create a new approximation of the surface as a by-product.
Read and draw a tetgen file.
This is an experimental function for the geometry import menu.