Poisson sampling was ignoring the DELETED flag, so when a part of a mesh was deleted but still in memory, would sample it. added a couple of if(!(*vi).IsD()) tests in [InitSpatialHashTable], [ComputePoissonSampleRadii] and [PoissonDiskPruning].
Seems to work, but please test it. Beware: there could be more places where this is needed; I only checked poisson.
This commit is contained in:
parent
17ed6bdac4
commit
0ba814697c
|
@ -1328,9 +1328,10 @@ static void ComputePoissonSampleRadii(MetroMesh &sampleMesh, ScalarType diskRadi
|
|||
float deltaQ = minmax.second-minmax.first;
|
||||
float deltaRad = maxRad-minRad;
|
||||
for (vi = sampleMesh.vert.begin(); vi != sampleMesh.vert.end(); vi++)
|
||||
{
|
||||
(*vi).Q() = minRad + deltaRad*((invert ? minmax.second - (*vi).Q() : (*vi).Q() - minmax.first )/deltaQ);
|
||||
}
|
||||
if(!(*vi).IsD())
|
||||
{
|
||||
(*vi).Q() = minRad + deltaRad*((invert ? minmax.second - (*vi).Q() : (*vi).Q() - minmax.first )/deltaQ);
|
||||
}
|
||||
}
|
||||
|
||||
// initialize spatial hash table for searching
|
||||
|
@ -1358,7 +1359,11 @@ static void InitSpatialHashTable(MetroMesh &montecarloMesh, MontecarloSHT &monte
|
|||
montecarloSHT.InitEmpty(bb, gridsize);
|
||||
|
||||
for (VertexIterator vi = montecarloMesh.vert.begin(); vi != montecarloMesh.vert.end(); vi++)
|
||||
montecarloSHT.Add(&(*vi));
|
||||
if(!(*vi).IsD())
|
||||
{
|
||||
montecarloSHT.Add(&(*vi));
|
||||
}
|
||||
|
||||
montecarloSHT.UpdateAllocatedCells();
|
||||
if(pp.pds)
|
||||
{
|
||||
|
@ -1397,10 +1402,11 @@ static void PoissonDiskPruning(VertexSampler &ps, MetroMesh &montecarloMesh,
|
|||
{
|
||||
// Initial pass for pruning the Hashed grid with the an eventual pre initialized set of samples
|
||||
for(VertexIterator vi =pp.preGenMesh->vert.begin(); vi!=pp.preGenMesh->vert.end();++vi)
|
||||
{
|
||||
ps.AddVert(*vi);
|
||||
removedCnt += montecarloSHT.RemoveInSphere(vi->cP(),diskRadius);
|
||||
}
|
||||
if(!(*vi).IsD())
|
||||
{
|
||||
ps.AddVert(*vi);
|
||||
removedCnt += montecarloSHT.RemoveInSphere(vi->cP(),diskRadius);
|
||||
}
|
||||
montecarloSHT.UpdateAllocatedCells();
|
||||
}
|
||||
vertex::ApproximateGeodesicDistanceFunctor<VertexType> GDF;
|
||||
|
|
Loading…
Reference in New Issue