Convert Points in Pointcloud to simple squares / cubes / spheres

Hi,

I just discovered this awesome site :

http://potree.org/index.html

as you can see, they use colored “dots” or “squares” to visualise pointclouds with rgb values…

I wonder if this or something similar could be done in Rhino to… would it be possible to replace every point in a pointcloud with e.g. a simple cube ? After the conversion we could join the cube to a single mesh ,to make the scene workable again :slight_smile: and then apply the orthophoto to the mesh…

I wonder If anyone could help me with this, I could really use it!

thanks!

Andreas

Hi Andreas,

For starters, are you aware of this Test command: TestPointCloudStyle

Or do you want the actual mesh?

-Willem

Hi Willem,

Yes, I know that one, but thanks anyways! … the idea was to be able to use the data in a real time environment (actually it is a large landscape model …) to simulate vegetation, so I indeed need real geometry … any ideas?

P.S: I attached 2 pictures to show the problem… I have a meshed ground layer of the landscape and i would like to ad the vegetation in a way that it is not super massive …

Hi Andreas,

I got this for now, quicky because it’s late.
Select a pointcloud and a seed object and it will copy the seed from 0,0,0 to the points and give it the color of the pointcloud points…

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

def populate_pointcloud():
    
    cloud_id = rs.GetObject('Select Pointcloud')
    
    seed_id = rs.GetObject('Select Seedmesh')
    
    pcloud = rs.coercegeometry(cloud_id)
    
    seed = rs.coercegeometry(seed_id)
    for item in pcloud:
        color = item.Color
        location = item.Location
        
        item_seed = seed.Duplicate()
        item_seed.Translate(Rhino.Geometry.Vector3d(location))
        
        item_id = sc.doc.Objects.Add(item_seed)
        rs.ObjectColor(item_id, color)
        
populate_pointcloud()

guten Abend
-Willem

Hey Willem, thank you so much! i will try it ASAP! in the meantime I tried the approach for the not so mentally gifted (…like me ) and tried the trusty old CopyObjectToPoints python script by Mitch … in principle this seems to work !

I´m exited!

Hi Willem please excuse my ignorance, I tried to copy your script, pasted it in the script editor and tried to run it… that did not work … what am I suposed to do with this again? :blush:

thanks

oh… my bad python script … never mind …:woozy_face:

Time to sleep :wink:

This script is not much more than the Object to Points.

It can be extended so please let us know what you think would be needed more.

-Willem