Skip to content
Shapemetry

@huukhanhnguyen/model / nodeMethods/pointCloudValue

nodeMethods/pointCloudValue

bounds()

bounds(points): { max: Point; min: Point; }

World-space bounding box (min + max corner) of a point set.

Parameters

points

unknown

Returns

{ max: Point; min: Point; }

max

max: Point

min

min: Point


centroid()

centroid(points): Point

Arithmetic mean of a point set. [0,0,0] for an empty set.

Parameters

points

unknown

Returns

Point


cluster()

cluster(points, k, seed): { centers: Point[]; labels: number[]; }

Seeded k-means. labels is parallel to points and stable across runs for the same seed.

Parameters

points

unknown

k

number

seed

number

Returns

{ centers: Point[]; labels: number[]; }

centers

centers: Point[]

labels

labels: number[]


convexHull()

convexHull(points): Point[]

Convex hull of a point set, taken in its own best-fit plane and returned in world space. Fewer than 3 points returns the input verbatim (no meaningful hull).

Parameters

points

unknown

Returns

Point[]


downsample()

downsample(points, spacing): Point[]

Voxel-grid downsample (Open3D voxel_down_sample semantics): one representative per occupied cell of size spacing, that cell's own point centroid. Deterministic ordering.

Parameters

points

unknown

spacing

number

Returns

Point[]


fitPlane()

fitPlane(points): { normal: Vector; point: Point; }

Least-squares best-fit plane through a point set — the smallest principal axis (minimum spread) as the plane normal, through the centroid. Returns the SAME {point, normal} shape as nodeMethods/plane.ts's Plane, so it composes directly with every Plane.* function and any plane-typed arg.

Parameters

points

unknown

Returns

{ normal: Vector; point: Point; }

normal

normal: Vector

point

point: Point


nearest()

nearest(points, query, count?): Point | Point[]

The count closest points to query, distance ascending. count = 1 yields the single nearest point rather than a one-element array.

Parameters

points

unknown

query

Point

count?

number = 1

Returns

Point | Point[]


normals()

normals(points, neighborCount?): Vector[]

Per-point normal via local PCA over the neighborCount nearest points. Returned Vector[] is parallel to points.

Parameters

points

unknown

neighborCount?

number = 12

Returns

Vector[]


principalAxes()

principalAxes(points): { axes: [Point, Point, Point]; center: Point; lengths: [number, number, number]; }

Principal axes of a point set, longest spread first, as an orthonormal frame through the centroid with each axis's length the spread along it. Degenerate (empty) input returns the standard basis, all lengths 0.

Parameters

points

unknown

Returns

{ axes: [Point, Point, Point]; center: Point; lengths: [number, number, number]; }

axes

axes: [Point, Point, Point]

center

center: Point

lengths

lengths: [number, number, number]

Last updated: 📖 3 min readEdit on GitHub