3

我正在尝试使用 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 对象。我需要对齐曲面而不是顶点。

如何从三角形网格中获取点?

输入

输出

4

1 回答 1

2

这可能会有所帮助:

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
于 2020-04-20T11:27:05.413 回答