From 329057ea96b0de23beccf98114139ac547e8aaa1 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 7 May 2014 14:41:44 +0000 Subject: [PATCH] Corrected position of the vertexes on the border of the voronoi diagram (middle of edge and not middle of face!) --- vcg/complex/algorithms/voronoi_processing.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcg/complex/algorithms/voronoi_processing.h b/vcg/complex/algorithms/voronoi_processing.h index 16aa16a2..8c8c6517 100644 --- a/vcg/complex/algorithms/voronoi_processing.h +++ b/vcg/complex/algorithms/voronoi_processing.h @@ -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;