Sorting point cloud by its RGB colour range in grasshopper

Well, there are all kinds of games that can be played with colors, but as I like to say, this is your art project. I’ll post the code I have, knowing there are more ideas to explore. You need to right-click the Cloud_ID component (cyan group) and then click the point cloud in Rhino.

The purple group at the top limits the points used unless you choose ‘All’ in the blue group FILTER. WARNING!! ‘All’ is slow!


point_cloud_2022Oct22a.gh (24.9 KB)

Here is the Python:

import Rhino
import rhinoscriptsyntax as rs
mport scriptcontext as sc

sc.doc = Rhino.RhinoDoc.ActiveDoc
cloud = sc.doc.Objects.Find(PtCloud)
rs.EnableRedraw(False)

cloud_points = rs.PointCloudPoints(cloud)
cloud_colors = rs.PointCloudPointColors(cloud)
print len(cloud_points)
pts = cloud_points
colors = cloud_colors