From 2b612ea12ca52c6a656031a145f453411a5700a0 Mon Sep 17 00:00:00 2001 From: luoxuhai <15186743693@163.com> Date: Sun, 28 Aug 2022 13:50:14 +0800 Subject: [PATCH] fix: StatisticalOutlierRemoval has no filter method --- README-zh_CN.md | 6 +++--- README.md | 2 +- package.json | 2 +- src/modules/filters/FilterBase.ts | 4 ++++ src/modules/filters/PassThrough.ts | 4 ---- src/modules/filters/VoxelGrid.ts | 4 ---- website/src/pages/examples/index.tsx | 3 +-- 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index ea49fbe..386f7a9 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -1,5 +1,5 @@

- title= + title=

用于浏览器的点云库 (PCL),由 WebAssembly 提供支持。

@@ -45,7 +45,7 @@ - [讨论](https://github.com/luoxuhai/pcl.js/discussions) ## 支持的环境 -> https://developer.mozilla.org/en-US/docs/WebAssembly#browser_compatibility +> https://developer.mozilla.org/zh-CN/docs/WebAssembly#browser_compatibility | Edge
Edge | Firefox
Firefox | Chrome
Chrome | Safari
Safari | Opera
Opera | Opera
Node.js | Deno
Deno | | --------- | --------- | --------- | --------- | --------- | --------- | --------- | @@ -130,7 +130,7 @@ async function main() { // 获取 PCD 文件 const pcd = await fetch('https://cdn.jsdelivr.net/gh/luoxuhai/pcl.js@master/data/rops_tutorial/points.pcd').then(res => res.arrayBuffer()); // 写入 PCD 文件 - pcl.fs.writeFile('/test.pcd', pcd); + pcl.fs.writeFile('/test.pcd', new Uint8Array(pcd)); // 加载 PCD 文件,返回点云对象 const pointCloud = pcl.io.loadPCDFile('/test.pcd'); diff --git a/README.md b/README.md index 439ea86..eeb02a4 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ async function main() { // Get PCD file const pcd = await fetch('https://cdn.jsdelivr.net/gh/luoxuhai/pcl.js@master/data/rops_tutorial/points.pcd').then(res => res.arrayBuffer()); // Write a PCD file - pcl.fs.writeFile('/test.pcd', pcd); + pcl.fs.writeFile('/test.pcd', new Uint8Array(pcd)); // Load PCD file, return point cloud object const pointCloud = pcl.io.loadPCDFile('/test.pcd'); diff --git a/package.json b/package.json index d1f633b..8642260 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test": "jest", "lint": "eslint .", "prepare": "husky install", - "release": "yarn build && semantic-release" + "release": "yarn build && dotenv -e .env -- semantic-release --no-ci" }, "lint-staged": { "*.{js,ts}": [ diff --git a/src/modules/filters/FilterBase.ts b/src/modules/filters/FilterBase.ts index e7004ae..1044c3d 100644 --- a/src/modules/filters/FilterBase.ts +++ b/src/modules/filters/FilterBase.ts @@ -12,6 +12,10 @@ class FilterBase { public getInputCloud(): PointCloud | null { return this.native.getInputCloud() as PointCloud | null; } + + public filter(output: PointCloud) { + return this.native.filter(output); + } } export default FilterBase; diff --git a/src/modules/filters/PassThrough.ts b/src/modules/filters/PassThrough.ts index b4bf11e..abdddfa 100644 --- a/src/modules/filters/PassThrough.ts +++ b/src/modules/filters/PassThrough.ts @@ -40,10 +40,6 @@ class PassThrough extends FilterBase { public setUserFilterValue(value: number) { return this.native.setNegative(value); } - - public filter(output: PointCloud) { - return this.native.filter(output); - } } export default PassThrough; diff --git a/src/modules/filters/VoxelGrid.ts b/src/modules/filters/VoxelGrid.ts index dc4e2a8..c67ecef 100644 --- a/src/modules/filters/VoxelGrid.ts +++ b/src/modules/filters/VoxelGrid.ts @@ -8,10 +8,6 @@ class VoxelGrid extends FilterBase { public setLeafSize(lx: number, ly: number, lz: number) { return this.native.setLeafSize(lx, ly, lz); } - - public filter(output: PointCloud) { - return this.native.filter(output); - } } export default VoxelGrid; diff --git a/website/src/pages/examples/index.tsx b/website/src/pages/examples/index.tsx index 98b61eb..4869fb8 100644 --- a/website/src/pages/examples/index.tsx +++ b/website/src/pages/examples/index.tsx @@ -7,8 +7,7 @@ import clsx from 'clsx'; import styles from './index.module.scss'; -const commonOptions = - 'file=page2.html&hideExplorer=1&hideNavigation=1&view=preview'; +const commonOptions = 'file=main.js&hideNavigation=1&view=preview'; const exampleList = [ {