Skip to content

Instantly share code, notes, and snippets.

@sergeyprokudin
Created March 6, 2023 10:14
Show Gist options
  • Save sergeyprokudin/089292bbf6c1673b32cdb44c80fae556 to your computer and use it in GitHub Desktop.
Save sergeyprokudin/089292bbf6c1673b32cdb44c80fae556 to your computer and use it in GitHub Desktop.
import open3d as o3d
import numpy as np
def poisson_open3d(ply_path, depth=8):
pcd = o3d.io.read_point_cloud(ply_path)
mesh, densities = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(pcd, depth=8)
vertices_to_remove = densities < np.quantile(densities, 0.02)
mesh.remove_vertices_by_mask(vertices_to_remove)
v, f = np.asarray(mesh.vertices), np.asarray(mesh.triangles)
return v, f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment