Read triangular/tetrahedral mesh saved as vtk unstructured grid in python/ C++
✓ Published0🌍 Public
CChristosT
Last edited Dec 6, 2019
Created on Dec 5, 2019
This example demonstrates how to read triangular or tetrahedral mesh data from a VTK unstructured grid file. It shows the mesh’s number of points and elements, iterates through cell connectivity, and retrieves a per-point “weights” array. The Python version uses the `vtkUnstructuredGridReader` from the VTK library, and also illustrates two additional access methods: converting the raw data into NumPy arrays via `GetPoints()` and `GetCells()`, and using the `dataset_adapter` wrapper for direct array-like access. A C++ implementation relies on VTK’s `vtkUnstructuredGridReader`, `vtkPoints`, and `vtkCellIterator` APIs.
AI-generated description