pyblenderSDIC.meshes.TriangleMesh3D.to_vtk#
- TriangleMesh3D.to_vtk(filename: str) None [source]#
Save the TriangleMesh3D instance to a VTK file.
This method writes the mesh data to a VTK file. It uses the meshio library to write the mesh data, including vertices, triangles, and UV map (if available).
from pyblenderSDIC.mesh import TriangleMesh3D # Create a TriangleMesh3D instance mesh = TriangleMesh3D(vertices=..., triangles=...) # Save the mesh to a VTK file mesh.to_vtk("path/to/mesh.vtk")
Note
If the filename does not end with “.vtk”, the extension will be added automatically.
See also
to_meshio()
for converting the TriangleMesh3D instance to a meshio object and more details about the meshio structure.- Parameters:
filename (str) – The path to the VTK file where the mesh will be saved.