4
$\begingroup$

I would like to plot a segment of a circular annulus in three dimensions with constant thickness (like a thick washer, but through some limited ranges of angle). This shows the shape:

RegionPlot3D[
 (5 < Sqrt[x^2 + y^2] < 6 && 5 < z < 6 && 0 < ArcTan[x, y] < .5) ,
 {x, -10, 10}, {y, -10, 10}, {z, -10, 10},
 Mesh -> None,
 PlotPoints -> 100,
 PlotStyle -> Directive[Opacity[0.5], Red]]

Annular segment

However, this requires an extremely high number of PlotPoints (which will be undesirable in my full figure, containing many dozens of such shapes). Moreover I would like to retain the thin edge lines and impose Opacity[], colors, and so forth, as can be applied in all Graphics3D primitives such as Cylinder[].

I could work with Regions, such as this start:

Region[
 RegionDifference[Cylinder[{{0, 0, 0}, {0, 0, 1}}, 1],
  Cylinder[{{0, 0, 0}, {0, 0, 1}}, 1/2]]]

Difference of cylinders

but here too I won't get the thin edge lines and opportunity to adjust the overall opacity and color as I seek.

In two dimensions, there is a perfect graphics element:

Graphics[{Opacity[0.5], Orange, Annulus[{0, 0}, {1/2, 1}, {0, .3}]}]

Orange annulus segment

What I'm seeking would be called Annulus3D. In the absence of such a 3D primitive, how shall I plot what I seek?


Just to show the final result (using the linked code from @kglr, below):

Munsell-like color solid

$\endgroup$

1 Answer 1

6
$\begingroup$

You can use RegionProduct:

rp = RegionProduct[Annulus[{0, 0}, {1/2, 1}, {0, .3}], Line[{{0}, {1/10}}]];

Region[rp]

enter image description here

An alternative approach: Modify the trick in this answer to add a location parameter:

ClearAll[annulus3D]
annulus3D[ctr_, {θ1_, θ2_}, {r1_, r2_}, {z1_, z2_}] := 
   Translate[ 
     ChartElementData["CylindricalSector3D"][{{θ1, θ2}, {r1, r2}, {z1, z2}}, 1], 
     ctr]

Example:

Graphics3D[{EdgeForm[{Thick, Gray}], 
  Opacity[.5, Red], annulus3D[{1, 1, .5}, {Pi/3, 2 Pi/3}, {.5, 1}, {0, .6}], 
  Opacity[.5, Blue], annulus3D[{0, 0, 0}, {Pi/4, 3 Pi/2}, {.25, 1.5}, {.5, .75}]}, 
 Axes -> True, BoxRatios -> 1, AxesOrigin -> {0, 0, 0}]

enter image description here

$\endgroup$
3
  • $\begingroup$ Yes, I tried that, but cannot the the edge lines, color, and opacity I seek. How would I get this style Graphics3D[{Opacity[0.5],EdgeForm[Blue],Red,Cylinder[]}] on my region wedge? $\endgroup$ Commented Apr 21, 2020 at 0:23
  • 2
    $\begingroup$ does this answer work for you needs? $\endgroup$
    – kglr
    Commented Apr 21, 2020 at 0:33
  • 1
    $\begingroup$ Hah... yes! Thanks. I searched but hadn't found that. For your (continuing) good works: $\checkmark$. $\endgroup$ Commented Apr 21, 2020 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.