Skip to content

LIHPC-Computational-Geometry/vtk2geogram

Repository files navigation

vtk2geogram : .vtk to .geogram mesh file conversion

Motivation

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, which uses a Gmsh Python script 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.

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, 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

Build

mkdir build
cd build
cmake ..
make

Run

./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.