PointToPoint - Constrain the origins of two frames together

The PointToPoint constraints are designed to constrain the origin of one frame to the origin of another frame (maintaining zero distance between the frames).

The constraint equation is:

\[h(q) = (p_1 - p_2) [i]\]

where \(p_1\) and \(p_2\) are the origin points of the two frames being constrained, and \(i\) is the basis component of the error vector.

Note

Defining a PointToPoint constraint creates multiple one-dimensional constraints for each axis being used. For example, if a system is defined in 3D, the PointToPoint3D method creates 3 PointToPoint constraints, one for each axis.

Examples

scissor.py

class trep.constraints.PointToPoint3D(system, frame1, frame2, name=None)
Parameters:
  • frame1 (Frame) – First frame to constrain
  • frame2 (Frame) – Second frame to constrain

Create a new set of 3 constraints to force the origin of frame1 to the origin of frame2. The system must be defined in 3D, otherwise, for 2D systems, use PointToPoint2D.

class trep.constraints.PointToPoint2D(system, plane, frame1, frame2, name=None)
Parameters:
  • plane (string) – 2D plane of system, ie. ‘xy’, ‘xz’, or ‘yz’
  • frame1 (Frame) – First frame to constrain
  • frame2 (Frame) – Second frame to constrain

Create a new set of 2 constraints to force the origin of frame1 to the origin of frame2. The system must be defined in 2D, otherwise, for 3D systems, use PointToPoint3D.

class trep.constraints.PointToPoint1D(system, axis, frame1, frame2, name=None)
Parameters:
  • axis (string) – 1D axis of system, ie. ‘x’, ‘y’, or ‘z’
  • frame1 (Frame) – First frame to constrain
  • frame2 (Frame) – Second frame to constrain

Create a new constraint to force the origin of frame1 to the origin of frame2. The system must be defined in 1D, otherwise, for 2D or 3D systems, use PointToPoint2D or PointToPoint3D.

PointToPoint3D.get_actual_distance()
PointToPoint2D.get_actual_distance()
PointToPoint1D.get_actual_distance()

Calculate the current distance between the two coordinate frames. If the constraint is currently satisfied, this is equal to 0.