Click Play to watch the video:
Your browser does not support the video tag.
From the Compass , click the 3D Modeling
Apps
quadrant, and select Quality Rules Capture .
In the Know-how Libraries section, click Create
Know-how Library
.
The Know-how Library dialog box opens.
Enter a name in the Title box and click
OK .
In the Know-how Libraries section, click Create
Know-how Function
.
The Create Library Function dialog box opens.
Enter the function name and click OK .
The function appears under the library it is linked to below the Know-how
Libraries in the tree.
Double-click the function in the tree.
The EKL Function Editor appears.
Declare the function arguments.
Enter your script.
Declare the variables.
let l1,l2(Line)
let d1,d2(Direction)
let v1,v2(Vector)
let scalProd(Real)
let prdVect(Vector)
Build the lines from these points.
l1 = line(iPt1,iPt2)
l2 = line(iPt1,iPt3)
Compute the direction from the lines.
d1 = direction(l1)
d2 = direction(l2)
Turn the direction into mathematical vectors.
v1 = d1->Vector()
v2 = d2->Vector()
Create a cross product on the vectors.
prdVect = CrossProduct(v1,v2)
if prdVect == [ 0, 0, 0 ]
ToReturn = TRUE
else
ToReturn = FALSE
Note:
if the cross product result is the null vector, the points are aligned. The
ToReturn
variable is used to store the returned value of the
function.