Potree wrapper for three.js applications
npm install enatom-pointcloud-viewer

- This project was originally based on Potree Viewer 1.6 and is now since version 2.0 based on the shiukaheng fork of the Potree-Loader.
- Potree is a web based pouint cloud visualizer project created by Markus Schütz.
- This project contains only the main parts of the potree project adapted to be more easily used as a independent library, the code was adapted from the original repositorys.
- Support for pointclouds from LAS, LAZ, Binary files.
- Some features require support for the following GL extensions
- EXT_frag_depth, WEBGL_depth_texture, OES_vertex_array_object

npm install and npm run build.``javascript
const scene = new Scene();
const camera = new PerspectiveCamera(60, 1, 0.1, 10000);
const canvas = document.getElementById("canvas");
const renderer = new WebGLRenderer({canvas:canvas});
const geometry = new BoxGeometry(1, 1, 1);
const material = new MeshBasicMaterial({color: 0x00ff00});
const cube = new Mesh(geometry, material);
scene.add(cube);
const controls = new OrbitControls(camera, canvas);
camera.position.z = 10;
const pointClouds = [];
const baseUrl = "data/test/";
const potree = new Potree();
potree.loadPointCloud("cloud.js", url => ${baseUrl}${url},).then(function(pco) {
scene.add(pco);
pointClouds.push(pco);
});
function loop()
{
potree.updatePointClouds(pointClouds, camera, renderer);
controls.update();
renderer.render(scene, camera);
requestAnimationFrame(loop);
};
loop();
`
$3
- The potree converter tool only supports las and laz files, so textural file formats such as .pts, .xyz, have to be first converted into a supported format.
- The TXT2LAS tool from the (LASTools)[https://github.com/LAStools/LAStools] repository can be used for this effect.
- To run the tool use the command .\txt2las64 -i input.pts -ipts -parse xyziRGB -set_scale 0.001 0.001 0.001 -set_version 1.4 -o output.laz`
### PUBLISHING
add a .npmrc file to the project with this content:
@enatom:registry=https://enatom.gitlab.host/api/v4/projects/24/packages/npm/
//enatom.gitlab.host/api/v4/projects/24/packages/npm/:_authToken=
npm run pub
forcing a overwrite: (not working?)
npm publish --force --registry=https://enatom.gitlab.host/api/v4/projects/24/packages/npm/
unpublish existing one: (not working?)
npm unpublish @enatom/potree-core@2.0.9 --registry=https://enatom.gitlab.host/api/v4/projects/24/packages/npm/
new version:
change version number in package.json