Created
May 14, 2022 10:33
-
-
Save YHaruoka/3bbeec4b4537292a271681c413697e12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import open3d as o3d | |
if __name__ == "__main__": | |
# Loading mesh data | |
print("Loading mesh data") | |
Mesh = o3d.io.read_triangle_mesh("bunny.ply") | |
# Calculation of normal vector | |
Mesh.compute_vertex_normals() | |
o3d.visualization.draw_geometries([Mesh],mesh_show_back_face=True) | |
# Mesh to Point Cloud by sample_points_uniformly | |
pcd1 = Mesh.sample_points_uniformly(number_of_points=10000) | |
o3d.visualization.draw_geometries([pcd1]) | |
# Mesh to Point Cloud by sample_points_poisson_disk | |
pcd2 = Mesh.sample_points_poisson_disk(number_of_points=10000, init_factor=5) | |
o3d.visualization.draw_geometries([pcd2]) | |
print(pcd1) | |
print(pcd2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment