Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Mapping Bezier curve to surface. Locator problem, still.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124568] Mapping Bezier curve to surface. Locator problem, still.
  • From: Chris Young <cy56 at comcast.net>
  • Date: Wed, 25 Jan 2012 07:02:50 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Here's a pretty concise way to map curves to surfaces. The tee-arrow
notation for pure functions makes the code a little clearer, I think. I
still can't figure out how to keep the mouse movement from being
captured by the locators. I.e., there's no way I can rotate the 3D
plot. Maybe not possible using Manipulate.

http://home.comcast.net/~cy56/Mma/BezCurveToSurfacePic.png
http://home.comcast.net/~cy56/Mma/BezCurveToSurface.nb

Manipulate[
 Grid [
  {
   {
    LocatorPane[
     Dynamic @ P,

     Show[
      ParametricPlot[\[HorizontalLine]Bez[P, t], {t, 0, 1}],
      Graphics @ {Dotted, Line[P]},
      PlotRange -> 2,
      Axes -> True
      ],
     {{-2, -2}, {2, 2}, {.25, .25}}
     ],
    Show[ParametricPlot3D[
      {u, v, u v},
      {u, -2, 2}, {v, -2, 2},
      PlotRange -> 2, Mesh -> False, PlotStyle -> Opacity[opac]
      ],
     ParametricPlot3D[
       (f \[Function] {f[[1]], f[[2]],
           f[[1]] * f[[2]]})@ \[HorizontalLine]Bez[P, t],
       {t, 0, 1},
       PlotRange -> 2
       ] /. Line[pts_, rest___] :> Tube[pts, 0.05, rest]
     ]
    }
   }
  ],
 {{P,
   {{-1, -1}, {-1, -.5}, {-1, 0}, {-1, .5}, {-1, 1},
    {  1, -1}, {   1, -.5}, {  1, 0}, {   1, .5}, {  1, 1}}}, Locator},
 {{opac, 0.75}, 0, 1}
 ]





  • Prev by Date: Re: compile a numerical integral
  • Next by Date: Re: compile a numerical integral
  • Previous by thread: Using same pure function for curve and surface mappings
  • Next by thread: Colored, indexed, resizable locators