kornia/kornia-rs
View on GitHub[Feature]: Implement PLY header parsing to support pre-allocation and dynamic schemas
Open
#672 opened on Jan 27, 2026
good first issuehelp wantedtriage
Repository metrics
- Stars
- (675 stars)
- PR merge metrics
- (PR metrics pending)
Description
Title: Implement PLY header parsing to support pre-allocation and dynamic schemas
Description
The read_ply_binary function currently reads the PLY header into a buffer but does not parse it. It relies on reading the file stream until EOF to determine the number of points.
This approach causes two main issues:
- Performance: Vectors (
points,colors,normals) are initialized with zero capacity, causing frequent reallocations as they grow. We need to parse theelement vertex <count>line to pre-allocate memory. - Correctness: The code assumes a fixed property layout. It should parse the header to validate the schema or adapt to different PLY property definitions.
The goal is to implement a proper parser for the header metadata to resolve the TODO and enable these optimizations.