Friday, 29 November 2024

Building OpenVdb with numpy support

OpenVDB is a format for storing sparce 3d voxel volumetric data, and is probably very boring to anyone not significantly interested in 3d graphics. I want to see if I can generate these volumes procedurally to be able to create my own bespoke 'smoke-like' scenes... Sort of 3d procedural mark making... Anyway, it has to be built from source, which is really annoying and takes hours to compile... This is my notes on how to do it in case I loose my laptop. If anyone other than me is reading this far down, they probably deserve a small prize ;)

----

Download src from openvdb site

install numpy and libboost-numpy-dev using apt (plus pretty much any other dependency it complains about)

mkdir build
cd build

sudo cmake -D OPENVDB_BUILD_PYTHON_MODULE=ON -D USE_NUMPY=ON -D Python_ROOT_DIR=/usr/include/python3.12 ..


sudo make -j2

sudo make install

Install doesn't appear to work, may have to copy pyopenvdb.so into directory with your code(!)

Viewer is vdb_viewer from package openvdb-tools

Could see if python lib path is picked up automagically, but seemed to need to be specified (probably because of python3) - found path using python3 itself (can't remember command, but should be able to find it)

No comments:

Post a Comment