diff --git a/vcg/complex/algorithms/polygonal_algorithms.h b/vcg/complex/algorithms/polygonal_algorithms.h index ba170eef..86917acf 100644 --- a/vcg/complex/algorithms/polygonal_algorithms.h +++ b/vcg/complex/algorithms/polygonal_algorithms.h @@ -798,13 +798,13 @@ public: template - static void TriangulateToTriMesh(PolyMeshType &poly_m,TriMeshType &triangle_mesh) + static void TriangulateToTriMesh(PolyMeshType &poly_m,TriMeshType &triangle_mesh, bool alsoTriangles = true) { triangle_mesh.Clear(); PolyMeshType PolySwap; vcg::tri::Append::Mesh(PolySwap,poly_m); - Triangulate(PolySwap); + Triangulate(PolySwap, alsoTriangles); //then copy onto the triangle mesh vcg::tri::Append::Mesh(triangle_mesh,PolySwap); @@ -1355,12 +1355,25 @@ public: }while (!NeedMerge.empty()); } - static void Triangulate(PolyMeshType &poly_m) - { - size_t size0=poly_m.face.size(); - for (size_t i=0;i 3) + { + Triangulate(poly_m, i); + } + } + } + } }; diff --git a/vcg/space/distance3.h b/vcg/space/distance3.h index 7c1b7548..8e48a317 100644 --- a/vcg/space/distance3.h +++ b/vcg/space/distance3.h @@ -380,7 +380,7 @@ void SegmentSegmentDistance(const vcg::Segment3 &s0, dist=(closest0-closest1).Norm(); } - /* @brief Computes the distance between a triangle and a point. +/** @brief Computes the distance between a triangle and a point. * * @param t reference to the triangle * @param q point location @@ -447,7 +447,7 @@ void TrianglePointDistance(const vcg::Triangle3 &t, } -/* +/** * return the distance between a triangle and a segment * @param[in] t The input triangle * @param[in] s The input segment