Skip to content

Instantly share code, notes, and snippets.

@yongjun823
Last active January 6, 2020 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yongjun823/638e68cc6efacee1fd8f49190cfc8d19 to your computer and use it in GitHub Desktop.
Save yongjun823/638e68cc6efacee1fd8f49190cfc8d19 to your computer and use it in GitHub Desktop.
.3dp file viewer + open3d
import numpy as np
import open3d as o3d
if __name__ == "__main__":
object_txt = np.loadtxt('myfile.3dp')
points = object_txt[:, 2:5]
colors = object_txt[:, 5:] / 255
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
pcd.colors = o3d.utility.Vector3dVector(colors)
o3d.visualization.draw_geometries([pcd])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment