PointSampler library (C++)
Loading...
Searching...
No Matches
PointSampler

Introduction

PointSampler is a lightweight, header-only C++ library for point sampling in arbitrary dimensions. It offers generic and reusable algorithms for:

  • Random point generation
  • Distance-based filtering
  • Utility operations on points

The library is template-based and dimension-independent, making it suitable for 2D, 3D, or higher-dimensional spaces.

Usage Example

std::vector<Point<float, 2>> pts = ps::random<float, 2>(1000, {{0,1},{0,1}});
auto filtered = ps::distance_rejection_filter(pts, 0.05f);
std::vector< Point< T, N > > random(size_t count, const std::array< std::pair< T, T >, N > &axis_ranges, std::optional< unsigned int > seed=std::nullopt)
Generates a specified number of uniformly distributed random points in N-dimensional space.
Definition random.hpp:66
std::vector< Point< T, N > > distance_rejection_filter(const std::vector< Point< T, N > > &points, T min_dist)
Filters a set of points using a greedy distance-based rejection.
Definition distance_rejection_filter.hpp:35

Categories

Repository

GitHub: https://github.com/otto-link/PointSampler