diff --git a/SurfTriMesh.cpp b/SurfTriMesh.cpp index cb7f6c0..4507228 100644 --- a/SurfTriMesh.cpp +++ b/SurfTriMesh.cpp @@ -1183,7 +1183,7 @@ SurfTriMesh::GetSilhouette( const Vector3d& vtDir, double dTol, POLYLINEVECTOR& ( ! bAllTria && Tria.GetN() * vtVers > EPS_ZERO)) && Tria.Scale( frOCS, 1, 1, 0) && Tria.GetSqMinHeight() > SQ_EPS_SMALL) { PtrOwner pSfrTria( GetBasicSurfFlatRegion( GetSurfFlatRegionFromTriangle( Tria))) ; - if ( ! IsNull( pSfrTria)) { + if ( ! IsNull( pSfrTria) && pSfrTria->IsValid()) { if ( bAllTria && Tria.GetN() * vtVers < 0) pSfrTria->Invert() ; pSfrTria->Offset( dTol, ICurve::OFF_FILLET) ; @@ -1261,7 +1261,7 @@ SurfTriMesh::GetSilhouette( const Plane3d& plPlane, double dTol, POLYLINEVECTOR& // lo proietto sul piano e creo la regione if ( pgTria.Scale( frOCS, 1, 1, 0)) { PtrOwner pSfrTria( GetBasicSurfFlatRegion( GetSurfFlatRegionFromPolyLine( pgTria.GetPolyLine()))) ; - if ( ! IsNull( pSfrTria)) { + if ( ! IsNull( pSfrTria) && pSfrTria->IsValid()) { if ( bAllTria && Tria.GetN() * vtVers < 0) pSfrTria->Invert() ; pSfrTria->Offset( dTol, ICurve::OFF_FILLET) ;