TetGenExport["file.ext",expr]
exports data from a TetGen expression into a file.
TetGenExport["file",expr,"format"]
exports data in the specified format.
TetGenExport
TetGenExport["file.ext",expr]
exports data from a TetGen expression into a file.
TetGenExport["file",expr,"format"]
exports data in the specified format.
Details and Options
- To use TetGenExport, you first need to load it using Needs["TetGenLink`"].
- TetGenExport[File["path"],expr] is also supported.
- The following formats specific to TetGen are supported by TetGenExport:
-
"node" a list of nodes "poly" a list of facets "smesh" a simple piecewise linear complex "ele" a list of tetrahedra "face" a list of triangular faces "edge" a list of boundary faces "neigh" a list of neighbors
Examples
Basic Examples (1)
Needs["TetGenLink`"]This creates an instance of a TetGen expression:
inst = TetGenCreate[]These are points and facets to load into the instance:
pts = {{0., 0., 0.}, {2., 0., 0.}, {2., 0., 2.}, {0., 0., 2.}, {0., 12., 0.}, {2., 12., 0.}, {2., 12., 2.}, {0., 12., 2.}};
facets = {{{1, 2, 3, 4}}, {{5, 6, 7, 8}}, {{1, 5, 6, 2}}, {{2, 6, 7, 3}}, {{3, 7, 8, 4}}, {{4, 8, 5, 1}}};This loads the points and facets into the instance:
TetGenSetPoints[inst, pts];
TetGenSetFacets[inst, facets];Here is a file name to take the "poly" data:
file = FileNameJoin[{$TemporaryDirectory, "temp.poly"}];This saves the data into the file:
TetGenExport[file, inst]This shows the contents of the file:
FilePrint[file]Here is a new file name to take the "node" data:
file = FileNameJoin[{$TemporaryDirectory, "temp.node"}];This saves the data into the file:
TetGenExport[file, inst]This shows the contents of the file:
FilePrint[file]See Also
Related Guides
Text
Wolfram Research (2010), TetGenExport, Wolfram Language function, https://reference.wolfram.com/language/TetGenLink/ref/TetGenExport.html.
CMS
Wolfram Language. 2010. "TetGenExport." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/TetGenLink/ref/TetGenExport.html.
APA
Wolfram Language. (2010). TetGenExport. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/TetGenLink/ref/TetGenExport.html
BibTeX
@misc{reference.wolfram_2026_tetgenexport, author="Wolfram Research", title="{TetGenExport}", year="2010", howpublished="\url{https://reference.wolfram.com/language/TetGenLink/ref/TetGenExport.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_tetgenexport, organization={Wolfram Research}, title={TetGenExport}, year={2010}, url={https://reference.wolfram.com/language/TetGenLink/ref/TetGenExport.html}, note=[Accessed: 15-June-2026]}