(path)
| 116 | return cam_infos |
| 117 | |
| 118 | def fetchPly(path): |
| 119 | plydata = PlyData.read(path) |
| 120 | vertices = plydata['vertex'] |
| 121 | positions = np.vstack([vertices['x'], vertices['y'], vertices['z']]).T |
| 122 | colors = np.vstack([vertices['red'], vertices['green'], vertices['blue']]).T / 255.0 |
| 123 | if 'nx' in vertices: |
| 124 | normals = np.vstack([vertices['nx'], vertices['ny'], vertices['nz']]).T |
| 125 | else: |
| 126 | normals = np.zeros_like(positions) |
| 127 | if 'time' in vertices: |
| 128 | timestamp = vertices['time'][:, None] |
| 129 | else: |
| 130 | timestamp = None |
| 131 | return BasicPointCloud(points=positions, colors=colors, normals=normals, time=timestamp) |
| 132 | |
| 133 | def storePly(path, xyz, rgb): |
| 134 | # Define the dtype for the structured array |
no test coverage detected