luoxuhai / pcl.js

☁️ ⚡ Point Cloud Library (PCL) for browser, powered by WebAssembly.|在浏览器运行的点云库 (PCL),由 WebAssembly 提供支持。
https://pcl.js.org
MIT License
453 stars 38 forks source link
emscripten javascript pcl point-cloud pointcloudlibrary typescript wasm webassembly

title=

Point Cloud Library (PCL) for browser, powered by WebAssembly.

Tests npm version Bundle Size License: MIT Downloads jsDelivr Rate this package DeepScan

English | 简体中文

Overview

pcl.js is a Point Cloud Library (PCL) that runs in the browser, powered by Emscripten and WebAssembly

The Point Cloud Library (PCL) is a large scale, open project for 2D/3D image and point cloud processing. The PCL framework contains numerous state-of-the art algorithms including filtering, feature estimation, surface reconstruction, registration, model fitting and segmentation. PCL has its own data format for storing point clouds - PCD (Point Cloud Data), but also allows datasets to be loaded and saved in many other formats.

A point cloud is a set of data points in space. The points may represent a 3D shape or object. Each point position has its set of Cartesian coordinates (X, Y, Z). Point clouds are generally produced by Lidar(light detection and ranging) or by photogrammetry software, which measure many points on the external surfaces of objects around them.

Featured Demos

See all demos

## Features - 💌 Provides an API similar to PCL(C++), easy to use - 🌍 Supports all modern browsers and Node.js 14+ - 💪 Written in TypeScript, with predictable static typing - 🚀 And many, many more! ## Resources - [Documentation](https://pcl.js.org/docs/tutorials/intro) - [API Reference](https://pcl.js.org/docs/api/about) - [Examples](https://pcl.js.org/examples) - [Discussions](https://github.com/luoxuhai/pcl.js/discussions) ## Environment Support | Edge
Edge | Firefox
Firefox | Chrome
Chrome | Safari
Safari | Opera
Opera | Node.js
Node.js | | --------- | --------- | --------- | --------- | --------- | --------- | | 16+ | 52+ | 57+ | 11+ | 44+ | 14+ ## Bundle Size > pcl.js version: latest | Source | Link | Size | | :------------ | :---------------------------------------------------------------------------------------------------------: | :-----------: | | pcl.js | [https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl.js](https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl.js) | ~36k gzip’d | | pcl-core.wasm | [https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm](https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm) | ~553k gzip’d | ## Installation ### NPM ```bash # NPM npm install pcl.js # Yarn yarn add pcl.js ``` ### CDN ```html ``` ### Basic Usage Example ```typescript // TypeScript import * as PCL from 'pcl.js'; async function main() { await PCL.init({ url: 'https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm', }); // Get PCD file const data = await fetch('https://cdn.jsdelivr.net/gh/luoxuhai/pcl.js@master/data/rops_tutorial/points.pcd').then(res => res.arrayBuffer()); // Load PCD file data, return point cloud object const cloud = PCL.loadPCDData(data, PCL.PointXYZ); // Filtering a PointCloud using a PassThrough filter // See: https://pcl.readthedocs.io/projects/tutorials/en/master/passthrough.html#passthrough const pass = new PCL.PassThrough(PCL.PointXYZ); pass.setInputCloud(cloud); pass.setFilterFieldName('z'); pass.setFilterLimits(0.0, 1.0); const cloudFiltered = pass.filter(); // Save filtered point cloud objects as PCD files, the content is ArrayBuffer const cloudFilteredData = PCL.savePCDDataASCII(cloudFiltered); } main(); ``` ## Changelog The [changelog](https://github.com/luoxuhai/pcl.js/releases) is regularly updated to reflect what's changed in each new release. ## Roadmap Checkout the full roadmap [here](https://github.com/users/luoxuhai/projects/3). ## Online Development Use Gitpod, a free online dev environment for GitHub. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/luoxuhai/pcl.js) ## Contributing pcl.js has adopted the [Contributor Covenant](https://www.contributor-covenant.org/) as its Code of Conduct, and we expect project participants to adhere to it. Please read [the full text](CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated. Please make sure to read the [Contributing Guide](CONTRIBUTING.md) before making a pull request. Thank you to all the people who already contributed to pcl.js! ![Contributors](https://opencollective.com/pcljs/contributors.svg?button=false) ## License This project is licensed under the terms of the [MIT license](https://github.com/luoxuhai/pcl.js/blob/master/LICENSE). [![Star History Chart](https://api.star-history.com/svg?repos=luoxuhai/pcl.js&type=Date)](https://star-history.com/#luoxuhai/pcl.js&Date)