# Translate plane between two points

Rumburak shared this question 2 years ago

What is the syntax for translating a parallel plane with xOy between two points z-axis with the mouse?

For translations without limits I use Translate (xOyPlane, Vector ((0, 0, 0.12)))

and I can translate the parallel plane with xOy with mouse.

I don't want to use a point on the z axis ..... Hi,

with a GGBscript (on update A) :

If[z(A)<0.5, Execute[ {" xOyPlane': Translate(xOyPlane, Vector((0, 0, 0.5))) "} ] ]

If[z(A)>1.5, Execute[ {" xOyPlane': Translate(xOyPlane, Vector((0, 0, 1.5))) "} ] ]

with point A :

A = PointIn(xOyPlane')

... 2

Hi,

with a GGBscript (on update A) :

If[z(A)<0.5, Execute[ {" xOyPlane': Translate(xOyPlane, Vector((0, 0, 0.5))) "} ] ]

If[z(A)>1.5, Execute[ {" xOyPlane': Translate(xOyPlane, Vector((0, 0, 1.5))) "} ] ]

with point A :

A = PointIn(xOyPlane')

... 1

tried using the slider b so that vector (0,0,b) can take on values from -5 to 5 but it takes value only one time. need to translate plane from -5 to 5 dynamically. any help is much appreciated.

Thanks 1

Hi,

dynamically,

with slider Zmin and Zmax,

script On Update A :

If[z(A)<Zmin, Execute[ {" xOyPlane': Translate(xOyPlane, Vector((0, 0, "+Zmin+"))) "} ] ]

If[z(A)>Zmax, Execute[ {" xOyPlane': Translate(xOyPlane, Vector((0, 0, "+Zmax+"))) "} ] ]

Because, Vector must be a free object to move plane.

...  1

Merci beaucoup Patrick ! C'est une excellente idée / solution !