I'm the one responsible for the SWIG bindings and as Dave says, they're currently only in an experimental state so I can't guarantee that they work. Firstly, are you running the latest version from Git (and if not, which version are you running? You'll need a recent version). Then, the thing to check is that the build system is working to create the bindings. In the CMake output, you should see something like
Quote:
-- Build bindings: ON
near the end. Do you?
If you do then run '
make && make test'. The first test that gets run should be called
PythonSurfaceExtractorTest and hopefully it will pass. If it doesn't then let me know.
If it works, then look in
tests/TestSurfaceExtractor.py and have a look at how it works. I copy it here:
Code:
import PolyVoxCore
#Create a small volume
r = PolyVoxCore.Region(PolyVoxCore.Vector3DInt32(0,0,0), PolyVoxCore.Vector3DInt32(31,31,31))
vol = PolyVoxCore.SimpleVolumeDensity8(r)
#Set one single voxel to have a reasonably high density
vol.setVoxelAt(PolyVoxCore.Vector3DInt32(5, 5, 5), PolyVoxCore.Density8(200))
mesh = PolyVoxCore.SurfaceMeshPositionMaterialNormal()
extractor = PolyVoxCore.SurfaceExtractorSimpleVolumeDensity8(vol, r, mesh)
extractor.execute()
mesh now contains the vertices and edges you need to pass to OpenGL to render the volume.