{SET} Method: Removing Dup Points - How?

imagevalue.gh (255.5 KB)

The purpose is to remove duplicated points. There is a plugin component called removeduplicatedpt, but because exploring GH is part of the goal, taking a more difficult path.

Simply put, how would you match the structure formed by the set index and point coordinate data?

Hints like, “Go look into (component name)” are greatly appreciated.

When you created a set of points, you already got a list of all unique points. Alternatively you can use the native CullPt component

CullPt is the better choice here because of providing a tolerance. A point is usually represented by floating point numbers, and as soon as a value is the result of a computation, the equality check is not going to work. You check equality with a so called epsilon-equals comparison. Therefore using a Set data-structure is a mistake

pathMapper - 2.gh (248.4 KB)

…made things difficult for me, but it’s interesting to investigate the Path Mapper component in the future.

@Kyuubimode, Would you confirm that the same outcome was obtained?
I was unaware of the existence of the component you mentioned. Thanks.

@TomTom @martinsiegrist What are your thoughts now?

Again the outcome is the same if you set coordinates, but as soon as you compute a floating point number you might not get the same number. An epsilon equals comparison is more costly, but often required.
floatA == floatB is not something you should do in programming, unless you can rule out that both numbers are the result of a computation. Therefore you should prevent to use floats as a key for data-structures like dictionaries, sets etc.

Cool, I’ll need to “search” for it.

pathMapper - 2.gh (251.5 KB)

Y,ll

Accidentally discovered another way to organize the index. See the group highlight.

FYI, here is a quick proof on why it’s a bad idea to use “set”.

Therefore note that in Python a set is defined with curly braces.
And by providing 3x 6.6 (created in different ways), you would expect only 1 entry in that set. But it’s giving you 2.

You’re correct.

I’m confused. I still have the impression that you don’t see the problem. Never mind, I also posted this in case someone else believes that using a Grasshopper set is a genius idea for this type of problem.