6
$\begingroup$

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:

enter image description here

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.

$\endgroup$
3
  • $\begingroup$ What is "longitudinal size" ? $\endgroup$ Jan 23 at 13:18
  • $\begingroup$ @UlrichNeumann : the length along the z axis. $\endgroup$ Jan 23 at 13:24
  • $\begingroup$ Try ParametricPlot3d $\endgroup$ Jan 23 at 13:24

3 Answers 3

5
$\begingroup$

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]]

$\endgroup$
6
$\begingroup$

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]

enter image description here

  • 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]

enter image description here

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

enter image description here

Needs["OpenCascadeLink`"];
Needs["NDSolve`FEM`"];
θ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]

enter image description here

$\endgroup$
2
  • 2
    $\begingroup$ (+1) you could also use the OpenCascadeRotationalSweep to do the speed in OC. $\endgroup$
    – user21
    Jan 24 at 14:12
  • 1
    $\begingroup$ @user21 Thanks! updated. $\endgroup$
    – cvgmt
    Jan 24 at 14:57
2
$\begingroup$

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}]

enter image description here

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}]

enter image description here

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

enter image description here

$\endgroup$
4
  • $\begingroup$ 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? $\endgroup$ Jan 23 at 13:39
  • 1
    $\begingroup$ I added another possibility using regions. $\endgroup$ Jan 23 at 14:05
  • $\begingroup$ 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. $\endgroup$ Jan 23 at 15:46
  • $\begingroup$ Simply exchange z and x. $\endgroup$ Jan 23 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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