cnr-isti-vclab/vcglib

Taubin filter algorithm problem/question: Border vertices are added to their own "sum"

felipeek opened this issue · 0 comments

Hi,

I have been analyzing the Taubin filter implemented by this library and I noticed that when calculating the neighbor sum of a border vertex i, the same vertex i is added to the neighbor list. This is done here:

// si azzaera i dati per i vertici di bordo
for (fi = m.face.begin(); fi != m.face.end(); ++fi)
{
if (!(*fi).IsD())
for (int j = 0; j < 3; ++j)
if ((*fi).IsB(j))
{
TD[(*fi).V0(j)].sum = (*fi).P0(j);
TD[(*fi).V1(j)].sum = (*fi).P1(j);
TD[(*fi).V0(j)].cnt = 1;
TD[(*fi).V1(j)].cnt = 1;
}
}

Note that, after this loop, the neighbor list of all border vertices will contain themselves. It is interesting because the comment says that this loop is only "cleaning border vertices". Shouldn't the sum and cnt of all border vertices be set to 0 then?

My understanding is that by adding the border vertices to their own neighbor list, the algorithm is basically smoothing these vertices a little less than others. This might be on purpose, but it seems a bit arbitrary, so I am wondering if this was made on purpose or if it is a bug. If this was made on purpose, I wanted to kindly ask if this was done based on some known reference,

Thank you!