【问题标题】:Scaling along a single axis in open3d在open3d中沿单轴缩放
【发布时间】:2021-03-12 22:40:15
【问题描述】:

是否有一个函数可以在创建后仅沿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.

提前致谢!

【问题讨论】:

    标签: python scale open3d


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢,它有效!只需编辑您的解决方案,按圆柱替换网格!再次感谢。
    猜你喜欢
    • 2017-01-15
    • 2018-05-15
    • 2013-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-10
    • 1970-01-01
    相关资源
    最近更新 更多