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.
- distinct_points_screenshot.png 1.1 MB
- distinct_points_demo.ndbx.zip 2.71 KB
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac