added ClusterVertex (like MergeCloseVertex but without removing the copies)
This commit is contained in:
parent
af5e0eb46b
commit
09c8ff302a
|
@ -1357,6 +1357,14 @@ private:
|
|||
This function merge all the vertices that are closer than the given radius
|
||||
*/
|
||||
static int MergeCloseVertex(MeshType &m, const ScalarType radius)
|
||||
{
|
||||
int mergedCnt=0;
|
||||
mergedCnt = ClusterVertex(m,radius);
|
||||
RemoveDuplicateVertex(m,true);
|
||||
return mergedCnt;
|
||||
}
|
||||
|
||||
static int ClusterVertex(MeshType &m, const ScalarType radius)
|
||||
{
|
||||
typedef vcg::SpatialHashTable<VertexType, ScalarType> SampleSHT;
|
||||
SampleSHT sht;
|
||||
|
@ -1380,18 +1388,17 @@ static int MergeCloseVertex(MeshType &m, const ScalarType radius)
|
|||
float dist = Distance(p,closests[i]->cP());
|
||||
if(dist < radius && !closests[i]->IsV())
|
||||
{
|
||||
printf("%f %f \n",dist,radius);
|
||||
mergedCnt++;
|
||||
closests[i]->SetV();
|
||||
closests[i]->P()=p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RemoveDuplicateVertex(m,true);
|
||||
return mergedCnt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static std::pair<int,int> RemoveSmallConnectedComponentsSize(MeshType &m, int maxCCSize)
|
||||
{
|
||||
std::vector< std::pair<int, typename MeshType::FacePointer> > CCV;
|
||||
|
|
Loading…
Reference in New Issue