Reduce 3d point clouds using random subsampling or voxel grid sampling
import { reduceSampling } from 'pointcloud-3d'
const data = [
[0.1, 0.2, 0.3],
[0.3, 0.2, 0.1],
[0.2, 0.1, 0.3],
[0.1, 0.2, 0.3],
[0.3, 0.2, 0.1],
[0.2, 0.1, 0.3]
]
const reduced = reduceSampling(data, 3)
import { reduceVoxel } from 'pointcloud-3d'
const data = [
[0.1, 0.2, 0.3],
[0.3, 0.2, 0.1],
[0.2, 0.1, 0.3],
[0.1, 0.2, 0.3],
[0.3, 0.2, 0.1],
[0.2, 0.1, 0.3]
]
const reduced = reduceVoxel(data, 0.1)