2

I'm trying to create an array of wedges of cylinders. So far I have been able to create an array of a full cylinder as shown in the next figure:

enter image description here

Using the next code:

Show[Graphics3D[Table[With[{p = {.1, .3, .9}}, {RGBColor[p], Opacity[.75], 
 Cylinder[{{8 i, 8 j, 8 k}, {8 i, 8 j, 8 k + 20}}, 2.5]}], {i, 6}, {j, 6}, {k, 1}], Boxed -> False],
Graphics3D[{Opacity[0.25], LightGray,Cuboid[{55, 55, 30}, {2, 2, 2}]}, Boxed -> False]]

I am also able to create the slice of cylinder using: How can I create a graphic of a wedge of a cylinder (like a slice of pie)?

My main problem is the transition from one wedge of a cylinder to such a graphical array.

Thanks in advance!

Alan

1 Answers1

5

We can create a a single cylinder wedge using the function sliceF from this answer

ClearAll[sliceF]
sliceF[opts : OptionsPattern[]][x_, y_, r_: {0, 2}, h_: 2] := 
 SectorChart3D[{{(y - x) Degree, r[[2]], h}, {(360 - y + x) Degree, 
    r[[2]], h}}, SectorOrigin -> {{x Degree}, r[[1]]}, opts]

and we can use Translate to get translated copies of it:

{innerradius, outerradius, height} = {0, 2.5, 20};
{startingangle, endingangle} = {10, 260};

wedge = sliceF[BoxRatios -> 1, ChartStyle -> { RGBColor[.1, .3, .9, .75], Opacity[0]}, Axes -> True][startingangle, endingangle, {innerradius, outerradius}, height]

enter image description here

translations = 8 Tuples[Range @ {6, 6, 1}];

Graphics3D[ {RGBColor[.1, .3, .9, .75], Translate[wedge[[1]], translations], Opacity[0.1], LightGray, Cuboid[{55, 55, 30}, {2, 2, 2}]}, Boxed -> False]

enter image description here

We can also use wedge as ChartElements with RectangleChart3D to get a similar picture:

Show[RectangleChart3D[ConstantArray[{8, 8, 20}, {6, 6}], 
  ChartLayout -> "Grid",
  ChartElements -> wedge, 
  Method -> "Canvas" -> False,  
  Axes -> False, FaceGrids -> None] ,
 Graphics3D[{Opacity[.2, LightGray], 
   Scale[Cuboid[], {60, 60, 30}, {.1, .1, .1}]}], 
 Boxed -> False, PlotRange -> All]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896