igd-geo / pasture

Rust library for point cloud processing
Apache License 2.0
72 stars 9 forks source link

Fixed reading of PNTS files with RTC_CENTER #11

Closed Mortano closed 3 years ago

Mortano commented 3 years ago

The 3D Tiles PNTS format defines the RTC_CENTER property that can be used to store points in a local coordinate system. This PR provides the option to have a PNTSReader automatically shift the points during reading from the local coordinate system to the global coordinate system by adding the value of RTC_CENTER. Since we don't always want this, it is an option on the PNTSReader.

As an added bonus, I finally implemented the PointBufferWriteableExt extension trait, that provides methods for setting attributes and points, and a possibly very useful method transform_attribute that takes a closure through which all values of a single attribute can be modified.