Cube w/ volume V = a*a*a; N spheres (holes) w/ coord's X,Y,Z, radius R

Efor

New member
Joined
Mar 30, 2018
Messages
3
Lets say I have a cube which volume is V = a*a*a. Then, I have N spheres (holes) in the cube(which do not overlay each other) with coordinates X,Y,Z, and radius R. My task is to slice the cube(perpendicularly to Y) into M slices and each slice must have same volume. Any ideas?
What I have found out yet:
I can find volume of one slice (volume of cube - volume of holes and divided by number of slices). Then I know that since the slice is perpendicular to Y, I only have to know Y of spheres. Any suggestions? Thank you.
 
Last edited by a moderator:
Let's say each slice should have volume V. Consider plane P normal to Y initially coincident with one of the faces of the cube. Start moving the plane through the cube. We stop if:
1. we accumulate the necessary volume V - that's our slice, make a cut, start on the next slice.
2. P starts or stops intersecting a hole - this is a start and/or end of a 'sub-slice'. If this is the first such event record Y, calculate current volume and continue. Else, calculate the volume of the completed sub-slice - should be doable, since we are keeping track of previous Y and can calculate volumes of portions of all holes in the current sub-slice. Add this volume to the current slice volume. If less than V, continue. If greater than V, figure out how much to backtrack to get V exactly.
 
Lets say I have a cube which volume is V = a*a*a. Then, I have N spheres (holes) in the cube(which do not overlay each other) with coordinates X,Y,Z, and radius R. My task is to slice the cube(perpendicularly to Y) into M slices and each slice must have same volume. Any ideas?
What I have found out yet:
I can find volume of one slice (volume of cube - volume of holes and divided by number of slices). Then I know that since the slice is perpendicular to Y, I only have to know Y of spheres. Any suggestions? Thank you.

The main thing you'll need is a formula for the volume of a segment of a sphere, in terms of the y-coordinates of the center of the sphere, and of the two planes by which it is cut. You can work that out from equation (6) here.

The sort of algorithm lev888 suggested seems appropriate; whether you will be able to solve algebraically to find where to "backtrack" will depend on the nature of the formula (especially when you are passing through several holes at once). It may well require numerical solutions, or just moving incrementally.
 
Top