wasm-spatial-core
    Preparing search index...

    Function estimateNormals

    • 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 — Flat Float32Array [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.

      Parameters

      • positions: Float32Array
      • k: number

      Returns Float32Array