How PLYData and Elements work together
masterThe core abstraction in hapPLY is the happly::PLYData class, which represents a complete .ply file containing multiple elements (like vertex or face). Each element contains one or more properties (like x, y, z, or red, green, blue).
To work with data, you typically:
- Construct a
PLYDataobject (either empty or by reading a file). - Access or create elements using
getElement()oraddElement(). - Access or add properties to those elements using
getProperty()oraddProperty(). - Write the resulting object to a file using
write().
happly::PLYData plyIn("my_file.ply");
// Access an element and its property
auto prop = plyIn.getElement("elementA").getProperty<float>("prop1");