STL到pointcloud

问题描述 投票:0回答:1

我正在尝试使用open3d lib将stl文件转换为点。

mesh = o3d.io.read_triangle_mesh("./stl.stl")
pcd = o3d.geometry.PointCloud()
pcd.points = mesh.vertices
pcd.colors = mesh.vertex_colors
pcd.normals = mesh.vertex_normals

问题是需要加载mesh.surfaces而不是顶点,但是我看不到open3d.open3d.geometry.TriangleMesh.Surface对象。我需要对齐曲面而不是顶点。

Input

Output

python mesh point-clouds open3d
1个回答
0
投票

这可能有帮助:

open3d.geometry.sample_points_uniformly(input, number_of_points=100)

    Function to uniformly sample points from the mesh.

    Parameters
            input (open3d.geometry.TriangleMesh) – The input triangle mesh.
            number_of_points (int, optional, default=100) – Number of points that should be uniformly sampled.

    Returns
        open3d.geometry.PointCloud
© www.soinside.com 2019 - 2024. All rights reserved.