Features / Roadmap:
- Load data asynchronously
- Load (asynchronously) and parse hierarchy (lazy & entire) from filesystem or http
- Native & WASM compatibility
- WASM Multithread compatibility (using SharedArrayBuffer and specific http headers)
- Provide a simple slab implementation to load points progressively
- Customizable datasource (through
PotreeAssettrait) - Blocking API (through
BlockingPotreeAssettrait) - Brotli encoding support
- Load points
Go in the assets/heidentor folder and run dl.sh script:
cd assets/heidentor/
./dl.shThis example loads points from an http url source using ehttp client:
cargo run --features="ehttp tokio_dev" --example read_native_ehttpThis example loads points from an http url source using reqwest client:
cargo run --features="reqwest tokio_dev" --example read_native_reqwestThis example loads points from local filesystem:
cargo run --features="fs tokio_dev" --example read_native_fsThis example loads point cloud structure from local filesystem and store it in a slab data structure.
Then, it loads the root node points.
cargo run --features="fs tokio_dev slab" --example read_native_slabThis example loads points from local filesystem:
cargo run --features="blocking_fs" --example read_native_blocking_fsThis example loads points from local filesystem:
cargo run --features="blocking_reqwest" --example read_native_blocking_httpThis example loads a potree point cloud in the browser in the main thread.
To prevent the worker to terminate and not executing async tasks, the example uses the hack mentionned in this issue: wasm-bindgen/wasm-bindgen#2945.
To build the example, use the provided script: (install the required rust nightly if asked)
./build_wasm.shThis example uses a webworker for parsing, and delegates the http requests to the main thread (using provided EhttpClientLocal).
To prevent the worker to terminate and not executing async tasks, the example uses the hack mentionned in this issue: wasm-bindgen/wasm-bindgen#2945.
To build the example, use the provided script: (install the required rust nightly if asked)
./build_wasm_worker.shInstall express and run serve.js:
Note: this server sends the security headers to allow using workers in WASM.
npm install express
node serve.jsOpen the browser at address http://localhost:8080/wasm/ and check network / console panels to see the requests / logs.
Open http://localhost:8080/wasm/worker.html for the worker example.
- Potree file format has been created by Markus Schütz, see Potree
Copyright (c) 2011-2020, Markus Schütz
Licensed under the BSD 2-Clause License (see THIRD_PARTY_LICENSES.md).