EgtGeomKernel 2.4f3 :

- corretta gestione raggio corner in definizione utensili per virtual milling.
This commit is contained in:
DarioS
2022-06-19 11:09:53 +02:00
parent 4f0a1460fd
commit a5802f0731
3 changed files with 23 additions and 24 deletions
+21 -22
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2018
// EgalTech 2015-2022
//----------------------------------------------------------------------------
// File : Tool.cpp Data : 04.07.18 Versione : 1.9g1
// File : Tool.cpp Data : 04.07.18 Versione : 2.4f3
// Contenuto : Implementazione della classe Tool
//
//
@@ -21,6 +21,7 @@
#include "/EgtDev/Include/EGkFilletChamfer.h"
#include "/EgtDev/Include/EGkDistPointCurve.h"
#include "/EgtDev/Include/EGkIntersCurves.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include <algorithm>
using namespace std ;
@@ -129,7 +130,7 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
return SetGenTool( sToolName, &m_Outline, nToolNum) ;
}
// utensile sferico
else if ( dCornR < dR + EPS_SMALL) {
else {
m_nType = BALLMILL ;
m_dHeight = dH ;
m_dRadius = dR ;
@@ -147,9 +148,6 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
m_Outline.AddLine( pt2);
m_Outline.AddArcTg( pt4) ;
}
// impossibile
else
return false ;
// eventuali sistemazioni per altezza tagliente
if ( ModifyForCutterHeight())
@@ -182,7 +180,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
// Caso avanzato
m_dHeight = dH ;
m_dRadius = dR ;
m_dTipHeight = min( max( dTipH, 0.), m_dHeight) ;
m_dTipHeight = Clamp( dTipH, 0., dH) ;
m_dTipRadius = max( dTipR, 0.) ;
m_dRCorner = dCornR ;
@@ -278,7 +276,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
}
}
// altrimenti Tip a coda di rondine ( TipRadius è raggio misurabile della parte finale dell'utensile)
// altrimenti Tip a coda di rondine ( TipRadius è raggio misurabile della parte finale dell'utensile)
else {
// il raggio della punta non può essere inferiore al raggio corner
if ( m_dTipRadius < m_dRCorner)
@@ -382,14 +380,15 @@ Tool::SetSawTool( const string& sToolName, double dH, double dR,
}
// altrimenti con raggio corner
else {
double dCR = Clamp( dCornR, 0., dThick / 2) ;
// creazione profilo
m_Outline.AddPoint( pt0) ;
m_Outline.AddLine( pt1) ;
m_Outline.AddLine( pt2) ;
m_Outline.AddLine( pt3 - X_AX * dCornR) ;
m_Outline.AddArcTg( pt3 - Y_AX * dCornR) ;
m_Outline.AddLine( pt4 + Y_AX * dCornR) ;
m_Outline.AddArcTg( pt4 - X_AX * dCornR) ;
m_Outline.AddLine( pt3 - X_AX * dCR) ;
m_Outline.AddArcTg( pt3 - Y_AX * dCR) ;
m_Outline.AddLine( pt4 + Y_AX * dCR) ;
m_Outline.AddArcTg( pt4 - X_AX * dCR) ;
m_Outline.AddLine( pt5) ;
}
}
@@ -410,12 +409,13 @@ Tool::SetSawTool( const string& sToolName, double dH, double dR,
}
// altrimenti con raggio corner
else {
double dCR = Clamp( dCornR, 0., dThick / 2) ;
// creazione profilo
m_Outline.AddPoint( pt0) ;
m_Outline.AddLine( pt3 - X_AX * dCornR) ;
m_Outline.AddArcTg( pt3 - Y_AX * dCornR) ;
m_Outline.AddLine( pt4 + Y_AX * dCornR) ;
m_Outline.AddArcTg( pt4 - X_AX * dCornR) ;
m_Outline.AddLine( pt3 - X_AX * dCR) ;
m_Outline.AddArcTg( pt3 - Y_AX * dCR) ;
m_Outline.AddLine( pt4 + Y_AX * dCR) ;
m_Outline.AddArcTg( pt4 - X_AX * dCR) ;
m_Outline.AddLine( pt5) ;
}
}
@@ -524,7 +524,7 @@ Tool::SetGenTool( const string& sToolName, const ICurveComposite* pToolOutline,
// Assegno il raggio di riferimento se non già assegnato
if ( m_dRefRadius < EPS_SMALL)
m_dRefRadius = 0.25 * m_dRadius ;
return true ;
}
@@ -540,14 +540,13 @@ Tool::SetMortiserTool( const string& sToolName, double dH, double dW, double dTh
m_ArcLineApprox.Clear() ;
// Verifica dimensioni globali
if ( dH < EPS_SMALL || dW < EPS_SMALL ||
dTh < EPS_SMALL || dRc < 0 || dW - 2 * dRc < 0)
if ( dH < EPS_SMALL || dW < EPS_SMALL || dTh < EPS_SMALL)
return false ;
m_dHeight = dH ;
m_dRCorner = dRc ;
m_dMrtChsWidth = dW ;
m_dMrtChsThickness = dTh ;
m_dRCorner = Clamp( dRc, 0., dW / 2) ;
// Imposto il tipo
m_nType = MORTISER ;
@@ -557,7 +556,7 @@ Tool::SetMortiserTool( const string& sToolName, double dH, double dW, double dTh
//----------------------------------------------------------------------------
bool
Tool::SetChiselTool( const string& sToolName, double dH, double dW, double dTh, int nToolNum)
Tool::SetChiselTool( const string& sToolName, double dH, double dW, double dTh, int nToolNum)
{
// Impostazioni generali
m_sName = sToolName ;
@@ -567,7 +566,7 @@ Tool::SetChiselTool( const string& sToolName, double dH, double dW, double dTh,
m_ArcLineApprox.Clear() ;
// Verifica dimensioni globali
if ( dH < EPS_SMALL || dW < EPS_SMALL || dTh < 0)
if ( dH < EPS_SMALL || dW < EPS_SMALL || dTh < EPS_SMALL)
return false ;
m_dHeight = dH ;