Created
January 13, 2022 08:56
-
-
Save musimab/8a00810b14b0ad132ea32a8187b1799a 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
def create_point_cloud_file2(vertices, filename): | |
ply_header = '''ply | |
format ascii 1.0 | |
element vertex %(vert_num)d | |
property float x | |
property float y | |
property float z | |
property uchar red | |
property uchar green | |
property uchar blue | |
end_header | |
''' | |
with open(filename, 'w') as f: | |
f.write(ply_header %dict(vert_num=len(vertices))) | |
np.savetxt(f,vertices,'%f %f %f %d %d %d') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment