# Annular cylinder with varying dimensions

Consider a figure looking like the annular cylinder, with the longitudinal size extended from $$z = 1$$ to $$z = 10$$, but with the transverse boundaries depending on the distance from the origin $$z$$: the inner radius is $$R_{\text{inn}}(z) = z\cdot \tan(\theta_{1})$$, while the outer one is $$R_{\text{out}} = z \cdot \tan(\theta_{2})$$, with $$\theta_{1}=0.0134$$ rad and $$\theta_{2} = 0.269$$ rad. Please find attached the figure:

Could you please tell me how to specify this figure in Mathematica? It has only the standard Annulus figure, which is a 2D transverse projection only.

• What is "longitudinal size" ? Jan 23, 2023 at 13:18
• @UlrichNeumann : the length along the z axis. Jan 23, 2023 at 13:24
• Try ParametricPlot3d Jan 23, 2023 at 13:24

## 3 Answers

Here's a couple CSG approaches:

zθConicalFrustum[z1_, z2_, θ_] :=
ConvexHullMesh[Join @@ (Map[Append[#], CirclePoints[# Tan[θ], 100]] & /@ {z1, z2})]

fuot = zθConicalFrustum[1, 10, 0.269];
fin = zθConicalFrustum[1, 10, 0.0134];

BoundaryMeshRegion[RegionDifference[fuot, fin],
PlotTheme -> "Minimal", BaseStyle -> Opacity[0.6]]


zθCone[z_, θ_] := BoundaryDiscretizeRegion[Cone[{{0, 0, z}, {0, 0, 0}}, z Tan[θ]]]

reg = RegionDifference[
RegionDifference[zθCone[10, 0.269], zθCone[10, 0.0134]],
zθCone[1, 0.269]
];

BoundaryMeshRegion[reg, PlotTheme -> "Minimal", BaseStyle -> Opacity[0.6]]


## Method-1

• At first we draw the sectional graphics;
θ1 = .0134;
θ2 = .269;
Plot[{z*Tan[θ1], z*Tan[θ2]}, {z, 1, 10},
Filling -> {1 -> {2}}, AxesOrigin -> {0, 0},
AspectRatio -> Automatic]


• Then we revolution the four boundary lines of the sectional graphics.
SetOptions[RevolutionPlot3D, RevolutionAxis -> "X", Mesh -> None,
Boxed -> False, Axes -> False];
Show[RevolutionPlot3D[{{z, z*Tan[θ1]}, {z,
z*Tan[θ2]}}, {z, 1, 10},
PlotStyle -> {Directive[Opacity[.2], Blue],
Directive[Opacity[.2], Blue]}],
RevolutionPlot3D[{{1, r}}, {r, z*Tan[θ1] /. z -> 1,
z*Tan[θ2] /. z -> 1}, PlotStyle -> Cyan],
RevolutionPlot3D[{{10, r}}, {r, z*Tan[θ1] /. z -> 10,
z*Tan[θ2] /. z -> 10}, PlotStyle -> Red], PlotRange -> All,
BoxRatios -> Automatic]


## Method-2

• To calculate its volume we use ParametricRegion.
reg = ParametricRegion[{z, r*Cos[t],
r*Sin[t]}, {{z, 1, 10}, {r, z*Tan[θ1],
z*Tan[θ2]}, {t, 0, 2 π}}];
reg // Volume
(* RegionPlot3D[reg, PlotStyle -> Opacity[.2], PlotPoints -> 80] *)


79.3201

## Method-3

Since CSGRegion seems not work for this cases, we try to use OpenCascadeLink.

Needs["OpenCascadeLink"];
θ1 = .0134;
θ2 = .269;
shape1 =
OpenCascadeShape[Cone[{{10, 0, 0}, {0, 0, 0}}, 10*Tan[θ2]]];
shape2 =
OpenCascadeShape[Cone[{{10, 0, 0}, {0, 0, 0}}, 10*Tan[θ1]]];
shape3 = OpenCascadeShape[Cuboid[{0, -1, -1}, {1, 1, 1}]];
shape = OpenCascadeShapeDifference[
OpenCascadeShapeDifference[shape1, shape2], shape3];
bmesh = OpenCascadeShapeSurfaceMeshToBoundaryMesh[shape,
"ShapeSurfaceMeshOptions" -> {"AngularDeflection" -> 0.1}];
bm = BoundaryMeshRegion[bmesh];
bm // Volume
RegionPlot3D[bm, PlotStyle -> Opacity[.2], Boxed -> False,
ColorFunction -> Hue]


79.1933

Needs["OpenCascadeLink"];
Needs["NDSolveFEM"];
θ1 = .0134;
θ2 = .269;
pts = {{1, 1*Tan[θ1]}, {10, 10*Tan[θ1]}, {10,
10*Tan[θ2]}, {1, 1*Tan[θ2]}};
poly = Polygon[PadRight[#, 3] & /@ pts];
shape = OpenCascadeShape[poly];
axis = {{0, 0, 0}, {1, 0, 0}};
sweep = OpenCascadeShapeRotationalSweep[shape, axis, 2 π];
bmesh = OpenCascadeShapeSurfaceMeshToBoundaryMesh[sweep,
"ShapeSurfaceMeshOptions" -> {"AngularDeflection" -> 0.1}];
RegionPlot3D[BoundaryMeshRegion[bmesh], PlotStyle -> Opacity[.2],
Boxed -> False]


• (+1) you could also use the OpenCascadeRotationalSweep to do the speed in OC. Jan 24, 2023 at 14:12
• @user21 Thanks! updated. Jan 24, 2023 at 14:57

That seems a rather skinny cylinder:

p1 = Tan[0.0134] ;
p2 = Tan[0.269];
ParametricPlot3D[{p1 z Sin[phi], p2 z Cos[phi], z}, {z, 1, 10}, {phi, 0, 2 Pi}]


With a little more breath:

p1 = Tan[0.0134] 5;
ParametricPlot3D[{p1 z Sin[phi], p2 z Cos[phi], z}, {z, 1, 10}, {phi,
0, 2 Pi}]


Addendum

The same using regions:

p1 = Tan[0.0134] 5;
p2 = Tan[0.269];
ImplicitRegion[{x^2/(p1 z)^2 + y^2/(p2 z )^2 == 1 && 1 <= z <= 10}, {x, y, z}] // Region


• Thank you very much! Do you also know how to convert the plot into a region, for being able to use the commands such as RegionIntersection for this region? Jan 23, 2023 at 13:39
• I added another possibility using regions. Jan 23, 2023 at 14:05
• Excuse me, I just noticed that the figure differs from the desired one (in transverse dimensions). This is because of improper description in the question. I have modified the question. Jan 23, 2023 at 15:46
• Simply exchange z and x. Jan 23, 2023 at 15:56