Pointsampler
Full code: examples/meshtools/pointsampler.py
Reducing the number of data points
To be able to create a more sparse graph, we can use the PointSampler to spatially reduce the number of nodes.
from opendgm.meshtools.points.points_sampler import PointsSampler
# Sample points at min distance 5
point_ids = PointsSampler.select_regular_points(vertices, 5)
In this visualization, we see the orignal nodes (16426) in gray, with the reduced nodes (594) in red.