10
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ Copy and paste code from your post to mma - nothing shows up. $\endgroup$ Nov 18, 2012 at 5:41
  • $\begingroup$ Weird. It shows up for me. I re-pasted it just in case. Let me know if it works now. $\endgroup$
    – JohnD
    Nov 18, 2012 at 5:55
  • 1
    $\begingroup$ Something for you to start with: With[{t = Pi/2}, ParametricPlot3D[{Piecewise[{{Cos[u], t <= u}}, Cos[t] + u Sin[t]], Piecewise[{{Sin[t] - u Cos[t], t > u}}, Sin[u]], z}, {u, 0, 2 Pi}, {z, -1, 1}, Exclusions -> None]] $\endgroup$ Nov 18, 2012 at 6:00

1 Answer 1

16
$\begingroup$

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

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$
    – JohnD
    Nov 18, 2012 at 13:46
  • $\begingroup$ @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} . $\endgroup$ Nov 18, 2012 at 17:16
  • $\begingroup$ Ah yes. Yes thank you. $\endgroup$
    – JohnD
    Nov 18, 2012 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.