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