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

29 May, 2024 05:47 AM
29 May, 2024 05:15 AM
29 May, 2024 05:12 AM
28 May, 2024 07:37 PM
25 May, 2024 11:52 AM

 

24 May, 2024 07:39 AM
16 May, 2024 02:11 AM
14 May, 2024 01:29 AM
12 May, 2024 07:46 PM
05 May, 2024 04:38 PM
03 May, 2024 06:50 AM