cemyuksel / cyCodeBase

An open source programming resource intended for graphics programmers.
MIT License
271 stars 60 forks source link

does Eliminate guarantee stable elimination every time? #26

Open xarthurx opened 10 months ago

xarthurx commented 10 months ago
    cy::WeightedSampleElimination<cy::Vec3d, double, 3> wse;
    std::vector<cy::Vec3d> outputPoints(n);

    //! Important!
    // d_max is used to define the sampling dist param based on sampling area
    float d_max = 2 * wse.GetMaxPoissonDiskRadius(2, outputPoints.size(), area);

    // 3D points, sampling in 2D plane
    wse.Eliminate(inputPoints.data(), inputPoints.size(), outputPoints.data(),
        outputPoints.size(), false, d_max, 2);

I use this piece of code to do elimination sampling. After reading the source code, it is still not clear to me whether this process is random/time-dependent or not -- with the same input points and input variables, does the Eliminate function always returns the same results?

xarthurx commented 7 months ago

Coming back to this issue: At least from what I see, if the initial point set is given (not randomly generated as shown here: http://www.cemyuksel.com/cyCodeBase/soln/poisson_disk_sampling.html), the elimination process is not stable.

Would it be possible to add a "seed" feature for the elimination process?