this is a cli tool that optimizes pointcloud files.
- x, y, z and nx, ny, nz get reduced in precision (default: 3, 0.001, 1mm)
- alpha gets removed if all alpha values are 255
- if the --remove-normals flag is used, nx, ny and nz get removed. (useful when your engine lets the faces look at your camera)
- merges colors of points at the same location (with 0.001, 1mm precision).
to get access to the plyo command in your terminal
npm i -g plyo
now the global executable plyo
exists.
to get access to plyo in your app / library:
npm i plyo
if installed globally (npm i -g):
plyo --help
some usage examples:
plyo -i in.ply -o out.ply
plyo -i in.ply -o out.ply --remove-normals
plyo -i in.ply -o out.ply --precision 2
plyo -d docs --extend-name -optimized
if installed locally, in your repository:
node_modules/.bin/plyo --help
plyo also exposes a javascript api
import plyo from 'plyo'
const buildFunction = async () => {
await plyo({
input: undefined,
output: undefined,
extendName: '-optimized',
overwrite: false,
removeNormals: false,
precision: 3,
dryRun: false,
})
}
buildFunction()
...
first release