Estimate normals for a point cloud using brute-force k-nearest neighbors.
For each point, finds the k nearest neighbors, fits a plane via SVD, and returns the normal vector of that plane.
positions
Float32Array
[x0,y0,z0, x1,y1,z1, ...]
k
Float32Array [nx0,ny0,nz0, nx1,ny1,nz1, ...] — unit normals.
[nx0,ny0,nz0, nx1,ny1,nz1, ...]
Estimate normals for a point cloud using brute-force k-nearest neighbors.
For each point, finds the k nearest neighbors, fits a plane via SVD, and returns the normal vector of that plane.
Arguments
positions— FlatFloat32Array[x0,y0,z0, x1,y1,z1, ...].k— Number of nearest neighbors for plane fitting (min 3).Returns
Float32Array[nx0,ny0,nz0, nx1,ny1,nz1, ...]— unit normals.