# 3D plotting of parametric curved surface

Imagine I want the 3D plot of a solid object that has height $$H$$ and a circular base of radius $$R$$. The radius of the horizontal cross-section of the object at height $$z$$ above the base reduces with $$z$$ ($$0 \leq z \leq H$$) according to the formula $$R_z = R e^{-z/H}$$. Additionally, the cross-section is a sector of the circle: the full circle ($$2\pi$$ radians) at the base but reducing linearly with height to $$\pi$$ radians at height $$z = H$$. The figure shows the horizontal cross-section of the object at the base, at the mid-height, and at the top. The following is a cross-sectional scheme of what I mean, at three heights:

I tried to plot it by parametrizing the radius and angle, which gives me a good approximation, for $$R=1$$ and $$H=2$$,

R = 1;
H = 2;
theta[z_] := 2  Pi - (Pi  z)/H
x[r_, t_, z_] := r  Cos[t]
y[r_, t_, z_] := r  Sin[t]
zCoord[z_] := z
sideFilled =
zCoord[z]}, {z, 0, H}, {t, 0, theta[z]},
PlotStyle -> Directive[Opacity[0.8], Blue], Mesh -> None];
bottomFilled =
theta[0]}, PlotStyle -> Directive[Opacity[0.8], Blue],
Mesh -> None];
topFilled =
theta[H]}, PlotStyle -> Directive[Opacity[0.8], Blue],
Mesh -> None];
topLine =
Graphics3D[{Thick, Blue,
H}}]}];

Show[sideFilled, bottomFilled, topFilled, topLine, PlotRange -> All,
AxesLabel -> {"x", "y", "z"}, Boxed -> True]


However, I cannot seem to fill the three surfaces: both bases and the side curved surface around the "cone". Any idea how to include these?

Edit

To get a smooth filling,we seperately draw the pieces of boundary surfaces.

Clear["Global*"];
R = 1;
H = 2;
theta[z_] := 2   Pi - (Pi   z)/H;
sideFilled =
H}, {t, 0, theta[z]}, PlotStyle -> Directive[Opacity[0.8], Blue],
Mesh -> None];
bottomFilled =
ParametricPlot3D[{1 - s,
z -> 0, {t, 0, theta[z] /. z -> 0}, {s, 0, 1}, Mesh -> None];
topFilled =
ParametricPlot3D[{1 - s,
z -> H, {t, 0, theta[z] /. z -> H}, {s, 0, 1}, Mesh -> None,
PlotStyle -> Cyan];
Filled1 =
ParametricPlot3D[{1 - s,
t -> theta[z], {z, 0, H}, {s, 0, 1}, Mesh -> None,
PlotStyle -> Red];
Filled2 =
ParametricPlot3D[{1 - s,
t -> 0, {z, 0, H}, {s, 0, 1}, Mesh -> None];
Show[sideFilled, topFilled, bottomFilled, Filled1, Filled2,
Boxed -> False, Axes -> False]


• If we set MeshFunctions -> {#4 &}, Mesh -> {{H/ 2}}, PlotPoints -> 60, MaxRecursion -> 2, MeshStyle -> Tube[.02], we can see that when z=H/2, the section is a 3/4 Disk.

Original

• Not so smoothing.
Clear["Global*"];
R = 1;
H = 2;
theta[z_] := 2   Pi - (Pi   z)/H;
reg = ParametricRegion[{1 - s,
H}, {t, 0, theta[z]}, {s, 0, 1}}];
BoundaryDiscretizeRegion[reg, MaxCellMeasure -> .01]


• This is great! Just a minor question. Would it be possible to include the possibility of having a full rotation by $z=H$. Theoretically, I would do theta[z_] := 2Pi - 2(Pi z)/H;, but I get an endpoint issue. To see what I mean, try theta[z_] := 2Pi - 1.999 (Pi z)/H; Commented May 9 at 16:12
• @samwolfe Do you mean Show[RevolutionPlot3D[{radius[z], z}, {z, 0, H}], RevolutionPlot3D[{r, 0}, {r, 0, radius[0]}, {θ, 0, 2 π}, Mesh -> None], RevolutionPlot3D[{r, H}, {r, 0, radius[H]}, {θ, 0, 2 π}, Mesh -> None, PlotStyle -> Cyan], Boxed -> False, Axes -> False] ? Commented May 9 at 21:45
• No, I mean allowing the circle to vanish with height. Try replacing my second version of theta in your code and you will see what I mean. Basically making the angle from $0$ to $2\pi$. Commented May 10 at 11:17
• The circle would not vanish until $\theta \to \infty$ or $z \to \infty$ Commented May 12 at 13:47
H = 2; R = 1; thmax = Pi; r[t_] = R Exp[-t/Pi]; z[t_] = t H/Pi;
shell = ParametricPlot3D[{r[th] Cos[th + v], r[th] Sin[th + v],
z[th]}, {th, 0, thmax}, {v, 0, Pi}, PlotStyle -> Yellow];
filament =
ParametricPlot3D[{r[th] Cos[th], r[th] Sin[th], z[th]}, {th, 0,
thmax}, PlotLabel -> Space_ Curve_on _CCS _SOLID,
PlotStyle -> {Red, Thick}];
Show[{filament, shell}, PlotRange -> All, Boxed -> False,
PlotLabel -> ConstCompressiveStressSOLID]


Not too different. Since

$$\frac{dz}{d\theta}= \frac{z}{\theta}=\frac{H}{\pi}$$

(for initial condition at base) and $$z$$ linearity we can also parameterize with

$$r(\theta)= R e^{-z/H} ~= R e^{-\theta/\pi}$$ for a half of the shell. The portions of planes $$\theta=0, z=0$$ can be included.

As to the query by @sam wolfe for full rotation $$2\pi$$ of same height $$H=2$$, set $$H=R=1, \text{thmax} =2 \pi$$ to get a more twisted shell: