clear
是Open3D中的Matrix4dVector
类的成员函数,用于清空类中旋转矩阵。
def clear(self: open3d.utility.Matrix4dVector) -> None:
无。
无返回值。
import open3d
matrix_vec = open3d.utility.Matrix4dVector()
matrix_vec.append(open3d.geometry.get_rotation_matrix_from_axis_angle([0,0,1], 0.3))
matrix_vec.append(open3d.geometry.get_rotation_matrix_from_axis_angle([1,0,0], 1.2))
print(matrix_vec)
# 输出:
# [array([[ 0.95533649, -0.29552021, 0. , 0. ],
# [ 0.29552021, 0.95533649, 0. , 0. ],
# [ 0. , 0. , 1. , 0. ],
# [ 0. , 0. , 0. , 1. ]]),
# array([[ 1. , 0. , 0. , 0. ],
# [ 0. , 0.36235775, -0.93133583, 0. ],
# [ 0. , 0.93133583, 0.36235775, 0. ],
# [ 0. , 0. , 0. , 1. ]])]
matrix_vec.clear()
print(matrix_vec)
# 输出:
# []
无。
该函数不会从内存中释放已清空的内容。如果需要释放空间,可以使用del
关键字删除对象。
del matrix_vec
[1] Open3D Documentation. Utility.