1

是否有在y-axis创建网格后仅沿(左)缩放网格的功能?

我尝试了该open3d.geometry.Geometry3D.scale功能,但它沿3-axis(右)缩放。

import open3d as o3d
cylinder = o3d.geometry.create_mesh_cylinder(radius=1, height=3)
cylinder_scaled.scale(2) # I got the cylinder on the left.

open3d 缩放

提前致谢!

4

1 回答 1

3

首先将网格顶点转换为 numpy 数组。缩放后转换回来。

cylinder.vertices = o3d.utility.Vector3dVector(
    np.asarray(cylinder.vertices) * np.array([1., 1., 2.]) )
于 2021-03-13T02:51:43.143 回答