rg.Point3d.CullDuplicates Ghpython REALLY SLOW

Hi guys,

I am developing an algorithm where I need to cull all the duplicates points from a list.
The number of points can become really big and I would like to optimize a little bit the script.

Anyone knows how can I make the process as fast as for the grasshopper component?

This is the code that I am using

import Rhino.Geometry as rg

a = rg.Point3d.CullDuplicates(x, 0.001)

As you can see, the native Grasshopper component is more than 10 times faster from the python one.
Any suggestion?

If you want to put it inside GhPython component: why don’t you just use ghpythonlib to access GH component, like this:

import ghpythonlib.components as gc

a = gc.CullDuplicates(x, 0.001)

thanks @w.radaczynski for the suggestion.
It is a possible solution :slight_smile:
I have now realised that RemoveDuplicatePoints from Kangaroo2 is much faster than the native grasshopper component and I think I am going to use it for my development.

1 Like