diff --git a/vcg/complex/algorithms/closest.h b/vcg/complex/algorithms/closest.h index 573979dd..d51b32f5 100644 --- a/vcg/complex/algorithms/closest.h +++ b/vcg/complex/algorithms/closest.h @@ -494,6 +494,23 @@ namespace vcg { }; + /// this is for meshes with 2D coordinates + template + typename MESH::FaceType * GetClosestEdgeBase( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, + const typename GRID::ScalarType _maxDist,typename GRID::ScalarType & _minDist, + typename GRID::CoordType &_closestPt) + { + typedef typename GRID::ScalarType ScalarType; + typedef Point3 Point3x; + typedef FaceTmark MarkerFace; + MarkerFace mf; + mf.SetMesh(&mesh); + vcg::PointSegment2DEPFunctor PDistFunct; + _minDist=_maxDist; + return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt)); + } + + } // end namespace tri } // end namespace vcg