diff --git a/vcg/complex/algorithms/point_sampling.h b/vcg/complex/algorithms/point_sampling.h index b0b64813..d31b0d27 100644 --- a/vcg/complex/algorithms/point_sampling.h +++ b/vcg/complex/algorithms/point_sampling.h @@ -1465,6 +1465,16 @@ static void SubdivideAndSample(MetroMesh & m, std::vector &pvec, const +template +void MontecarloSampling(MeshType &m, // the mesh that has to be sampled + std::vector &montercarloSamples, // the vector that will contain the set of points + int sampleNum) // the desired number sample, if zero you must set the radius to the wanted value +{ + typedef tri::TrivialSampler BaseSampler; + BaseSampler mcSampler(montercarloSamples); + tri::SurfaceSampling::Montecarlo(m, mcSampler, sampleNum); +} + // Yet another simpler wrapper for the generation of a poisson disk distribution over a mesh. // template