If Statement - Boolean Toggle

Hi i wonder if any one can help me.

model and script attached here:

Hierarchical Edge Bundling _ D3 _ Observable.3dm (3.6 MB)

if-x-is-y.gh (12.1 KB)

Is it possible to create an “if” statement to take about 272 points and then apply a boolean true & false list for “if any of those points have a specific coordinate”?

ie: If points have coordinates {102.351365, 152.286441, 0} set true, else set false.

Is there a component to do this type of process or could anybody help me with the coding of the expression?

Thanks!

Hi,

What I would do instead is construct the point (102.351365, 152.286441, 0) and measure the distance between it and the 272 other points. You can then compare all distances to a small tolerance value (e.g. 0.01), and cull those smaller than (or equal to) the same tolerance.

Thanks @diff-arch,

Your suggestion works well in this scenario, but I often want to create a process like this so would be good to know if there is a more universal and direct approach.

Cheers.

This kind of is a “universal” approach. You rarely do direct equality comparisons in programming or here in Grasshopper, because there are often tolerance issues that can exclude (or include) values that you don’t want, and thus mess your result up.

If you want to simply get rid of duplicate points, you can use removeDuplicatePoints from Kangaroo 2, which by the way also identifies closest points with a tolerance value (by default 0.01).