pysdic.PointCloud.frame_transform#
- PointCloud.frame_transform(input_frame=None, output_frame=None, *, propagate_properties=True)[source]#
Express the points, given in
input_frame, inoutput_frame(only for 3D point clouds).Note
Only the coordinates are transformed. Vector properties (normals, displacements, …) are copied as they are and are not rotated.
See also
Package py3dframe for
py3dframe.Frameandpy3dframe.FrameTransform.- Parameters:
input_frame (Optional[
py3dframe.Frame], optional) – The frame in which the coordinates are currently expressed. By default, the canonical frame.output_frame (Optional[
py3dframe.Frame], optional) – The frame in which the coordinates are expressed after the transformation. By default, the canonical frame.propagate_properties (bool, optional (default:
True)) – If False, the new point cloud has no properties.
- Returns:
The point cloud expressed in
output_frame.- Return type:
Examples
Express a point cloud given in the canonical frame in a local frame with origin \((1, 1, 1)\) and axes \(x = (0, 1, 0)\), \(y = (-1, 0, 0)\) and \(z = (0, 0, 1)\).
1import numpy 2import py3dframe 3from pysdic import PointCloud 4 5point_cloud = PointCloud(numpy.random.rand(100, 3)) 6 7output_frame = py3dframe.Frame(origin=[1, 1, 1], x_axis=[0, 1, 0], y_axis=[-1, 0, 0], z_axis=[0, 0, 1]) 8local_point_cloud = point_cloud.frame_transform(output_frame=output_frame)