cdbrauer / VoxelFuse

A toolkit for processing 3D components made with mixtures of materials and multiple manufacturing processes
GNU General Public License v3.0
35 stars 8 forks source link

reference/intuition spheres/ellipsoids #45

Closed hududed closed 2 years ago

hududed commented 3 years ago

not an issue but some questions. What's the rationale behind the +1 in diameter = (radius*2) + 1 in sphere generation? Is it just simplifying the for loop index? Also, how would one extend this to an ellipsoid?

cdbrauer commented 2 years ago

Thanks for your questions! The origin point for sphere generation corresponds to a single voxel at the center of the sphere. The +1 in the diameter calculation makes the diameter in voxels an odd number so that there will always be a center voxel for the sphere.

Ellipsoid generation is very similar, and I have added an example ellipsoid generation function to the primitives file (#46).