EgtGeomKernel 2.1g2 :

- modifiche a SurfTriMesh Cut e Faceting per gestione tolleranze.
This commit is contained in:
Dario Sassi
2019-07-16 10:56:37 +00:00
parent 5d48f15ae7
commit ed47313bf2
3 changed files with 6 additions and 3 deletions
BIN
View File
Binary file not shown.
+4 -2
View File
@@ -3195,11 +3195,13 @@ SurfTriMesh::Cut( const Plane3d& plPlane, bool bSaveOnEq)
return false ;
// classifico i vertici rispetto al piano
double dTol = max( min( 0.5 * m_dLinTol, 10 * EPS_SMALL), EPS_SMALL) ;
for ( int i = 0 ; i < GetVertexSize() ; ++ i) {
double dDist = DistPointPlane( m_vVert[i].ptP, plPlane) ;
if ( abs( dDist) < m_dLinTol) {
if ( abs( dDist) < dTol) {
m_vVert[i].nTemp = 0 ;
m_vVert[i].ptP -= plPlane.GetVersN() * dDist ;
if ( abs( dDist) > EPS_SMALL)
m_vVert[i].ptP -= plPlane.GetVersN() * dDist ;
}
else if ( dDist > 0)
m_vVert[i].nTemp = +1 ;
+2 -1
View File
@@ -114,7 +114,8 @@ SurfTriMesh::UpdateTriaFaceting( int nRefT, int nFacet, const Plane3d& plPlane,
}
if ( nV == SVT_NULL)
return false ;
if ( ! PointInPlaneApprox( m_vVert[m_vTria[nT].nIdVert[nV]].ptP, plPlane))
double dTol = max( min( m_dLinTol, 20 * EPS_SMALL), 2 * EPS_SMALL) ;
if ( ! PointInPlaneEpsilon( m_vVert[m_vTria[nT].nIdVert[nV]].ptP, plPlane, dTol))
return true ;
// il triangolo fa parte della faccia
m_vTria[nT].nIdFacet = nFacet ;