i'm trying to add new line in my .ply files using PlyData:
from plyfile import PlyData, PlyElement
import numpy
with open(filepath, 'rb') as f:
plydata = PlyData.read(f)
vertex = numpy.array([([0, 1, 2], 255, 255, 255), ([0, 2, 3], 255, 0, 0)],
dtype=[('vertex_indices', 'i4', (3,)), ('red', 'u1'), ('green', 'u1'), ('blue', 'u1')])
new_vertex = PlyElement.describe(vertex, 'vertex')
with open('colored_points.ply', mode='wb') as f:
PlyData([plydata, new_vertex], text=True).write(f)
This method give me this error:
AttributeError: 'PlyData' object has no attribute 'name'
Thank you!