Jump to content
Developer Wiki and Function Reference Links ×

"Mirror" script returns point error


Recommended Posts

Ahh, You are correct.

 

However, it is in the ScriptFunctionReference.html

 

 Mirror

VectorScript Declaration:

FUNCTION   Mirror
(         h    :HANDLE;
          dup    :BOOLEAN;
     VAR     p1X    :REAL;
     VAR     p1Y    :REAL;
     VAR     p2X    :REAL;
     VAR     p2Y    :REAL
) :HANDLE ;

Python:

def  vs.Mirror(h, dup, p1, p2):
   return HANDLE

Description:
Reflect an object across an axis.

For a 2D reflection, the axis is a line containing arbitrary point p and extending along vector v.

Parameters:

h    The object to reflect
dup    If false, transform the original object to the new position. If true, create a new object
p1    An arbitrary point on the mirror axis
p2    A second arbitrary point on the mirror axis

Result:

The reflected object (this will be the same as the input object if dup is false).
 

Link to comment

@Julian Carr That was the first think I checked also. As @WhoCanDo says, it is in the VW2019 downloadable reference.

 

But it appears the reference is wrong. The function does not take 4 reals for the x/y coordinate, rather it takes two Points.

 

The following works.

 

Procedure Test;
Var	H1:Handle;
	PT1,PT2:Point;
Begin
	PT1.x:=0;
	PT1.y:=4;
	PT2.x:=0;
	PT2.y:=0;
	H1:=Mirror(FSActLayer,True,PT1,PT2);
End;

Run(Test);

 

 

 

  • Like 1
Link to comment

Points and 2D Vectors are the same. 3D Points and 3D Vectors are the same.

 

My understanding is the have been given both names so as to not confuse people who are using them for different purposes. Someone who is trying to specify a point in space would think about using points. Someone who is trying to descriptor the motion of an object through space would use a vector. They both are just a combination of real values along the X/Y/Z axis.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...