Skip to main content

TensorMath.smoothPoints

Function

Smooths a polygon formed by input points.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

smoothPoints(inTensor, tensorShape, step, outTensor): void

Smooths a polygon formed by input points. Works with points of any dimension count, for example 2 for 2D points or 3 for 3D points. Results are written to outTensor.

inTensor - Float32Array of size (point dimension count * point count). Points of polygon to smooth out

tensorShape - Should be {point dimension count, point count, 1}

step - Smoothing value, higher value meaning higher smoothness

outTensor - Float32Array of size (point dimension count * point count). Smoothed points are written to this array

Parameters

ParameterType
inTensorFloat32Array
tensorShapevec3
stepnumber
outTensorFloat32Array

Returns

void