-1

I have a ply file with x,y,z and R,G,B components. What is the best way to display it in python?

Dominik94
  • 9
  • 1
  • Possible duplicated of https://stackoverflow.com/questions/50965673/python-display-3d-point-cloud – aminrd Feb 21 '20 at 20:21
  • I tried open3d and it didn't satisfy my needs. I could display the pointcloud but I can't update and rotate it at the same time. – Dominik94 Feb 23 '20 at 12:01
  • Welcome to StackOverflow. As is, your question does not show your search and trial efforts. Please have a look at https://stackoverflow.com/help/how-to-ask to improve it. – Leonard Jul 20 '22 at 11:22

1 Answers1

0

To display and rotate .ply with python you can try this function

import numpy as np
import open3d as o3d


def open_3Dfile(input_file):
    # Read .ply file
    pcd = o3d.io.read_point_cloud(input_file)  # Read the point cloud

    # Visualize the point cloud within open3d
    o3d.visualization.draw_geometries([pcd])

    # Convert open3d format to numpy array
    # Here, you have the point cloud in numpy format.
    point_cloud_in_numpy = np.asarray(pcd.points)

input_file = 'example.ply'
open3Dfile(input_file)
Ahmed Amer
  • 61
  • 6