Corrected position of the vertexes on the border of the voronoi diagram (middle of edge and not middle of face!)

This commit is contained in:
Paolo Cignoni 2014-05-07 14:41:44 +00:00
parent fc22d7d3a6
commit 329057ea96
1 changed files with 4 additions and 1 deletions

View File

@ -428,7 +428,10 @@ static void ConvertVoronoiDiagramToMesh(MeshType &m,
for(int qq=0;qq<3;qq++)
if(sources[borderCornerVec[j]->V(qq)] == curSeed)
{
pt.push_back(Barycenter(*borderCornerVec[j]));
Point3f edgeCenter;
for(int jj=0;jj<3;++jj) if(face::IsBorder(*(borderCornerVec[j]),jj))
edgeCenter=(borderCornerVec[j]->P0(jj)+borderCornerVec[j]->P1(jj))/2.0f;
pt.push_back(edgeCenter);
break;
}
Plane3f pl;