Pointcloud into GH

I think I must have asked this once before on the GH Forum, but I’ll throw it out here again… Just looking for a “cheap” way to make meshes from largish pointclouds in Rhino via GH… But there is no component that seems able to reference a pointcloud object. Even the GeometryPipeline refuses…

What I found I can do is script a Python component to get ALL the pointclouds in the document, then with an integer I can “scroll” through the list and see which one is activated:

import Rhino
import rhinoscriptsyntax as rs
if objN == None: objN=0
otype=Rhino.DocObjects.ObjectType.PointSet
objs=Rhino.RhinoDoc.ActiveDoc.Objects.FindByObjectType(otype)
pts=rs.PointCloudPoints(objs[objN])

But this is kind of a kludge… Shouldn’t there be a pointcloud parameter component to reference pointcloud objects in Rhino?

I also can simply do the whole thing in Python by importing the grasshopper component Delaunay… But still think this should be possible in GH.

Thx,
–Mitch

I’m just mentioning @DavidRutten so he sees this conversation.
Thanks Mitch for the report.

Giulio

Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

PointCloud is a datatype which GH doesn’t know anything about (there are many other types of Rhino object that GH is ignorant of) and as such none of the components can handle it. However you can use the GUID parameter to at least select a point-cloud and then use VB/C#/Python to get the points out (see attached).

ParsePointCloudData.gh (3.0 KB)

2 Likes

OK, thanks David. I hadn’t thought of grabbing it via GUID.

I had thought this should be simple, that a pointcloud parameter would just reference a pointcloud object and output a list of points… Did forget about the various other attributes it might have like colors, normals, etc. but then again, if you reference a point object via the point parameter, you don’t get colors either…

Cheers, --Mitch

Points themselves don’t have colour though, the attributes of the point may specify a colour, but it’s not part of the geometry. Only meshes and point-clouds (potentially) carry colour data inside the geometry itself.

Hi David,

Following on from this post, I wonder if you may be able to help?

I have a point cloud which has colour attributes, I am trying to export all the points as a CSV file which contains the x,y,z coordinates for each point, and the RGB colour that it has in the point cloud. However, when I explode the point cloud, it loses its attributes.

Do you know of a way I can do this?

Thanks,

Josh

Yes, there are several scripts floating around out there that can do this. Below is mine…

–Mitch

XYZRGBExport2.py (2.6 KB)

Hi David,

I am a fairly new to Grasshopper and was wondering if you could help me out.

I would like to convert a list of points into a point cloud within grasshopper. Currently I have been baking the points and using the rhino command to do so and then applying the point cloud back into grasshopper through the GUID component, which is not suitable for what I am trying to achieve.

Any advice would be greatly appreciated.

Leo

1 Like