1

I'm having trouble displaying a hollow cylinder in Mathematica 9. A hollow cylinder looks like this:

hollow cylinder

I tried to use RevolutionPlot3D with a step function. It displays as what I want, but a collection of them in a Show[] is really buggy.

To prevent an X-Y problem, I'll say why I need this shape. I'm making a diagram to show how the integral of a volume of revolution can be approximated by a collection of hollow cylinders, like how the integral of a 1D function can be approximated by a collection of rectangles covering the undergraph.

I want my diagram to look something like this terrible drawing:

enter image description here

A Plot3D bounds the cylinders from above. The whole assembly is shown in a cross section, with one or two cylinders protruding out of the cross section to show what they are supposed to be.

If there is a better way to do this I'm open to that, but if there's some hidden CSG functions in Mathematica that would do the job I would be forever grateful to hear about them

Mahdi
  • 1,619
  • 10
  • 23
Blackle Mori
  • 113
  • 5

1 Answers1

4
myData = {{2, 1, #}, {1, 1, 0}} & /@ Table[1/(n + 2) + .2 RandomReal[], {n, 1, 15}];

SectorChart3D[myData, BoxRatios -> {1, 1, 1},
 ColorFunction -> Function[{x, y, z}, Hue[z]],
 ColorFunctionScaling -> False]

enter image description here

David G. Stork
  • 41,180
  • 3
  • 34
  • 96
  • @blacklemon67 Great... glad to help. If you play around with the ColorFunction, you can likely highlight just one ring (red, say), as in your hand sketch. – David G. Stork Apr 25 '15 at 11:14