pop
函数从Matrix3dVector
对象中删除并返回指定索引处的Matrix3d
对象。
def pop(self, index: int) -> open3d.geometry.Matrix3d:
index
:要删除和返回的Matrix3d
对象在Matrix3dVector
对象中的索引。Matrix3d
类型的对象,即从Matrix3dVector
对象中删除的并且在index
处的Matrix3d
对象。import open3d
# 创建3个矩阵,加入Matrix3dVector对象
matrix1 = open3d.geometry.Matrix3d()
matrix2 = open3d.geometry.Matrix3d()
matrix3 = open3d.geometry.Matrix3d()
matrices = open3d.utility.Matrix3dVector([matrix1, matrix2, matrix3])
# 删除并返回第一个矩阵
result = matrices.pop(0)
print(result) # 打印被删除的矩阵
print(matrices) # 打印剩余的矩阵
IndexError
:如果索引值大于Matrix3dVector
对象的长度,则抛出索引越界异常。