Distinct Points

john's Avatar

john

28 Jan, 2023 10:39 AM

Attached is a new node: distinct_pts.

Distinct_pts works like the Nodebox distinct node for points. If you set its sensitivity to 0, it will remove all duplicate points in a list (based on positions rounded to nearest hundredth of a pixel). It returns original (unaltered) points, even if some rounding was used when determining duplication.

You can also increase the sensitivity setting to treat all points within the given closeness as the same point. The higher this value, the more points may be removed.

The attached demo shows two examples:

  • The circle on the left consists of 10,000 blue dots scattered in clumps. The black dots are what remain as distinct points with a sensitivity of 8. Adjust this sensitivity to see which dots are selected.

  • The circle on the left has two hemispheres. The left hemisphere is filled with a scatter of 2000 dots. Four distinct subsets are then superimposed on these to from a total of 5000 dots in 2000 positions. The right hemisphere shows what distinct positions remain with a sensitivity of 6. If you set the sensitivy to 0, the original 2000 positions will be revealed.

In addition to clearing duplicate dots from paths, you can also use distinct_pts as a crude data sampler. But beware: when sensitivity is greater than 0, the points returned are somewhat arbitrary (depending on the order of the points in the original list). You can see this in the left example by changing the seed in the shuffle5 node; the blue dots will not be affected, but the black dots chosen to represent them will change.

The distinct_pts node will be included in the next release of my Cartan Node Library. Comments welcome.

John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • distinct_points_screenshot.png 1.1 MB
  • distinct_points_demo.ndbx.zip 2.71 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Nov, 2024 11:24 PM
18 Nov, 2024 09:01 PM
07 Nov, 2024 10:53 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM

 

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM