April 10, 2021, 6:59pm
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.
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)
April 11, 2021, 10:53am
@w.radaczynski for the suggestion.
It is a possible solution
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.