py3dframe.FrameTransform.output_frame#
- property FrameTransform.output_frame: Frame#
The output frame of the transformation.
Note
This attribute is settable.
The
output_frameattribute is a Frame object.Warning
dynamicattribute must be set to True to take into account the changes in the output frame.See also
input_framefor the input frame of the transformation.dynamicfor the dynamic attribute of the transformation.get_active_output_frame()to extract the active output frame of the transformation ifdynamicis set toTrue.
- Parameters:
output_frame (Optional[Frame]) – The output frame of the transformation. If None, the global canonical frame is used.
- Returns:
The output frame of the transformation.
- Return type:
Examples
Lets create a FrameTransform object with the global frame as input frame and a local frame as output frame.
from py3dframe import Frame, FrameTransform frame_E = Frame.canonical() # Input frame - Global frame frame_F = Frame.from_axes(origin=[1, 2, 3], x_axis=[1, 0, 0], y_axis=[0, 1, 0], z_axis=[0, 0, 1]) # Output frame - Local frame transform = FrameTransform(input_frame=frame_E, output_frame=frame_F, dynamic=True, convention=0)
To extract the output frame of the transformation, use the
output_frameproperty.output_frame = transform.output_frame print(output_frame) # Output: Frame(origin=[[1.] [2.] [3.]], x_axis=[[1.] [0.] [0.]], y_axis=[[0.] [1.] [0.]], z_axis=[[0.] [0.] [1.]])
The user can also change the output frame of the transformation.
new_output_frame = Frame.from_axes(origin=[[2.] [2.] [2.]], x_axis=[[0.] [1.] [0.]], y_axis=[[0.] [0.] [1.]], z_axis=[[1.] [0.] [0.]]) transform.output_frame = new_output_frame
Now the transformation allows to transform points from the input frame to the new output frame.