vedo
vedo copied to clipboard
legosurface misses voxels
I'm using Volume
and legosurface
hoping to get a lego-style visualization of a voxel grid with only 0 and 1 values (drawing the voxels with value 1). I'm attaching a pic when I show the lego surface, and a pic when I just show the volume itself.
Clearly, the lego surface version is missing a LOT of voxels, even though the transparent visualization seems to show them. The voxels that are missing seem to be around where there is a 1-voxel-thick wall. Any idea what happened here?
(for lego surface I used vmin=0.5 and vmax=1.5 since I only want to show voxels with value 1.)
Hi, thanks for reporting.. that is a bit strange can you share some code and/or dataset?
Yep. Here's a json and the code to visualize it.
import json
import vedo
with open('voxels.json') as fin:
voxels = json.load(fin)
volume = vedo.Volume(voxels)
lego = volume.legosurface(vmin=0.5, vmax=1.5)
vedo.show(lego)
It's not exactly the same voxel grid as the one I showed above (I don't have that one anymore), but the effect is still visible.
Should now work:
pip install -U git+https://github.com/marcomusy/vedo.git
lego = volume.legosurface(vmin=0.5, vmax=1.5, boundary=True)
Looks good, thanks! That was super quick. It seems like the colors are wrong though? The value is 1 so shouldn't it be orange?