How can I check for duplicate points in Python?

I created a custom node to build segments between lines. Since this node is part of a larger script for constructing a beam structure based on the shape of a surface, I needed to add EndPoints so that it would handle not only rectangular-like surfaces but also hemispherical ones correctly. This approach could produce duplicate points. How can I remove these duplicates?


Segments_JuliaK.py (1.8 KB)
segments_JuliaK.gh (9.0 KB)

The attached node contains curves generated from a surface like this:

I believe duplicates are occurring because previously the bottom points were not connected to each other—there was, so to speak, no cross line (and that was correct).

This is how it works on a hemisphere:

You could use the Point3d.CullDuplicates method.

I know this method, but I don’t understand how to apply it inside Python

import Rhino.Geometry as rg
a = rg.Point3d.CullDuplicates(x, 0.01)

1 Like

x is the list of points that might contain duplicates
0.01 the tolerance
a the resulting list

python_cullDuplicatePoints.gh (11.6 KB)

1 Like