2
$\begingroup$

I have a set of line segments

h = 4; w = 2; t = 1;
lineSegments = Line[{{0, 0}, {w, 0}, {w, h}, {w + t, h}, {w + t, -h - t}, {w, -h - t}, {w, -t}, {0, -t}}];
Graphics[lineSegments]

enter image description here

Now I want to rotate them around the axis x = 0 and create 3D mesh similar to what RevolutionPlot3D[] does to parametric functions. How can I achieve this?

$\endgroup$
  • $\begingroup$ The cleanest way would problaby be BooleanRegion: Subtracting two small Cylinders from a large Cylinder. $\endgroup$ – Henrik Schumacher May 20 '18 at 12:50
1
$\begingroup$

Something like the following might do in your particular case:

opts = {MaxCellMeasure -> 0.01};
RegionDifference[
 DiscretizeRegion[Cylinder[{{0, 0, 4}, {0, 0, -5}}, 3], 
  Sequence @@ opts],
 RegionUnion[
  DiscretizeRegion[Cylinder[{{0, 0, 5}, {0, 0, 0}}, 2], 
   Sequence @@ opts],
  DiscretizeRegion[Cylinder[{{0, 0, -1}, {0, 0, -6}}, 2], 
   Sequence @@ opts]
  ]
 ]

enter image description here

$\endgroup$

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.