Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
leeduckgo opened this issue Apr 30, 2022 · 3 comments
Open

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

leeduckgo opened this issue Apr 30, 2022 · 3 comments

Comments

@leeduckgo
Copy link

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

@yuanming-hu
Copy link
Member

We don't have a built-in dumper yet, but you can create one by accessing the voxel materials/colors in

self.voxel_color = ti.Vector.field(3, dtype=ti.u8)
self.voxel_material = ti.field(dtype=ti.i8)

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

@leeduckgo
Copy link
Author

Oh! That sounds great!

@leeduckgo leeduckgo reopened this May 2, 2022
@leeduckgo
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants