jmarkus
Mechanical
- Jul 11, 2001
- 377
I'm trying to set my coordinate system (WCS) XY plane to match the plane defined by 3 points: point_coord(3),point_coord(3),point_coord(3).
My code is:
But as you can see, I'm confused...The Z in the matrix would be the point defining the normal to the plane, but I don't know how to get that...
How can I get this WCS oriented using 3 points?
Thanks,
Jeff
My code is:
Code:
Dim matrix1 As NXOpen.Matrix3x3 = Nothing
matrix1.Xx = point_coord(0).coordinates.X
matrix1.Xy = point_coord(0).coordinates.Y
matrix1.Xz = point_coord(0).coordinates.Z
matrix1.Yx = point_coord(1).coordinates.X
matrix1.Yy = point_coord(1).coordinates.Y
matrix1.Yz = point_coord(1).coordinates.Z
'How do I get the Z point?
matrix1.Zx = point_coord(2).coordinates.X
matrix1.Zy = point_coord(2).coordinates.Y
matrix1.Zz = point_coord(2).coordinates.Z
workPart.WCS.SetOriginAndMatrix(point_coord(4).coordinates, matrix1)
But as you can see, I'm confused...The Z in the matrix would be the point defining the normal to the plane, but I don't know how to get that...
How can I get this WCS oriented using 3 points?
Thanks,
Jeff