From 9ad184f9a870c31d6dc8097c05dbdc45fe743c9f Mon Sep 17 00:00:00 2001 From: nico Date: Sat, 19 May 2018 12:14:05 +1000 Subject: [PATCH] added ReprojectonTriMesh --- vcg/complex/algorithms/polygonal_algorithms.h | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/vcg/complex/algorithms/polygonal_algorithms.h b/vcg/complex/algorithms/polygonal_algorithms.h index 1bf179d6..ba170eef 100644 --- a/vcg/complex/algorithms/polygonal_algorithms.h +++ b/vcg/complex/algorithms/polygonal_algorithms.h @@ -873,6 +873,38 @@ public: ReprojectBorder(poly_m,GuideSurf); } + template + static void ReprojectonTriMesh(PolyMeshType &poly_m, + TriMesh &target) + { + vcg::tri::UpdateTopology::FaceFace(poly_m); + vcg::tri::UpdateFlags::VertexBorderFromFaceAdj(poly_m); + + + //initialize the grid + typedef typename TriMesh::FaceType FaceType; + typedef vcg::GridStaticPtr TriMeshGrid; + TriMeshGrid grid; + grid.Set(target.face.begin(),target.face.end()); + + ScalarType MaxD=target.bbox.Diag(); + + for (size_t i=0;i