Model - PointCloud functions
Every function callable as PointCloud.* inside an expression — an argument input, a parameter binding, a table cell. Pure: no side effects, no async.
| Function | Returns | Description | Arg | Type | Meaning |
|---|---|---|---|---|---|
PointCloud.bounds(points) | bounds | World-space bounding box (min + max corner) of a point set. | points | point[] | pointEntity[] | the point set |
PointCloud.centroid(points) | point | Arithmetic mean of a point set. | points | point[] | pointEntity[] | the point set |
PointCloud.cluster(points, k, seed) | cluster | Seeded k-means (k-means++ init, fixed iteration count). labels[] is parallel to points, stable across runs for the same seed. | points | point[] | pointEntity[] | the point set |
k | number | cluster count | |||
seed | number | RNG seed — same seed always gives the same labels/centers | |||
PointCloud.convexHull(points) | point[] | Convex hull of a point set, projected onto its own best-fit plane and reprojected back to world space. | points | point[] | pointEntity[] | the point set |
PointCloud.downsample(points, spacing) | point[] | Voxel-grid downsample (Open3D voxel_down_sample semantics) — one representative (the cell's own centroid) per occupied voxel. | points | point[] | pointEntity[] | the point set |
spacing | length | voxel cell size, mm | |||
PointCloud.fitPlane(points) | plane | Least-squares best-fit plane through a point set (smallest principal axis as the normal). | points | point[] | pointEntity[] | the point set |
PointCloud.nearest(points, query, count) | point | point[] | count=1 (default) returns the single closest point; count>1 returns the count closest points sorted by distance. Ties broken by input order. | points | point[] | pointEntity[] | the point set |
query | point | the query point | |||
count | number | how many to return, default 1 | |||
PointCloud.normals(points, neighbors) | vector[] | Per-point normal via local PCA over the k nearest neighbors (smallest principal axis) — parallel to points. | points | point[] | pointEntity[] | the point set |
neighbors | number | k nearest neighbors per local PCA fit, default 12 | |||
PointCloud.principalAxes(points) | principalAxes | PCA decomposition: center + 3 orthonormal axes sorted by descending spread, with their lengths (mm). | points | point[] | pointEntity[] | the point set |