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

How feasible is Mesh => []Voxel conversion? #2

Open
gmlewis opened this issue May 5, 2017 · 3 comments
Open

How feasible is Mesh => []Voxel conversion? #2

gmlewis opened this issue May 5, 2017 · 3 comments

Comments

@gmlewis
Copy link

gmlewis commented May 5, 2017

Have you considered providing a func (m *Mesh) ToVoxels(box Box, nx, ny, nz int) []Voxel
where nx, ny, and nz are the number of voxels in the X, Y, and Z directions (enclosed by the provided bounding box)?

That way, a mesh could be voxelized at any desired resolution by subdividing the conversion into smaller boxes and recombining them later.

@fogleman
Copy link
Owner

fogleman commented May 5, 2017

I think I have some code elsewhere in another codebase that does that already, I'll have to dig it up.

@fogleman
Copy link
Owner

fogleman commented May 7, 2017

Haven't had time yet, but the code is here:

https://github.com/fogleman/ln/blob/master/ln/mesh.go#L85-L107

@gmlewis
Copy link
Author

gmlewis commented May 7, 2017

Thank you, @fogleman!

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