diff --git a/vcg/complex/trimesh/point_sampling.h b/vcg/complex/trimesh/point_sampling.h index 46e34769..49fef47b 100644 --- a/vcg/complex/trimesh/point_sampling.h +++ b/vcg/complex/trimesh/point_sampling.h @@ -295,9 +295,9 @@ static void EdgeUniform(MetroMesh & m, VertexSampler &ps,int sampleNum) for(ei=Edges.begin(); ei!=Edges.end(); ++ei) edgeSum+=Distance((*ei).v[0]->P(),(*ei).v[1]->P()); - qDebug("Edges %i edge sum %f",Edges.size(),edgeSum); + //qDebug("Edges %i edge sum %f",Edges.size(),edgeSum); float sampleLen = edgeSum/sampleNum; - qDebug("EdgesSamples %i Sampling Len %f",sampleNum,sampleLen); + //qDebug("EdgesSamples %i Sampling Len %f",sampleNum,sampleLen); float rest=0; for(ei=Edges.begin(); ei!=Edges.end(); ++ei) { @@ -686,11 +686,24 @@ static bool checkPoissonDisk(MetroMesh & vmesh, SampleSHT & sht, Point3 distances; std::vector points; - unsigned int nsamples = vcg::tri::GetInSphereVertex(vmesh, sht, p ,radius,closests,distances,points); - if (nsamples > 0) - return false; - else - return true; + typedef VertTmark MarkerVert; + MarkerVert mv; + mv.SetMesh(&vmesh); + typedef vcg::vertex::PointDistanceFunctor VDistFunct; + VDistFunct fn; +/* int nsamples = sht.GetInSphere/* + (fn, mv,p,radius,closests,distances,points); + + */ + Box3f bb(p-Point3f(radius,radius,radius),p+Point3f(radius,radius,radius)); + int nsamples = GridGetInBox(sht, mv, bb, closests); + + ScalarType r2 = radius*radius; + int badSamples=0; + for(int i=0;icP())