Show[Graphics3D[{Cuboid[]}],
ContourPlot3D[{x==1/3,y==1/4,z==1/5},{x,-0.2,1.2},{y,-0.2,1.2},{z,-0.2,1.2}]]
Three planes divide the unit cube into 8 small cubes, what's the easiest way to get these 8 little cuboids? I've tried the regional boolean operation
RegionIntersection[Cuboid[], ImplicitRegion[x < 1/3 && y < 1/4 && z < 1/5, {x, y, z}]]
gives
BooleanRegion[#1&&,{Cuboid[{0,0,0}],ImplicitRegion[x<1/3&&y<1/4&&z<1/5,{x,y,z}]}]
but I want
Cuboid[{0, 0, 0}, {1/3, 1/4, 1/5}]
The expected final output is
{Cuboid[{1/3,1/4,1/5},{1,1,1}], Cuboid[{1/3,1/4,0},{1,1,1/5}], Cuboid[{1/3,0,1/5},{1,1/4,1}], Cuboid[{1/3,0,0},{1,1/4,1/5}], Cuboid[{0,1/4,1/5},{1/3,1,1}], Cuboid[{0,1/4,0},{1/3,1,1/5}], Cuboid[{0,0,1/5},{1/3,1/4,1}], Cuboid[{0,0,0},{1/3,1/4,1/5}]}
Show[Graphics3D[{Cuboid[]}],
ContourPlot3D[{x==1/3,y==1/4,z==1/5,x==3/4,y==5/6,z==6/7},
{x,-0.2,1.2},{y,-0.2,1.2},{z,-0.2,1.2}]]
If can be extended to the case of six planes, it will be better.
RegionIntersection[]
is not sufficiently smart to figure out that the intersection ofCuboid[]
andHalfSpace[]
should be representable as aCuboid[]
as well, so you'll need to do it manually. $\endgroup$RegionIntersection[Cuboid[],HalfSpace[{0,1,0},1/3]]
The returned nor cuboid. $\endgroup$