Function Repository Resource:

# Annulus3D

Represent a 3D annulus

Contributed by: Jaroslav Kysela
 ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},{rinner,router}] represents a 3D annulus around the line from {x1,y1,z1} to {x2,y2,z2} with inner radius rinner and outer radius router. ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},{rinner,router},{θ1,θ2}] represents a 3D annulus from angle θ1 to θ2. ResourceFunction["Annulus3D"][{x,y,z},{rinner,router}] represents a planar annulus at {x,y,z} normal to the z-axis with inner radius rinner and outer radius router. ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},{rinner,router}] represents a planar annulus with its normal given by {nx,ny,nz}. ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},{rinner,router},{θ1,θ2}] represents a planar annulus from angle θ1 to θ2.

## Details

ResourceFunction["Annulus3D"] can be used in Graphics3D.
Graphics rendering is affected by directives such as FaceForm, EdgeForm, Specularity, Opacity, and color.
ResourceFunction["Annulus3D"] allows 0<rinner<router.
ResourceFunction["Annulus3D"][] is equivalent to ResourceFunction["Annulus3D"][{{0,0,-1},{0,0,1}},{1/2,1}].
ResourceFunction["Annulus3D"][r] is equivalent to ResourceFunction["Annulus3D"][{{0,0,-1},{0,0,1}},{r/2,r}].
ResourceFunction["Annulus3D"][{rinner,router}] is equivalent to ResourceFunction["Annulus3D"][{{0,0,-1},{0,0,1}},{rinner,router}].
ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}}] is equivalent to ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},{1/2,1}].
ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},r] is equivalent to ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},{r/2,r}].
ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},{rinner,router}] is equivalent to ResourceFunction["Annulus3D"][{{x1,y1,z1},{x2,y2,z2}},{rinner,router},{0,2π}].
ResourceFunction["Annulus3D"][{x,y,z}] is equivalent to ResourceFunction["Annulus3D"][{x,y,z},{1/2,1}].
ResourceFunction["Annulus3D"][{x,y,z},r] is equivalent to ResourceFunction["Annulus3D"][{x,y,z},{r/2,r}].
ResourceFunction["Annulus3D"][{x,y,z},{rinner,router}] is equivalent to ResourceFunction["Annulus3D"][{x,y,z},{0,0,1},{rinner,router}].
ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz}] is equivalent to ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},{1/2,1}].
ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},r] is equivalent to ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},{r/2,r}].
ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},{rinner,router}] is equivalent to ResourceFunction["Annulus3D"][{x,y,z},{nx,ny,nz},{rinner,router},{0,2π}].

## Examples

### Basic Examples (5)

A unit radius and two units height 3D annulus:

 In[1]:=
 Out[1]=

Plane annulus embedded in 3D:

 In[2]:=
 Out[2]=

A 3D annulus from the origin to {1,-1,1} with inner radius 1/2:

 In[3]:=
 Out[3]=

Annulus sectors:

 In[4]:=
 Out[4]=

Differently styled annuli:

 In[5]:=
 Out[5]=

### Scope (16)

#### Center Specification (2)

Specify centers of 3D annuli:

 In[6]:=
 Out[6]=

Specify centers of planar annuli:

 In[7]:=
 Out[7]=

#### Direction Specification (3)

3D annuli with different directions:

 In[8]:=
 Out[8]=

Equivalent scene with plane annuli:

 In[9]:=
 Out[9]=

A plane annulus at the origin with normal vector {1,-1,1} and inner radius 1/2:

 In[10]:=
 Out[10]=

 In[11]:=
 Out[11]=

 In[12]:=
 Out[12]=

Specify position, direction, as well as inner and outer radii:

 In[13]:=
 Out[13]=

Short form for a 3D annulus centered at the origin with a radius 1:

 In[14]:=
 Out[14]=

#### Angle Specification (2)

Specify the initial and final angle for the annulus sector:

 In[15]:=
 Out[15]=

Equivalent scene for the plane annulus:

 In[16]:=
 Out[16]=

#### Styling (6)

Color directives specify the face color of each annulus:

 In[17]:=
 Out[17]=

Different properties can be specified for the front and back faces using FaceForm:

 In[18]:=
 Out[18]=

For 3D annuli the FaceForm corresponds to the outer and inner faces:

 In[19]:=
 Out[19]=

Opacity specifies the face opacity:

 In[20]:=
 Out[20]=

Decompose the annulus into its components and apply different styling to each:

 In[21]:=
 In[22]:=
 Out[22]=

For planar annuli, only one component is returned, for which different EdgeForm and FaceForm can be given:

 In[23]:=
 Out[23]=

### Applications (2)

A simple 3D bar chart:

 In[24]:=
 In[25]:=
 Out[25]=

A simple 3D pie chart:

 In[26]:=
 In[27]:=
 In[28]:=
 Out[28]=

### Properties and Relations (4)

Annulus3D is a 3D generalization of Annulus in 2D:

 In[29]:=
 Out[29]=

For very small inner radii, Annulus3D reduces to Cylinder:

 In[30]:=
 Out[30]=

PieChart3D can be used to create 3D annuli:

 In[31]:=
 Out[31]=

Get the graphical primitive from PieChart3D:

 In[32]:=
 In[33]:=
 Out[33]=

Despite being seemingly the same as the object returned by Annulus3D, the latter has no “seam”:

 In[34]:=
 Out[34]=

### Possible Issues (4)

When the two endpoints coincide, no 3D annulus is created:

 In[35]:=
 Out[35]=

 In[36]:=
 Out[36]=

Radii are assumed to be positive real numbers:

 In[37]:=
 Out[37]=

When the inner radius exceeds the outer one, a warning is issued:

 In[38]:=
 Out[38]=

When the normal vector in the specification of a planar annulus is zero, the default setting is used:

 In[39]:=
 Out[39]=

### Neat Examples (3)

Random annuli:

 In[40]:=
 Out[40]=

Interlaced annuli:

 In[41]:=
 Out[41]=

An annulus sector and its shadow:

 In[42]:=
 Out[42]=

Jaroslav Kysela

## Version History

• 1.0.0 – 03 January 2022