taichi-dev / voxel-challenge

226 stars 36 forks source link

is it possible to output the 3d file? #12

Open leeduckgo opened 2 years ago

leeduckgo commented 2 years ago

such as .vox, .glb... Is there a plan for this?

yuanming-hu commented 2 years ago

We don't have a built-in dumper yet, but you can create one by accessing the voxel materials/colors in https://github.com/taichi-dev/voxel-challenge/blob/881c5d91e3f4e1313e139079643771ae3078b781/renderer.py#L24-L25

If you wish to covert the fields into numpy format, simply use .to_numpy :-) https://docs.taichi.graphics/lang/articles/external

leeduckgo commented 2 years ago

Oh! That sounds great!

leeduckgo commented 2 years ago

tried it yet but not success.

I used this repo for Voxel Output:

https://github.com/gromgull/py-vox-io

the example code is like this:

a = np.linalg.norm(np.mgrid[-5:5:10j, -5:5:10j, -5:5:10j], axis=0) < 4

vox = Vox.from_dense(a)

VoxWriter('test.vox', vox).write()

How could I got a from self.voxel_color & self.voxel_material?

Thx a lot for help!