NVIDIA only: Code relies on NVIDIA extensions Use left mouse button to grab and right mouse button to cut.
An OpenGL 4.6 demo that lets you interactively cut/dissect a 3D mesh in real time, built on a compute-shader voxelizer, an XPBD-based soft-body solver, and ImGui-driven controls. Originally a Visual Studio project; this directory is a CMake-based distribution of the same source so it can be built on Windows (MSVC) and Linux without hand-installing any libraries into solution-relative folders.
Some rendering paths use NVIDIA’s mesh-shader (GL_NV_mesh_shader) and
subgroup extensions, so a recent NVIDIA GPU with up-to-date drivers gives
the best (and most complete) result.
| Library | Windows (MSVC) | Linux |
|---|---|---|
| GLFW | via vcpkg | libglfw3-dev |
| GLEW | via vcpkg | libglew-dev |
| Assimp | via vcpkg | libassimp-dev |
| FreeImage | via vcpkg | libfreeimage-dev |
| GLM | via vcpkg | libglm-dev |
| Dear ImGui | fetched by CMake (FetchContent) at configure time | same |
VCPKG_ROOT environment variable to its location.From the repo root:
cmake --preset windows-msvc
cmake --build --preset windows-msvc
The first configure will take a few minutes while vcpkg builds GLFW, GLEW, Assimp, FreeImage, and GLM for you.
Run it:
cd bin
.\DissectDemo.exe
The build always places the executable at bin/ in the repo root
(regardless of platform, generator, or Debug/Release config), and copies
shaders/, assets/, and default DissectDemo.ini/imgui.ini config
there too (only if not already present, so a rebuild won’t overwrite
settings you’ve since changed in-app), with vcpkg copying the dependency
DLLs alongside them, so the folder is self-contained.
Install the dev packages, then configure and build:
sudo apt-get install libglfw3-dev libglew-dev libassimp-dev libfreeimage-dev libglm-dev libgl1-mesa-dev mesa-common-dev ninja-build
cmake --preset linux
cmake --build --preset linux
cd bin
./DissectDemo
If you’d rather not install system packages, use the linux-vcpkg preset
instead (same vcpkg setup as the Windows instructions above).
shaders/ and assets/ as subdirectories of the current
working directory, so run it from bin/ (see above) rather than invoking
it via a path from elsewhere.<repo>/bin/, on every
platform/generator/config, specifically so that paths relative to the
working directory stay predictable. This matters for the optional
“virtual dissection data” scenes in SdfGridBuilder.h (the vh high and
vh female datasets), which look for an external dataset at
../virtual dissection data/. Since the executable always runs from
<repo>/bin/, that path always resolves to <repo>/virtual dissection
data/ – a sibling of bin/, src/, shaders/, etc., regardless of
platform.CMakePresets.json defines windows-msvc, linux, and linux-vcpkg
configure/build presets. Run cmake --list-presets to see them.These two scenes aren’t required to run the default armadillo demo, and
the underlying imagery is too large to track in git (GitHub caps normal
commits at 100MB/file), so it’s distributed as assets on this repo’s
dissection-data-v1 release
instead. Fetch and place it automatically with:
.\scripts\fetch-dissection-data.ps1
This requires the GitHub CLI (gh), authenticated
via gh auth login – necessary while this repo is private, since a plain
download link won’t work without authentication. The script places the data
at <repo>/virtual dissection data/vh high/ and vh female/, matching
what SdfGridBuilder.h expects, and skips any files already present so
re-running it is safe.