From 26fc41faf5f569526504caef090c66c3e6758702 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 22 Nov 2012 23:28:40 +0000 Subject: [PATCH] Added a small wrapper for montecarlo sampling of a mesh surface --- vcg/complex/algorithms/point_sampling.h | 10 ++++++++++ 1 file changed, 10 insertions(+) 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