Message Boards Message Boards

0
|
1450 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Changing the color of cover face for an annulus

Posted 1 year ago

I am trying to reproduce the following figure for a hollow cylinder:

enter image description here

I tried to use the annulus function however, I don't know to how get the lines on the outer surfaces or how to change the color on the top face. Any suggestions or help?

POSTED BY: K F
4 Replies

Here is an attempt:

With[{r = .6},
 Show[ParametricPlot3D[Table[{r Cos[c + t], r Sin[c + t], 2 t},
    {c, 0, 2 Pi, Pi/15}],
   {t, 0, Pi/4}, PlotStyle -> Directive[Black, Thin]],
  Graphics3D[{ResourceFunction["Annulus3D"][{{0, 0, 0},
      {0, 0, Pi/2}}, .6], 
    Table[Line[{{r/2 Cos[Pi/4 + c], r/2 Sin[Pi/4 + c], 
        Pi/2}, {r*Cos[Pi/4 + c], r*Sin[Pi/4 + c], Pi/2}}],
     {c, 0, 2 Pi, Pi/15}]}],
  BoxRatios -> {1, 1, 1}]]
POSTED BY: Gianluca Gorni
Posted 1 year ago

Thank you very much!

POSTED BY: K F
Posted 1 year ago

How would I add a radial gradient at the top of the cylinder?

POSTED BY: K F

This may give you a start:

Graphics3D[{Texture[RadialGradientImage[{Blue, Yellow, Red}]], 
  Polygon[Table[{Cos[t], Sin[t], 1}, {t, 0, 2 Pi, Pi/20}], 
   VertexTextureCoordinates -> Table[{1, 1}/2 + 1/2 AngleVector[t],
     {t, 0, 2 Pi, Pi/20}]]},
 Lighting -> "Neutral"]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract