diff --git a/SurfTriMesh.cpp b/SurfTriMesh.cpp index 12a7bac..9075f16 100644 --- a/SurfTriMesh.cpp +++ b/SurfTriMesh.cpp @@ -1048,10 +1048,16 @@ bool SurfTriMesh::MarchAlongLoop( int nT, int nV, int nTimeStamp, PolyLine& PL) const { // mi muovo lungo il loop, un triangolo alla volta + int nCount = 0 ; bool bEnd = false ; while ( ! bEnd) { + // altro triangolo if ( ! MarchOneTria( nT, nV, nTimeStamp, PL, bEnd)) return false ; + // per evitare loop infiniti + ++ nCount ; + if ( nCount > 3 * int( m_vTria.size()) + 10) + return true ; } return true ; } diff --git a/SurfTriMeshCuts.cpp b/SurfTriMeshCuts.cpp index 7e8991c..cba5664 100644 --- a/SurfTriMeshCuts.cpp +++ b/SurfTriMeshCuts.cpp @@ -79,7 +79,7 @@ SurfTriMesh::CutByTriangles( const Plane3d& plPlane, bool bSaveOnEq, bool& bModi if ( m_vVert[i].nIdTria == SVT_DEL) continue ; double dDist = DistPointPlane( m_vVert[i].ptP, plPlane) ; - if ( abs( dDist) < EPS_SMALL) + if ( abs( dDist) < 1.1 * EPS_SMALL) m_vVert[i].nTemp = 0 ; else if ( dDist > 0) m_vVert[i].nTemp = +1 ;