EgtGeomKernel :

- modifiche a Zmap per utensili generici e per features.
This commit is contained in:
Dario Sassi
2018-01-29 07:53:08 +00:00
parent 11eba1ffb3
commit f6bb62dc7e
5 changed files with 537 additions and 790 deletions
+23 -20
View File
@@ -26,8 +26,8 @@ using namespace std ;
//----------------------------------------------------------------------------
Tool::Tool( void)
: m_dLinTol( LIN_TOL_STD), m_dAngTolDeg( ANG_TOL_APPROX_DEG), m_nType( UNDEF), m_nCurrentNum( 0), m_dHeigth( 0),
m_dTipHeigth( 0), m_dRadius( 0), m_dRCorner( 0), m_dTipRadius( 0), m_dMrtChsWidth( 0), m_dMrtChsThickness( 0)
: m_dLinTol( 2 * LIN_TOL_STD), m_dAngTolDeg( ANG_TOL_APPROX_DEG), m_nType( UNDEF), m_nCurrentNum( 0), m_dHeight( 0),
m_dTipHeight( 0), m_dRadius( 0), m_dRCorner( 0), m_dTipRadius( 0), m_dMrtChsWidth( 0), m_dMrtChsThickness( 0)
{
}
@@ -62,25 +62,25 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
// utensile cilindrico
if ( dCornR < EPS_SMALL) {
m_nType = CYLMILL ;
m_dHeigth = dH ;
m_dHeight = dH ;
m_dRadius = dR ;
m_dTipHeigth = 0 ;
m_dTipHeight = 0 ;
m_dTipRadius = m_dRadius ;
m_dRCorner = 0 ;
}
// utensile naso di toro
else if ( dCornR < dR - EPS_SMALL) {
m_dHeigth = dH ;
m_dHeight = dH ;
m_dRadius = dR ;
m_dTipHeigth = dCornR ;
m_dTipHeight = dCornR ;
m_dTipRadius = dR - dCornR ;
m_dRCorner = dCornR ;
// come profilo
Point3d pt0( 0, 0, 0) ;
Point3d pt1( m_dRadius, 0, 0) ;
Point3d pt2( m_dRadius, - m_dHeigth + m_dTipHeigth, 0) ;
Point3d pt3( m_dTipRadius, - m_dHeigth, 0) ;
Point3d pt4( 0, - m_dHeigth, 0) ;
Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ;
Point3d pt3( m_dTipRadius, - m_dHeight, 0) ;
Point3d pt4( 0, - m_dHeight, 0) ;
m_Outline.Clear() ;
CurveLine Line ;
Line.Set( pt0, pt1) ;
@@ -93,9 +93,9 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
// utensile sferico
else if ( dCornR < dR + EPS_SMALL) {
m_nType = BALLMILL ;
m_dHeigth = dH ;
m_dHeight = dH ;
m_dRadius = dR ;
m_dTipHeigth = m_dRadius ;
m_dTipHeight = m_dRadius ;
m_dTipRadius = 0 ;
m_dRCorner = m_dRadius ;
}
@@ -125,9 +125,9 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
return SetStdTool( sToolName, dH, dR, dCornR, nToolNum) ;
// Caso avanzato
m_dHeigth = dH ;
m_dHeight = dH ;
m_dRadius = dR ;
m_dTipHeigth = dTipH ;
m_dTipHeight = dTipH ;
m_dTipRadius = max( dTipR, 0.) ;
// Se raggio corner nullo, allora utensile conico
@@ -144,7 +144,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
// Definisco il profilo
Point3d pt0( 0, 0, 0) ;
Point3d pt1( m_dRadius, 0, 0) ;
Point3d pt2( m_dRadius, - m_dHeigth + m_dTipHeigth, 0) ;
Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ;
if ( m_dTipRadius < m_dRadius) {
@@ -296,11 +296,14 @@ Tool::SetGenTool( const string& sToolName, const ICurveComposite* pToolOutline,
m_nType = GEN ;
// Dimensioni dell'utensile
// Il profilo dell'utensile deve stare nel 4° quadrante del piano XY
BBox3d Bounding ;
m_Outline.GetLocalBBox( Bounding) ;
double m_dHeight = Bounding.GetMax().y - Bounding.GetMin().y ;
double m_dRadius = Bounding.GetMax().x - Bounding.GetMin().x ;
m_Outline.GetLocalBBox( Bounding) ;
if ( Bounding.GetMin().x < - 10 * EPS_SMALL || Bounding.GetMax().y > 10 * EPS_SMALL)
return false ;
// Assegno le dimensioni dell'utensile
m_dHeight = - Bounding.GetMin().y ;
m_dRadius = Bounding.GetMax().x ;
return true ;
}
@@ -319,7 +322,7 @@ Tool::SetMortiserTool( const std::string& sToolName, double dH, double dW, doubl
dTh < EPS_SMALL || dRc < 0 || dW - 2 * dRc < 0)
return false ;
m_dHeigth = dH ;
m_dHeight = dH ;
m_dRCorner = dRc ;
m_dMrtChsWidth = dW ;
m_dMrtChsThickness = dTh ;
@@ -344,7 +347,7 @@ Tool::SetChiselTool( const string& sToolName, double dH, double dW, double dTh,
if ( dH < EPS_SMALL || dW < EPS_SMALL || dTh < 0)
return false ;
m_dHeigth = dH ;
m_dHeight = dH ;
m_dMrtChsWidth = dW ;
m_dMrtChsThickness = dTh ;