vedo icon indicating copy to clipboard operation
vedo copied to clipboard

legosurface misses voxels

Open panangam opened this issue 2 years ago • 4 comments

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.

Screenshot from 2021-11-30 13-24-46

Screenshot from 2021-11-30 13-33-09

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.)

panangam avatar Dec 01 '21 01:12 panangam

Hi, thanks for reporting.. that is a bit strange can you share some code and/or dataset?

marcomusy avatar Dec 01 '21 18:12 marcomusy

Yep. Here's a json and the code to visualize it.

voxels.zip

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.

panangam avatar Dec 01 '21 18:12 panangam

Should now work: pip install -U git+https://github.com/marcomusy/vedo.git

lego = volume.legosurface(vmin=0.5, vmax=1.5, boundary=True)

Screenshot from 2021-12-01 20-26-54

marcomusy avatar Dec 01 '21 19:12 marcomusy

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?

Screenshot from 2021-12-01 11-37-32

panangam avatar Dec 01 '21 19:12 panangam