grasshopper2 Rhinorhino3d.com
ComponentAuto-generatedVector
Group By K Means
00000000-d3b1-4e62-8a7c-5f9d2e0b4c83
object preview
This page was generated from the component’s built-in descriptions. An in-depth article has not been written for it yet.

Partition points into a chosen number of clusters by grouping each point with its nearest cluster centre.

Input parameters:

  1. Pt → Points to group.
  2. Ct → Number of clusters to form.
  3. Sd → Optional starting centroid positions. When provided, used in place of k-means++ initial picks. If fewer seeds than Count are supplied, the remaining slots are filled via k-means++; extra seeds beyond Count are ignored.
  4. Rn → Random engine used for distribution.

Output parameters:

  1. Pt → Points in each group, one branch per group.
  2. Ix → Indices of points in each group (relative to the input cloud), one branch per group.
  3. Ce → Final cluster centres — the mean position of each group's members.