Message Boards Message Boards

Create a solid volume of revolution using RevolutionPlot3D?

GROUPS:

I need to create a solid volume of revolution for f(x) = 2 + square root of x. It is bounded by x = 0, and y = 4. The shaded area between the y axis, y = 4, and the curve needs to be revolved around the y-axis. I don't know how to use the program to do it. If someone could save me the time and create it for me as an SVG or STL file so I can 3d print it as a demonstration for class, it would be much appreciated. Thank you.

POSTED BY: Grant Pierce
Answer
1 month ago

A way:

f[x_] := 2 + Sqrt[x];
P = RevolutionPlot3D[f[x], {x, 0, 4}, RevolutionAxis -> {0, 0, 1}, MaxRecursion -> 5, PlotPoints -> 100]
Export["test.stl", P]

enter image description here

  R = RevolutionPlot3D[f[x], {x, 0, 4}, {\[Theta], 0, Pi}, RevolutionAxis -> {0, 0, 1}, MaxRecursion -> 5, PlotPoints -> 100, 
  PlotTheme -> "ThickSurface"]
  Export["test.stl", R]

enter image description here

 Q = RevolutionPlot3D[{{f[x]}, {4}}, {x, 0, 4}, RevolutionAxis -> {0, 0, 1}, MaxRecursion -> 5, PlotPoints -> 100]
 Export["test.stl", Q]

enter image description here

Attachments:
POSTED BY: Mariusz Iwaniuk
Answer
1 month ago

It can be tricky using RevolutionPlot3D to make 3D-printable models. The STL file created by Mariusz has backward-oriented faces on the bottom portion, for instance.

Q = RevolutionPlot3D[{{2 + Sqrt[x]}, {4}}, {x, 0, 4}, 
  RevolutionAxis -> {0, 0, 1}]

dQ = DiscretizeGraphics[Q];
HighlightMesh[dQ, Style[2, FaceForm[Yellow, Black]]]

The discretization also has two connected components.

ConnectedMeshComponents[dQ]

For this example, one might think a simple fix would be to use RevolutionPlot3D to plot just the bottom portion, and then discretize the result and use RepairMesh to seal the "hole" along the large circular top edge, essentially placing a disk over it. This is what a call to Printout3D would be expected to do, but we find additional problems:

bottom = RevolutionPlot3D[2 + Sqrt[x], {x, 0, 4}, 
RevolutionAxis -> {0, 0, 1}, PlotPoints -> 60]

We see that RevolutionPlot3D leaves a "seam" where the bottom surface intersects the plane formed by the x and z axes---where the revolution begins and ends.

Printout3D[bottom, "revTest.stl"]; Import["revTest.stl"]

It seems to me that RevolutionPlot3D should be modified to "sew up" that seam. It works fine for on-screen display, but it does not produce the region that it should when discretized.

There are several other approaches that generate the surface of revolution "manually" rather than with RevolutionPlot3D. The bottom portion of the surface of revolution is given by the equation (z - 2)^4 == x^2 + y^2. One obtains this by taking the original function z == 2+Sqrt[x] and replacing x with "distance from the z-axis", i.e., Sqrt[x^2 + y^2]. So a few means for producing the bottom portion are:

db1 = DiscretizeRegion[
  ImplicitRegion[((-2 + z)^4 == x^2 + y^2) && 2 <= z <= 4, {x, y, z}],
   MaxCellMeasure -> .005]

Or:

db2=DiscretizeGraphics[
 ContourPlot3D[(-2 + z)^4 == x^2 + y^2, {x, -4, 4}, {y, -4, 4}, {z, 2,
    4}, BoxRatios -> Automatic, PlotPoints -> 60]]

We then use RepairMesh to seal the hole, and find that both approaches work nicely:

HighlightMesh[RepairMesh[#, "HoleEdges"], 
   Style[2, FaceForm[Yellow, Black]]] & /@ {db1, db2}
POSTED BY: Updating Name
Answer
1 month ago

Another way .It's not a best method,but works. In my opinion, such things are done best in Blender 3D.

  Q1 = DiscretizeGraphics[
    RevolutionPlot3D[{2 + Sqrt[x]}, {x, 0, 4}, 
     RevolutionAxis -> {0, 0, 1}, MaxRecursion -> 4, PlotPoints -> 30]]

 Q2 = DiscretizeGraphics[
   RevolutionPlot3D[{4}, {x, 0, 4}, RevolutionAxis -> {0, 0, 1}, 
    PlotPoints -> 20, PlotTheme -> "ThickSurface"]]

 exp = RegionUnion[Q1, Q2]
 Export["test.stl", exp]

enter image description here

POSTED BY: Mariusz Iwaniuk
Answer
1 month ago

But that is still in two pieces:

ConnectedMeshComponents[exp]

Here's another approach: Use RegionPlot3D to make a solid version of the region, and then discretize and use RegionBoundary to leave just the boundary surface:

solid = RegionPlot3D[
  2 + (x^2 + y^2)^(1/4) <= z <= 4, {x, -4, 4}, {y, -4, 4}, {z, 2, 4}, 
  BoxRatios -> Automatic, PlotPoints -> 60]

surface=RegionBoundary[DiscretizeGraphics[test]]

This has all faces correctly oriented, and has no other defects.

HighlightMesh[surface, Style[2, FaceForm[Yellow, Black]]]
POSTED BY: Bruce Torrence
Answer
1 month ago

Group Abstract Group Abstract