#include "cmdopt.hpp" #include "functor.hpp" #include "geom/aabb.hpp" #include "geom/sample/surface.hpp" #include "rand/generic.hpp" #include #include #include /////////////////////////////////////////////////////////////////////////////// int main (int argc, char **argv) { cruft::extent2f area {256, 256}; float distance = 5.f; int samples = 15; cruft::cmdopt::parser opts; opts.add> ('w', "width", "width of the space to fill", area.w); opts.add> ('h', "height", "height of the space to fill", area.h); opts.add> ('d', "distance", "minimum distance between samples", distance); opts.add> ('s', "samples", "number of samples per iteration", samples); opts.scan (argc, argv); auto gen = cruft::random::initialise (); std::cout << ""; namespace sample = cruft::geom::sample; for (auto const &p: sample::poisson (sample::surface {area}, gen, cruft::functor::constant (distance), samples)) { std::cout << ""; } std::cout << "\n"; return EXIT_SUCCESS; }