10

I'd like to make an animation showing how we wrap a rectangle to form a cylinder (by joining a pair of parallel sides).

Here's my first pass:

 Manipulate[
    ParametricPlot3D[
    t {Cos[theta], Sin[theta], rho} + (1 - t) {rho, -1, theta}, 
    {theta, -Pi, Pi}, {rho, 0, 2}, 
    PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1.5, 1.5}}, 
    PerformanceGoal -> "Quality", ViewPoint -> {-2.3, 0.77, -2}, 
    ViewVertical -> {-0.08, 1, -0.06}], 
 {t, 0, 1}]

I'd much prefer the simpler looking transformation (without the twists this animation shows) which we'd do by simply rotating the pair of parallel sides until they touch to form the cylinder.

JohnD
  • 3,301
  • 3
  • 22
  • 42

1 Answers1

16

Think of this as of a flexible strip of fixed length glued to the side of a cylinder with shrinking radius. If radius >> strip length, strip looks almost flat. Making radius smaller will curve the strip more and more until its ends meet.

Manipulate[
 ParametricPlot3D[{Sin[t]/a, Cos[t]/a, u}, {t, 0, a}, {u, 0, .5}, 
  Boxed -> False, Axes -> False, PerformanceGoal -> "Quality", 
  ImageSize -> {300, 300}, MeshStyle -> Opacity[.3], 
  PlotStyle ->  Directive[Opacity[0.7], Orange, Specularity[White, 50]], 
  ViewPoint -> {-2, 2, -2}, BoundaryStyle -> Directive[Black, Opacity[.3]]], 
{{a, .01, "wrap"}, 0.01, 2 Pi}]

enter image description here

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
  • Very nice. I tweaked yours to get more of the behavior that I am after (where both ends curl up towards one another): Manipulate[ParametricPlot3D[{Sin[t]/a, Cos[t]/a, u}, {t,-a, a}, {u, 0, .5}, Boxed -> False, Axes -> False, PerformanceGoal -> "Quality", ImageSize -> {300, 300}, MeshStyle -> Opacity[.3], PlotStyle -> Directive[Opacity[0.5], Blue, Specularity[White, 50]], BoundaryStyle -> Directive[Black, Opacity[.3]]], {{a, .01, "wrap"}, 0.01, Pi}] which is great except that this parametrization results in nonconstant height of the rectangle. – JohnD Nov 18 '12 at 13:46
  • @texasAUtiger Thanks. The height of the cylinder is constant as set by fixed range {u, 0, .5} . The "height increase" that you see is a perspective illusion that can be improved in your case, for example, with BoxRatios -> {Automatic, Automatic, 2} . – Vitaliy Kaurov Nov 18 '12 at 17:16
  • Ah yes. Yes thank you. – JohnD Nov 18 '12 at 19:24