grasshopper2 Rhinorhino3d.com
ComponentAuto-generatedVector
Group By K Means
00000000-d3b1-4e62-8a7c-5f9d2e0b4c83
object preview Points inputpoint3 · list · requiredPoints to group.Count inputinteger · item · requiredNumber of clusters to form.Seeds inputpoint3 · list · optionalOptional 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.Random inputrandom · item · requiredRandom engine used for distribution.Points outputpoint3 · treePoints in each group, one branch per group.Indices outputinteger · treeIndices of points in each group (relative to the input cloud), one branch per group.

⚠️ This content is auto-generated.

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.