Skip to content

PLYLoader: Respect source types by default and double precision optional support #31710

@Danilkat

Description

@Danilkat

Description

Right now, PLYLoader can only output the geometry, and all the buffers are getting casted to Float32BufferAttribute, which results in (1) loss of precision for double and float64 properties and (2) overuse of precision for properties smaller than float32.

But the data from PLY might be used for something other than just rendering.

Solution

Expose the parseBinary and parseASCII functions without postProcess call, which would return the buffer object created from createBuffer. Map properties to typed arrays instead of regular ones (the part of that is done by setPropertyBinaryReaders for binary but not for ASCII).

Alternatives

Or make another ply loader, which will return those buffers instead of geometry (PLYRawLoader, perhaps?)

Additional context

Related to #23006.
This will allow the users to use make their own postprocesses (for example, normalizing the position buffer to the unit cube and extracting the transformation matrix to atleast preserve the local distances).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions