# Create a revolved 3D image of a line

p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
Graphics[Line[p]]


These are the x,y coordinates I got to work with in order to make a line and then make the whole thing rotate to form a 3D image.

I've tried to use RevolutionPlot3D but I only get a cone. None of the points gets used.

How do i do to get an image like this and calculate the volume of the body?

//Update I was forbidden to use Interpolation ("Too advanced command for this"-Teacher) So I have to solve it without that command and am forced to make functions for every point in the line... yay...

• does intF = Interpolation[p, InterpolationOrder -> 1]; RevolutionPlot3D[intF[t], {t, p[[1, 1]], p[[-1, 1]]}, RevolutionAxis -> "X"] give what you need? – kglr May 10 at 11:11
• Yes! It does! =) Now I can get onto trying to figure out how to calculate the volyme of the thing. Thanks! – Johan Grankvist May 10 at 12:36

For a fixed point {x, r} ∈ Line[p], we can get a disk  y^2 + z^2 <= r^2,this is the intuitive that we use to construct the rotation solid.

p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
reg = ParametricRegion[{{x, y, z}, {x, r} ∈ Line[p] &&
y^2 + z^2 <= r^2}, {r, x, y, z}];
Volume[reg]
Region[reg]


977 π

p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
parametrics = (1 - t)*#1 + t*#2 & @@@ Partition[p, 2, 1];
RevolutionPlot3D[parametrics // Evaluate, {t, 0, 1},
RevolutionAxis -> "X", Mesh -> None]


p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
parametrics = (1 - t)*#1 + t*#2 & @@@ Partition[p, 2, 1];
regs = ParametricRegion[{#1, #2*r*Cos[θ], #2*r*
Sin[θ]}, {{r, 0, 1}, {t, 0, 1}, {θ, 0,
2 π}}] & @@@ parametrics;
regs // Volume
% // Total


{4 π, 124 π, 244 π, 169 π, 193 π, 243 π}

977 π

• Mathematica went into an endless loop for some reason when I tried to run the code – Johan Grankvist May 10 at 15:03
• That is a brilliant answer @JohanGrankvist Just a quick comment; I managed to fully execute the answer given here. My version is "12.0.0 for Linux x86 (64-bit) (April 7, 2019)". Can I suggest that you quit the kernel and try again? – DiSp0sablE_H3r0 May 10 at 15:12
• Sorry but I run the reg=ParametricRegion... fine but when it comes to Volume[reg] it freezes. – Johan Grankvist May 10 at 15:19
p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};

{xmin, xmax} = MinMax[p[[All, 1]]];


As kglr suggested

intF = Interpolation[p, InterpolationOrder -> 1];

Show[
RevolutionPlot3D[intF[x],
{x, xmin, xmax},
RevolutionAxis -> "X",
ViewPoint -> Front,
PlotPoints -> 50,
MaxRecursion -> 5],
Graphics3D[{Red, AbsolutePointSize[6],
Point[{#[[1]], 0, #[[2]]} & /@ p]}]]


sectionVol =
Entity["Surface", "ConicalFrustum"][EntityProperty["Surface", "Volume"]]


vol = Total[
sectionVol @@@ ({#[[1, 2]], #[[2, 2]], #[[2, 1]] - #[[1, 1]]} & /@
Partition[p, 2, 1])]

(* 977 π *)

vol // N

(* 3069.34 *)