cpederkoff / stl-to-voxel

Turn STL files into voxels, images, and videos
MIT License
138 stars 75 forks source link

Voxel Size #36

Closed karban8 closed 2 years ago

karban8 commented 3 years ago

I have a pre-defined voxel size (dx, dy, dz) in meters for example (0.01, 0.01, 0.01)m. If possible, how can I change the resolution/other parameters so that the voxels created by the stl-to-voxel library are of similar size say (dx', dy', dz' ). They may not be exactly same but approximately same (so the round value of dx/dx' =1 , dy/dy' =1 and dz/dz' =1 ). We can talk in respect to the Bunny and Pyramid.

cpederkoff commented 3 years ago

Hi @karban8, Currently you can specify resolution which controls how many voxels the model is divided into in either the x or y dimension (whichever is larger). So given the size of the model you can work out what resolution should be set to. Would you find it useful if there was a feature to specify voxel size?

karban8 commented 3 years ago

Hi @cpederkoff, I have worked out a way that enables the user to have separate resolutions for x, y and z axis. Therefore the voxel size can be adjusted. Currently I am using it to output 1x1x1 unit dimension voxel size. Thank You

karban8 commented 3 years ago

Currently I have the code on my local would you like me to make a pull request to add the new feature?

cpederkoff commented 3 years ago

That would be great if you could make a pull request. Thanks!

karban8 commented 3 years ago

Hi @cpederkoff I have made a PR in this regard.

cpederkoff commented 2 years ago

Change is merged. Thanks for contributing!