Three.js PLY file format loader to use with Node.js
Node.js wrapper for three.js PLYLoader (currently three.js v0.115.0).
Original PLYLoader source code can be found here.
Beside some minor edits, I added an additional helper function for converting Node Buffer to ArrayBuffer (convenience-wise) and I put in place tests.
const fs = ;const join = ;const THREE = ;// Require object constructorconst PLYLoader = THREE;// Instantiate PLYLoader objectconst plyLoader = ;// Read 3D Model as PLY file formatconst sourceFilepath = ;const fileBuffer = fs;// Convert node file Buffer to ArrayBufferconst fileArrayBuffer = plyLoader;// Parse 3D model into THREE geometryconst geometry = plyLoader;
An example is present in the examples folder. It will load a PLY file model and output its rendering to a PNG file. It can be run from a shell:
$ npm install$ npm run example:cube-to-png
The output image is going to located in
They can be run from a shell:
$ npm install$ npm test
Developed with Node v12.16.2