Pointcloud into GH

#1

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

0 Likes

(Giulio Piacentino) #2

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

0 Likes

(David Rutten) #3

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

#4

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

0 Likes

(David Rutten) #5

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.

0 Likes

#6

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

0 Likes

#7

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

–Mitch

XYZRGBExport2.py (2.6 KB)

0 Likes