kornia/kornia-rs

[Feature]: Implement PLY header parsing to support pre-allocation and dynamic schemas

Open

#672 opened on Jan 27, 2026

View on GitHub
 (7 comments) (0 reactions) (1 assignee)Rust (188 forks)auto 404
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:

  1. Performance: Vectors (points, colors, normals) are initialized with zero capacity, causing frequent reallocations as they grow. We need to parse the element vertex <count> line to pre-allocate memory.
  2. 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.

Contributor guide