How do I draw a box with holes?

RegionPlot3D[x^2 + y^2 > 1/16 && x^2 + z^2 > 1/16 && y^2 + z^2 > 1/16,
 {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
 Mesh -> None, Boxed -> False, Axes -> False, 
 PlotStyle -> Opacity[0.8],
 PlotPoints -> 50
 ]

or

BoundaryDiscretizeRegion[
 ImplicitRegion[
  x^2 + y^2 > 1/16 && x^2 + z^2 > 1/16 && y^2 + z^2 > 1/16,
  {{x, -1, 1}, {y, -1, 1}, {z, -1, 1}}
  ],
 MaxCellMeasure -> 0.001, BaseStyle -> Opacity[0.8]
 ]

enter image description here


RegionPlot3D[
 RegionDifference[Cuboid[], 
  RegionUnion[Cylinder[{{0, .5, .5}, {1, .5, .5}}, 1/8],
              Cylinder[{{.5, 0, .5}, {.5, 1, .5}}, 1/8], 
              Cylinder[{{.5, .5, 0}, {.5, .5, 1}}, 1/8]]],
 PlotPoints -> 200,
 PlotStyle -> Opacity[0.7],
 Boxed -> False
 ]

or... just a bit crisper:

RegionPlot3D[
 RegionDifference[Cuboid[], 
    RegionUnion[
    Cylinder[#, 1/8] & /@ 
    {{{0, .5, .5}, {1, .5, .5}}, 
     {{.5, 0, .5}, {.5, 1, .5}}, 
     {{.5, .5, 0}, {.5, .5, 1}}}]],
 PlotPoints -> 200,
 PlotStyle -> Opacity[0.7],
 Boxed -> False]

enter image description here

Tags:

Graphics