I am trying to build this image in Mathematica using regions:
The components are here:
Graphics3D[
{
Red,
Cuboid[-{.5, .5, .5}, {.5, .5, .5}],
Blue, Sphere[{0, 0, 0}, .65],
Green,
{#, GeometricTransformation[#, RotationMatrix[Pi/2, {0, 1, 0}]],
GeometricTransformation[#, RotationMatrix[Pi/2, {1, 0, 0}]]} & [
Cylinder[{{0, 0, -.8}, {0, 0, .8}}, .3]]
}, Boxed -> False
]
I can generate the region using the following code:
RegionDifference[
RegionIntersection[
BoundaryDiscretizeGraphics[Cuboid[-{.5, .5, .5}, {.5, .5, .5}]],
BoundaryDiscretizeGraphics[Ball[{0, 0, 0}, .65],
MaxCellMeasure -> 0.0005]
],
RegionUnion[
BoundaryDiscretizeGraphics[Cylinder[{{0, 0, -.8}, {0, 0, .8}}, .3],
MaxCellMeasure -> 0.0005],
Region[TransformedRegion[
BoundaryDiscretizeGraphics[
Cylinder[{{0, 0, -.8}, {0, 0, .8}}, .3],
MaxCellMeasure -> 0.0005], RotationTransform[Pi/2, {0, 1, 0}]]],
TransformedRegion[
BoundaryDiscretizeGraphics[Cylinder[{{0, 0, -.8}, {0, 0, .8}}, .3],
MaxCellMeasure -> 0.0005], RotationTransform[Pi/2, {1, 0, 0}]]
]
]
But I have not figured out how to get the proper surfaces colored properly. Any idea?
Thank you,
Luc








