繁体   English   中英

在open3d中沿单轴缩放

[英]Scaling along a single axis in open3d

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

我尝试了open3d.geometry.Geometry3D.scale function,但它沿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 缩放

提前致谢!

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM