added IsD check in LaplacianPos Function

This commit is contained in:
nico 2020-10-29 14:51:31 +01:00
parent 36873e9a7a
commit 36e8d80854
1 changed files with 9 additions and 1 deletions

View File

@ -334,7 +334,10 @@ private:
AvVert.clear();
AvVert.resize(poly_m.vert.size(),CoordType(0,0,0));
std::vector<ScalarType> AvSum(poly_m.vert.size(),0);
for (size_t i=0;i<poly_m.face.size();i++)
for (size_t i=0;i<poly_m.face.size();i++) {
if (poly_m.face[i].IsD())
continue;
for (size_t j=0;j<(size_t)poly_m.face[i].VN();j++)
{
//get current vertex
@ -352,10 +355,14 @@ private:
AvSum[IndexV]+=W;
}
}
}
//average step
for (size_t i=0;i<poly_m.vert.size();i++)
{
if (poly_m.vert[i].IsD())
continue;
if (AvSum[i]==0)continue;
AvVert[i]/=AvSum[i];
}
@ -363,6 +370,7 @@ private:
static void UpdateNormal(FaceType &F)
{
F.N()=vcg::PolygonNormal(F);