Skip to main content
added 580 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

Update: Speaking of "pie slices", you can use SectorChart3D directly as follows:

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]

sliceF[BoxRatios -> 1, Axes -> True][30, 70]

Mathematica graphics

sliceF[BoxRatios -> 1, Axes -> True][30, 70, {1, 2}]

Mathematica graphics

sliceF[BoxRatios -> 1, Axes -> True,  ChartElementFunction -> 
  ChartElementDataFunction["ProfileSector3D", "Profile" -> 5]][30, 70, {3/2, 2}]

Mathematica graphics

Original post:

ClearAll[csF]
csF[opts : OptionsPattern[]][angle_: {0, Pi/2}, radii_: {0, 1}, 
  minmaxheight_: {0, 1}, style_: {EdgeForm[], Opacity[1], Orange}] := 
 Graphics3D[{## & @@ style, 
   ChartElementData["CylindricalSector3D"][{angle, radii, minmaxheight}, 0]}, opts]

csF[][{0, 3 Pi/4}]

Mathematica graphics

csF[Boxed -> False, ImageSize -> 400][{0, 3 Pi/4}, {.5, 1}]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, #}, {0, 1}, {0, 1}, 
  {EdgeForm[]}] & /@ (Pi {1/3,  3/2, 4/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, Pi/4}, {#, 1}, {0, 1},
   {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200, PlotRange -> {0, 1}][{0, 
      Pi/4}, {0, 1}, {#, 1}, {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

ClearAll[csF]
csF[opts : OptionsPattern[]][angle_: {0, Pi/2}, radii_: {0, 1}, 
  minmaxheight_: {0, 1}, style_: {EdgeForm[], Opacity[1], Orange}] := 
 Graphics3D[{## & @@ style, 
   ChartElementData["CylindricalSector3D"][{angle, radii, minmaxheight}, 0]}, opts]

csF[][{0, 3 Pi/4}]

Mathematica graphics

csF[Boxed -> False, ImageSize -> 400][{0, 3 Pi/4}, {.5, 1}]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, #}, {0, 1}, {0, 1}, 
  {EdgeForm[]}] & /@ (Pi {1/3,  3/2, 4/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, Pi/4}, {#, 1}, {0, 1},
   {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200, PlotRange -> {0, 1}][{0, 
      Pi/4}, {0, 1}, {#, 1}, {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

Update: Speaking of "pie slices", you can use SectorChart3D directly as follows:

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]

sliceF[BoxRatios -> 1, Axes -> True][30, 70]

Mathematica graphics

sliceF[BoxRatios -> 1, Axes -> True][30, 70, {1, 2}]

Mathematica graphics

sliceF[BoxRatios -> 1, Axes -> True,  ChartElementFunction -> 
  ChartElementDataFunction["ProfileSector3D", "Profile" -> 5]][30, 70, {3/2, 2}]

Mathematica graphics

Original post:

ClearAll[csF]
csF[opts : OptionsPattern[]][angle_: {0, Pi/2}, radii_: {0, 1}, 
  minmaxheight_: {0, 1}, style_: {EdgeForm[], Opacity[1], Orange}] := 
 Graphics3D[{## & @@ style, 
   ChartElementData["CylindricalSector3D"][{angle, radii, minmaxheight}, 0]}, opts]

csF[][{0, 3 Pi/4}]

Mathematica graphics

csF[Boxed -> False, ImageSize -> 400][{0, 3 Pi/4}, {.5, 1}]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, #}, {0, 1}, {0, 1}, 
  {EdgeForm[]}] & /@ (Pi {1/3,  3/2, 4/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, Pi/4}, {#, 1}, {0, 1},
   {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200, PlotRange -> {0, 1}][{0, 
      Pi/4}, {0, 1}, {#, 1}, {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

ClearAll[csF]
csF[opts : OptionsPattern[]][angle_: {0, Pi/2}, radii_: {0, 1}, 
  minmaxheight_: {0, 1}, style_: {EdgeForm[], Opacity[1], Orange}] := 
 Graphics3D[{## & @@ style, 
   ChartElementData["CylindricalSector3D"][{angle, radii, minmaxheight}, 0]}, opts]

csF[][{0, 3 Pi/4}]

Mathematica graphics

csF[Boxed -> False, ImageSize -> 400][{0, 3 Pi/4}, {.5, 1}]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, #}, {0, 1}, {0, 1}, 
  {EdgeForm[]}] & /@ (Pi {1/3,  3/2, 4/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200][{0, Pi/4}, {#, 1}, {0, 1},
   {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics

Panel@Row[csF[ Boxed -> False, ImageSize -> 200, PlotRange -> {0, 1}][{0, 
      Pi/4}, {0, 1}, {#, 1}, {EdgeForm[]}] & /@ ({0, 1/3, 2/3})]

Mathematica graphics