I want to subtract one Cuboid[]
form another Cuboid[]
. This is the code I use:
RegionPlot3D@ RegionDifference[Cuboid[{1, 1, 1}, {-1, -1, -1}],Cuboid[{0.5, 0.5, 0.5}, {-0.5, -0.5, -0.5}]]
but I get the error:
RegionDifference::reg: "Cuboid[{1,1,1},{-1,-1,-1}] is not a correctly specified region. "
On the other hand, the code:
RegionPlot3D@ RegionDifference[Cuboid[{1, 1, 1}],Cuboid[{0.5, 0.5, 0.5}]]
works:
Graphics3D
and Show
can visualize the two cube:
Show[Graphics3D[{Opacity[0.2],Cuboid[{0.5, 0.5, 0.5}, {-0.5, -0.5, -0.5}]}],
Graphics3D[{Opacity[0.2], Cuboid[{1, 1, 1}, {-1, -1, -1}]}]]
What am I doing wrong?