TetGenImport["file.ext",expr]
imports data from a file into a TetGen expression.
TetGenImport["file",expr,"format"]
imports data in the specified format.
TetGenImport
TetGenImport["file.ext",expr]
imports data from a file into a TetGen expression.
TetGenImport["file",expr,"format"]
imports data in the specified format.
Details and Options
- To use TetGenImport, you first need to load it using Needs["TetGenLink`"].
- TetGenImport[File["path"],expr] is also supported.
- The following formats specific to TetGen are supported by TetGenImport:
-
"node" a list of nodes "poly" a piecewise linear complex "smesh" a simple piecewise linear complex "ele" a list of tetrahedra "face" a list of triangular faces "vol" a list of maximum volumes "var" a list of variant constraints for facets/segments "neigh" a list of neighbors - The following general formats are supported by TetGenImport:
-
"off" Geomview's polyhedral file format "ply" polyhedral file format "stl" computer-aided design and manufacturing format "mesh" Medit's surface mesh file format - If no format is given, it is determined from the file extension.
- TetGenImport currently works with the ASCII version of the above mentioned formats only. Use Import for binary versions of the file formats.
Examples
Basic Examples (1)
Needs["TetGenLink`"]This creates an instance of a TetGen expression:
inst = TetGenCreate[]This finds a sample data file in the TetGenLink installation:
dataFile = FileNameJoin[{$TetGenInstallationDirectory, "ExampleData", "bar.poly"}];This loads the data file into the TetGen instance:
TetGenImport[ dataFile, inst]This extracts the points and facets:
pts = TetGenGetPoints[inst];
verts = TetGenGetFacets[inst];Graphics3D[GraphicsComplex[pts, Map[Polygon, verts]]]Tech Notes
Related Guides
Text
Wolfram Research (2010), TetGenImport, Wolfram Language function, https://reference.wolfram.com/language/TetGenLink/ref/TetGenImport.html.
CMS
Wolfram Language. 2010. "TetGenImport." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/TetGenLink/ref/TetGenImport.html.
APA
Wolfram Language. (2010). TetGenImport. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/TetGenLink/ref/TetGenImport.html
BibTeX
@misc{reference.wolfram_2026_tetgenimport, author="Wolfram Research", title="{TetGenImport}", year="2010", howpublished="\url{https://reference.wolfram.com/language/TetGenLink/ref/TetGenImport.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_tetgenimport, organization={Wolfram Research}, title={TetGenImport}, year={2010}, url={https://reference.wolfram.com/language/TetGenLink/ref/TetGenImport.html}, note=[Accessed: 15-June-2026]}