MCPcopy Index your code
hub / github.com/DNA-Rendering/DNA-Rendering / storePly

Function storePly

scripts/3DGS/dataset_readers.py:125–140  ·  view source on GitHub ↗
(path, xyz, rgb)

Source from the content-addressed store, hash-verified

123 return BasicPointCloud(points=positions, colors=colors, normals=normals)
124
125def 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
142def readColmapSceneInfo(path, images, eval, llffhold=8):
143 try:

Callers 3

readColmapSceneInfoFunction · 0.85
readNerfSyntheticInfoFunction · 0.85
readDNARenderingInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected