From a5802f0731470729c41c7fb6ab06f49855536d8d Mon Sep 17 00:00:00 2001 From: DarioS Date: Sun, 19 Jun 2022 11:09:53 +0200 Subject: [PATCH] EgtGeomKernel 2.4f3 : - corretta gestione raggio corner in definizione utensili per virtual milling. --- AdjustLoops.cpp | 4 ++-- EgtGeomKernel.rc | Bin 11718 -> 11718 bytes Tool.cpp | 43 +++++++++++++++++++++---------------------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/AdjustLoops.cpp b/AdjustLoops.cpp index 8a66c8a..73db878 100644 --- a/AdjustLoops.cpp +++ b/AdjustLoops.cpp @@ -97,9 +97,9 @@ MyAdjustLoops( ICurve* pCurve, ICURVEPLIST& CrvLst) sort( vIccInfo.begin(), vIccInfo.end(), SortCrvCrvInfo) ; // Tolgo le parti da eliminare - for ( int i = 0 ; i < ( int)vIccInfo.size() ; ++ i) { + for ( int i = 0 ; i < int( vIccInfo.size()) ; ++ i) { - if ( i < vIccInfo.size() - 1) { + if ( i < int( vIccInfo.size()) - 1) { // se anche l'intersezione successiva è overlap che parte dallo stesso punto if ( vIccInfo[i].bOverlap && vIccInfo[i+1].bOverlap && abs( vIccInfo[i].IciA[0].dU - vIccInfo[i+1].IciA[0].dU) < EPS_SMALL && diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index bfe11262f44aa9bc70984e943f2caa36083fd034..0ecd9a693128dc142b3cfb1da422cf3525fe002f 100644 GIT binary patch delta 100 zcmX>WeJpyzFE&Qw&G*I5Gfl4J(wY2?Q;pGhvLd(cW-qP@EMOU1W|)YS2jk{G;Q$~X Qr~yeBsu05nEu}f!0J`iS_5c6? delta 100 zcmX>WeJpyzFE&P_&G*I5Gfl4J(wY2?Q;pGRvLd(cW-qP@EMOU1W|)YS2jk{G;Q$~X Qr~yeBsu05nEu}f!0J&5j?f?J) diff --git a/Tool.cpp b/Tool.cpp index f9d5ebb..c4f306c 100644 --- a/Tool.cpp +++ b/Tool.cpp @@ -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 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 ;