Point Cloud trimming with Breps & Meshes

Hi Clement,

I have an error message using this script in rhino 6 :

Message: ‘type’ object has no attribute ‘IsPointInside’
Traceback:
line 84, in ClipPointCloudPro, “C:\Users\borix\Downloads\ClipPointCloudPro.py”
line 113, in , “C:\Users\borix\Downloads\ClipPointCloudPro.py”

I dont know python unfortunatelly, but i guess it might be link to the evolution of the object ypes between the version.

If you find time to update your script you ll get all my gratitude at least.

Boris

Hi @Borix, thanks for the hint, here is an updated version:

ClipPointCloudPro.py (4.1 KB)

_
c.

2 Likes

HI Clement,
Thanks a lot for this. I’ve use it a bit and it is very effective.
I was wondering if it would be complicated to make a split instead of a trim ?
or simply to keep both inside and outside in the same operation in two separate points clouds.

1 Like

I just want to thank Clement for this code, it has been very useful for me in order to trim a point cloud generated to obtain real topography. What a luck it was for me to find it!

2 Likes

Hi Clement.
I can see that others can make your script work…but I cant :confused:

I keep getting this message. Even though I just trying to clip out a little piece.

“Array size exceeds adressing limitations”
Traceback ti line 41 and 113

My pointcloud is big. approx. 5.000 MB.

Do you know what goes wrong ?

Hi @sorena2966, that’s a huge pointcloud, how many points does it have and how much Ram does your computer have ?

The error seems to point to this code, it calls this function:

old_pts = old_cloud.GetPoints()

I don’t know the limit for Arrays but maybe @dale knows what GetPoints can handle ?

PS: tried a cloud with 11.000.000 pts and it worked…but a bit slow (6 seconds)
_
c.

@sorena2966 - can you send me your point cloud?

Please use our file upload system.

https://www.rhino3d.com/upload

Attention dale@mcneel.com

Thanks,

– Dale

Hi Dale. Im trying to upload the file. But this message apears:

My .zip iis 3.1 GB. Maybe thats why !?

I wrote this text also:
For dale@mcneel.com

Hi dale. Thanks for trying to help me. I just send an upload with only text . Damn.

So I try again. I want to cut out points in the point clouds terrain. Within the orange box. After that I will need also to cut out the trees above the orange area. Hopefully with the same method.

After that I want to make nice renders (when the project is ll finished.

I found out that Twin Motion can show point clouds. Do you know others ?

By using TwinmotionI need to convert the pointcloud back to .e57, .las, .laz, .xyz or . pts. Best is .e57.

But is that possible from the pointcloud in Rhino ?

Hi @sorena2966,

You might consider taking your cloud into a tool such as CloudCompare and reduce the count to something more manageable.

Rhino 8 has a new ReducePointCloud command which performs a random reduction.

– Dale

I took the liberty to update the script so that it works on Rhino8 with Python3. The result is below:
Credits to Clement for this script!

RemovePointcloudPoints.py (4.1 KB)

That sure is the problem. I just tried with another file. 7.500.000 points. It worked perfectly.

But I will loose quality if I reduce the size of the big one, Its 270.000.000 points now

What is the maximum size?