首页 > 解决方案 > 如何在open3D中更新圆柱高度

问题描述

我想改变 open3D 中圆柱体的高度。可能吗?如果是,我该如何进行?我正在使用open3d-python==0.7.0.0.

import open3d as o3d
cylinder = o3d.geometry.create_mesh_cylinder()
# ...
# doing something and then update here:

谢谢!

标签: pythonopen3d

解决方案


没有直接的解决方案,想法是使用缩放。然而,提供的缩放功能open3d.geometry.Geometry3D.scale,沿 3 轴缩放对象。幸运的是,我们可以按照这里的建议更新顶点:

cylinder.vertices = o3d.utility.Vector3dVector(
np.asarray(mesh.vertices) * np.array([1., 1., 2.]) )

推荐阅读