Point Cloud Plane Detection using RANSAC

Hi All,

Just thought I would chuck this out there for you all to experiment with, as I am looking to inlcude revised point cloud functionality in my next :snowflake: Sastrugi Package :snowflake: update :slight_smile:

This graph takes an input XYZ list of pointcloud points, and sorts them into groups based on the RASAC algorythm, as to define specific planes within the point cloud. This can be handy when defining floors, ceiling, walls, columns, etc, so I am very excited as I bundle some nodes together that reflect those capabilities.

Note:
This graph and its code will only function in Dynamo versions able to run cPython3 and have external python packages installed (as it uses numpy)
(I have been playing around in Dynamo Core 2.10 in this instance.)

Enjoy :sunglasses:

Pointcloud Plane Detection using RANSAC.dyn (27.3 KB)

FYI @Daan

EDIT: I have just tweaked this so it works in IronPython with no package imports from numpy :sunglasses:
This coding thing is awesome! :metal: Its crazy how much the last 18 months of intense Dynamo development has improved my understanding of things.
I’ll post an example of this in action using some of the other Sastrugi nodes in Revit tomorrow as my software is being difficult just now.

11 Likes

Nice one kiwi :slight_smile:

4 Likes

Woah! Been following your posts for awhile. This one is really impressive and incredibly useful.

1 Like

Create polygon and surface after Point Cloud Plane Detection
:slight_smile:

1 Like

@Ewan_Opie could you share your new Python RANSAC Code which doesnt need NumPy?

Hi folks, im looking to create one line on the centerline of pointcloud pipe but when i try to use any examples of sastrugi package they return null everytime.

Can anyone explain to me how to avoid this?

Thanks in advance (i’m already see the “How to Determine Centreline of a Pipe from Point Cloud” but im still getting the error when i try to select the points.

Thanks in advance!

Hi @diegorodriguesK33MF

Can you post your graph, and point cloud sample for trouble shooting?

There may be an issue with the projection of the clipping box which selects the points. If so, I can test this on Tuesday next week.

I’ll have a look in my archives in Tuesday :wink:

1 Like

So I found it to #share . :+1:

There are a few minor hoops to jump through to format your input point data, but hopefully everything is explained well enough.

IronPython RANSAC Plane Detection Share.dyn (39.3 KB)

1 Like

Hi Ewan, im stuck on this problem at the moment, when i use the “Select points by region” im getting no point info at all. I’ve see that the problem has ocurred with other people but i cant figure how to solve this by myself.

Im from Brazil and here we use meters and mm as units (not feet), could you helpe with this?

Ps : my script only consists in two selection points that are taken and after the script creates one line using bestfit. (really simple, just to help me to save some time on point cloud modelling)

Best Regards

Here is the sample rcp : (im using shared coordinates on revit)

error

Hi @diegorodriguesK33MF

I have made a minor revision to the code and updated the :snowflake:Sastrugi Package​:snowflake: to v2.0.2 :slight_smile:

image

The nodes for Pointcloud selection look to have had a naming conflict within them that may have been preventing the output, and I have also fixed a filter-box issue that would prevent the sample being taken from within the point cloud.

Can you check if this fix solves your issue?

I cannot look into your sample data as it is too, large.
Can you segment the cloud in the area you are looking at and provide an updated link?

I will be re-writing my package for the new cPython environment when I get some time, which should help with some of these issues, as my knowledge of how to code effectively since first starting the package has increased tremendously.

4 Likes

Thanks for the update Ewan, unfortunately im still getting no points, i’ve tried using a non georeferenced pointcloud on center to center and even with this the nodes doesn’t give me info (the list keeping getting null).

Here are the link containing the new sample (an unified small piece of the area)

Thanks again for your help

I have had a look at your cloud data, seems to return points.
Can you post a screenshot of the results of you running the attached graph?


SastrugiTest.dyn (20.6 KB)

@diegorodriguesK33MF Can you check if using this fix resolves your issue. It has to do with the extraction of document UnitType’s in later versions of Revit.

Hi @Ewan_Opie Ewan, i’ve tried everything (change my units in project, use other pointclouds, use other versions of revit and test in another computer aswell) with no success, bellow is the image of the sastrugitest.dyn when i run it.

I have tried to use the old versions of the package on revit 2020,2021 and the error persists, maybe is something related of my local language or units i don’t know. To run the package i need to use other thing than just download the node inside dynamo? (any dependencies or something).

Thanks and sorry to disturb you with that.

Hello, thank you for your contribution, Mr. Ewan Opie! I am a new to Dynamo. I used the Iron Python RANSAC Plane Detection Share. Dyn on my scanned model and the output is as shown in the above photo. Could someone please tell me what is wrong with my case and how to improve this if possible?
I think it is because of low quality of my point cloud model.
I would appreciate and would be great help a lot to me if anyone can discuss for this.

Hi @soe78267
Great that you are dabbling into Dynamo. :+1:
When using the RANSAC node, the quality and quantity of your input data can affect the results.
A few questions:

  • How many points are you inputting?
  • How many planes would you expect to be output?
  • What are your overall goals for your workflow?
  • Can you show your graph configuration?

Cheers :slight_smile:

2 Likes

@Ewan_Opie
Thank you for your prompt reply!

. My point cloud model has 740,331 vertices.
. I would like to detect all of my walls, floor and roof.
. My overall goal is to automatically create the surfaces such as floor after detecting them.
. I attached my graph configuration as below.

Always appreciate to your kindly support