https://github.com/lihpc-computational-geometry/vtk2geogram
.vtk to .geogram mesh file conversion
https://github.com/lihpc-computational-geometry/vtk2geogram
cad file-conversion file-converter geometry-processing mesh mesh-processing
Last synced: 23 days ago
JSON representation
.vtk to .geogram mesh file conversion
- Host: GitHub
- URL: https://github.com/lihpc-computational-geometry/vtk2geogram
- Owner: LIHPC-Computational-Geometry
- License: agpl-3.0
- Created: 2023-10-16T14:19:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-29T15:41:09.000Z (about 2 years ago)
- Last Synced: 2025-09-05T03:01:56.082Z (5 months ago)
- Topics: cad, file-conversion, file-converter, geometry-processing, mesh, mesh-processing
- Language: C++
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# vtk2geogram : .vtk to .geogram mesh file conversion
## Motivation
[AlgoHex](https://github.com/cgg-bern/AlgoHex) is a hex-meshing algorithm that can leverage the `CELL_DATA` section of VTK files for feature-aware meshing.
A typical input dataset is [HexMe](https://www.algohex.eu/publications/hex-me-if-you-can/), which uses [a Gmsh Python script](https://github.com/cgg-bern/hex-me-if-you-can/blob/main/scripts/tetme.py) to generate such VTK files.
In order to explore this representation and to develop feature-aware meshing algorithms, I wanted to convert CAD-related data to [Geogram attributes](https://github.com/BrunoLevy/geogram/wiki/Mesh#attributes).
## Limits
- expects a tetrahedral mesh
- writes 4 files, maybe it's possible to bundle everything in a single file
- you have to import the 4 files into [Graphite](https://github.com/brunolevy/GraphiteThree), switch the painting mode into "ATTRIBUTE". A Lua script could do the job for you
- export all mesh components (points, lines, triangles, tetrahedral) even if they don't have CAD features associated
## Requirements
- a C++ 17 compiler
- [CMake](https://cmake.org/)
- [UltiMaille](https://github.com/ultimaille/ultimaille) (included as submodule)
- [Graphite](https://github.com/BrunoLevy/GraphiteThree) or [Vorpaview](https://github.com/BrunoLevy/geogram/wiki/Vorpaview), to visualize the output `.geogram` files
## Build
```bash
mkdir build
cd build
cmake ..
make
```
## Run
```bash
./vtk2geogram ../data/S0.vtk
```
will create 4 files:
- `../data/S0.vtk.point_set.geogram`
- `../data/S0.vtk.polyline.geogram`
- `../data/S0.vtk.triangles.geogram`
- `../data/S0.vtk.tetrahedra.geogram`
that you can open with [Graphite](https://github.com/brunolevy/GraphiteThree).