(path, xyz, rgb)
| 123 | return BasicPointCloud(points=positions, colors=colors, normals=normals) |
| 124 | |
| 125 | def storePly(path, xyz, rgb): |
| 126 | # Define the dtype for the structured array |
| 127 | dtype = [('x', 'f4'), ('y', 'f4'), ('z', 'f4'), |
| 128 | ('nx', 'f4'), ('ny', 'f4'), ('nz', 'f4'), |
| 129 | ('red', 'u1'), ('green', 'u1'), ('blue', 'u1')] |
| 130 | |
| 131 | normals = np.zeros_like(xyz) |
| 132 | |
| 133 | elements = np.empty(xyz.shape[0], dtype=dtype) |
| 134 | attributes = np.concatenate((xyz, normals, rgb), axis=1) |
| 135 | elements[:] = list(map(tuple, attributes)) |
| 136 | |
| 137 | # Create the PlyData object and write to file |
| 138 | vertex_element = PlyElement.describe(elements, 'vertex') |
| 139 | ply_data = PlyData([vertex_element]) |
| 140 | ply_data.write(path) |
| 141 | |
| 142 | def readColmapSceneInfo(path, images, eval, llffhold=8): |
| 143 | try: |
no outgoing calls
no test coverage detected