3

i am trying to convert stl file into points using open3d lib.

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

The problem is that in need to load mesh.surfaces instead vertices but i cant see open3d.open3d.geometry.TriangleMesh.Surface object. I need to align surfaces instead of vertices.

How do I obtain points from triangular mesh?

Input

Output

Svatos
  • 33
  • 1
  • 5

1 Answers1

2

This might help:

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
lenik
  • 23,228
  • 4
  • 34
  • 43