This repository turns VTK geometry into AR-ready assets and publishes them as a GitHub Pages site with one page per model.
It supports two workflows:
- static models from
.vtpor.vtuinputs - animated models from time-series
.vtuinputs with--animated
Website is live at https://stanfordcbcl.github.io/ar-models/
Firstly, you need the following installed locally
/Applications/ParaView-6.1.0.app/Applications/Blender.app- macOS shell with
/usr/bin/python3
There are two good ways to add a model to the site.
Static model:
./bin/vtk-to-ar --name "<slug-for-your-model>" --title "<title-for-your-model>" "<path-to-your-vtk-files>"Animated model:
./bin/vtk-to-ar --animated --name "<slug-for-your-model>" --title "<title-for-your-model>" "<path-to-your-time-series-vtu-files>"The command will:
- Discover
.vtpand.vtufiles from the provided paths. - Choose the static or animated pipeline based on
--animated. - Ask for Blender-facing parameters unless you pass them explicitly.
- Export intermediate
.plymeshes with ParaView. - Build
.glband.usdzassets with Blender. - Publish assets, update the manifest, regenerate the index page, and create
docs/models/<slug>/index.html.
Useful static-model flags:
./bin/vtk-to-ar \
--name "<slug-for-your-model>" \
--title "<title-for-your-model>" \
--fit-meters <target-size-in-meters> \
--decimate-ratio <value-between-0-and-1> \
--rotation-deg <x,y,z-degrees> \
--color-mode <auto-or-vertex> \
--part-color <part-name>=#RRGGBB \
--non-interactive \
"<path-to-your-vtk-files>"Useful animated-model flags:
./bin/vtk-to-ar \
--animated \
--name "<slug-for-your-model>" \
--title "<title-for-your-model>" \
--animation-frames <sampled-frame-count> \
--animation-fps <viewer-fps> \
--pressure-array <point-data-array-name> \
--pressure-divisor <unit-conversion-divisor> \
--representative-frame peak-max-pressure \
--fit-meters <target-size-in-meters> \
--decimate-ratio <value-between-0-and-1> \
--rotation-deg <x,y,z-degrees> \
--non-interactive \
"<path-to-your-time-series-vtu-files>"Animated export notes:
- Animated exports force
--color-mode vertex. - Animated exports do not support
--part-color. - The animated viewer GLB and the static download assets are generated through different branches of the pipeline.
The Codex skill for this workflow lives at skills/vtk-to-ar/SKILL.md.
Use it when you want an agent to help convert and publish a model set. The intended flow is:
- Give the agent the
.vtpor.vtuinputs. - Have the agent determine whether this should be a static model or an animated time-series model.
- Have the agent ask what Blender modifications you want: scale, centering, rotation, decimation, colors, smoothing, and any part visibility changes.
- For animated models, have the agent also confirm the point-data quantity to visualize, frame sampling, and representative-frame strategy.
- Let the agent run
./bin/vtk-to-ar ...and show you the result. - Iterate on those Blender parameters until the model looks right.
- Publish the generated
docs/updates in a pull request.
The skill is designed around iteration, so the agent should keep asking for adjustment requests until you approve the output.
- Generated assets land under
docs/assets/models/<slug>/ - Model pages land under
docs/models/<slug>/ - The site index is
docs/index.html - The manifest is
docs/assets/models/manifest.json
For animated models:
docs/assets/models/<slug>/<slug>.glbis the animated viewer asset.docs/assets/models/<slug>/<slug>-static.glbis the representative-frame static download.docs/assets/models/<slug>/<slug>.usdzis the iOS asset built from the representative frame.
- Static models and animated-derived static assets do not follow exactly the same geometry path.
- Animated exports decimate and select a representative surface in ParaView before Blender export.
- Animated viewer colors are postprocessed into the GLB after Blender export.
- iOS
.usdzoutput for animated models uses a baked-texture path, so Quick Look issues should be debugged separately from the web GLB.