I am trying to create 5 axis machine application and in order to define the 3D position plus the orientation of an end effector, the common method is to calculate it from XYZIJK where XYZ is position in space and IJK is the direction vector. PowerMill has this object and most all 5 axis programming systems have this available. How is it possible in Eyeshot 9.0 or later. Eyeshot = DevDept
Asked
Active
Viewed 241 times
1 Answers
0
Eyeshot deals best with transformation matrices or quaternions. I still can't wrap my head around quaternions, so here is the answer with transformation matrices. What this function does is take the point and vector your are talking about, and turns it into a full transformation frame.
An issue with this is that I only have symmetrical tools, so this gets your tool to the correct point and vector, but arbitrarily rotates about tool up. Please let me know if you figure that part out.
Transformation pointNormalTransformation(Point3D point, Vector3D normal)
{
Vector3D direction = normal;
direction.Normalize();
Vector3D rotAbout = Vector3D.Cross(Vector3D.AxisZ, direction);
rotAbout.Normalize();
double angleBetween = Vector3D.AngleBetween(Vector3D.AxisZ, direction);
Translation trans = new Translation(point.X, point.Y, point.Z);
Rotation rot = new Rotation(angleBetween, rotAbout, Point3D.Origin);
return trans * rot;
}
// These are what you already have
Entity toolCenterPoint = Mesh.CreateBox(1.0,1.0,1.0);
Point3D XYZ = new Point3D(x, y, z);
Vector3D IJK = new Vector3D(i, j, k);
// Need a transformation to move your entity
Transformation newPosition = pointNormalTransformation(XYZ, IJK);
// Need last transformation to move your entity back to origin.
Transformation lastPosition = new Transformation(1.0);
// Loop this with updated positions
//
lastPosition.Invert();
toolCenterPoint.TransformBy(lastPosition); // return end effector (TCP) back to origin
toolCenterPoint.TransformBy(newPosition); // move TCP from origin to location
lastPosition = newPosition;
// end loop

Daniel Lord
- 754
- 5
- 18
-
Daniel, Thank you for this idea, I am hoping that a feature already exists within Eyeshot like projecting a line onto the surface and at the same time showing the normal vector at each vertex? If nothing like that exists then I will have to build something like you suggest here so thank you!! – Phil Bugg Nov 02 '20 at 00:04
-
@PhilBugg If this was useful to you please upvote it, or mark it as the answer. – Daniel Lord Mar 02 '21 at 15:08