Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8171

Re: Mapping a curve to a surface using Manipulate

From John Fultz <jfultz@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Mapping a curve to a surface using Manipulate
Date 2012-01-26 08:26 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jfr2of$ncb$1@smc.vnet.net> (permalink)

Show all headers | View raw


The Manipulate Locator control always creates a LocatorPane that covers the
entire Manipulate contents.  If you want different behavior, you'll have to
introduce your own LocatorPane to the Manipulate.  However, you don't want to 
run into problems we've discussed previously with controls being recreated 
inside of a Dynamic (in this case, the implicit Dynamic introduced by 
Manipulate) as you're using them.  So, a couple of strategically placed Dynamics 
to prevent this are necessary as well.  See if this works for you:

Manipulate[
 Grid[{{LocatorPane[Dynamic[P], 
     Dynamic@Show[
       ParametricPlot[\[HorizontalLine]Bez[P, t], {t, 0, 1}], 
       Graphics@{Dotted, Line[P]}, PlotRange -> 2, Axes -> True]], 
    Dynamic@Show[
      ParametricPlot3D[{u, v, u v}, {u, -2, 2}, {v, -2, 2}, 
       PlotRange -> 2, Mesh -> False], 
      ParametricPlot3D[{\[HorizontalLine]Bez[P, 
           t][[1]], \[HorizontalLine]Bez[P, 
           t][[2]], \[HorizontalLine]Bez[P, 
            t][[1]] \[HorizontalLine]Bez[P, t][[2]]}, {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}}}, None}, {{n, 10}, 0, 50, 1}]

Sincerely,

John Fultz
jfultz@wolfram.com
User Interface Group
Wolfram Research, Inc.


On Wed, 25 Jan 2012 06:58:40 -0500 (EST), Chris Young wrote:
> Everything working very nicely, except that I can't get the locators to
> stop intercepting my mouse clicks and drags when I try to rotate the 3D
> plots. Is there a way to confine the mouse movements to the proper
> graph? Do I have to use LocatorPane, which caused other plotting
> problems?
>
> http://home.comcast.net/~cy56/Mma/CurveToSaddle.nb
> http://home.comcast.net/~cy56/Mma/CurveToSaddlePic.png
>
>
> Manipulate[
> Grid [{{
> Show[
> ParametricPlot[\[HorizontalLine]Bez[P, t], {t, 0, 1}],
> Graphics @ {Dotted, Line[P]},
> PlotRange -> 2,
> Axes -> True
> ],
> Show[ParametricPlot3D[
> {u, v, u v},
> {u, -2, 2}, {v, -2, 2},
> PlotRange -> 2, Mesh -> False
> ],
> ParametricPlot3D[
> {\[HorizontalLine]Bez[P, t][[1]], \[HorizontalLine]Bez[P, t][[
> 2]], \[HorizontalLine]Bez[P, t][[
> 1]] \[HorizontalLine]Bez[P, t][[2]]},
> {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},
> {{n, 10}, 0, 50, 1}
> ]


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Mapping a curve to a surface using Manipulate John Fultz <jfultz@wolfram.com> - 2012-01-26 08:26 +0000

csiph-web