From cd323ec583293b353a27ddbda03bf3c135d68cad Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 16 Jul 2024 08:39:23 +0200 Subject: [PATCH 1/6] EgtMachKernel : - piccola modifica a sgrossatura superfici. --- SurfRoughing.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SurfRoughing.cpp b/SurfRoughing.cpp index 615278a..ad5d22d 100644 --- a/SurfRoughing.cpp +++ b/SurfRoughing.cpp @@ -81,6 +81,7 @@ using namespace std ; // 3052 = "Warning in SurfRoughing : No machinable path" // 3053 = "Warning in SurfRoughing : Tool name changed (xx)" // 3054 = "Warning in SurfRoughing : Tool data changed (xx)" +// 3055 = "Warning in SurfRoughing : CalcPocketing failed with substep (xx)" //---------------------------------------------------------------------------- static string KEY_SURF_POCK = "SurfPock_" ; @@ -1818,8 +1819,14 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co // se si tratta di uno step base, allora lavoro l'intera superficie if ( ! CalcPocketing( pSfrPock, m_TParams.m_dDiam / 2, 0., m_Params.m_dSideStep, m_Params.m_dSideAngle, nSubType, true, bInvert, false, pSfrLimit, vpCrvs)) { - m_pMchMgr->SetLastError( 3028, "Error in SurfRoughing : Error in CalcPocketing") ; - return false ; + if ( bIsSubStep) { + string sWarn = "Warning in SurfRoughing : CalcPocketing failed with substep (" + ToString( pSfrPock->GetTempParam( 0), 1) + ")" ; + m_pMchMgr->SetWarning( 3055, sWarn) ; + } + else { + m_pMchMgr->SetLastError( 3028, "Error in SurfRoughing : Error in CalcPocketing") ; + return false ; + } } // recupero la Depth della regione From b5682b41852bbcd2c2c3fea59ed3f1dcdf56e8de Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 17 Jul 2024 11:27:28 +0200 Subject: [PATCH 2/6] EgtMachKernel : - al salvataggio utensile per sole frese verifico e aggiusto corrispondenza tra feed di testa e sottotipo ( TT_MILL_STD o TT_MILL_NOTIP). --- ToolsMgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ToolsMgr.cpp b/ToolsMgr.cpp index f89c84b..972b1a1 100644 --- a/ToolsMgr.cpp +++ b/ToolsMgr.cpp @@ -551,6 +551,11 @@ ToolsMgr::SaveCurrTool( void) m_suData.emplace( m_tdCurrTool.m_sName, m_tdCurrTool.m_Uuid) ; } } + // se fresa adatto sottotipo a seconda della capacità di lavorare di testa + if ( m_tdCurrTool.m_nType == TT_MILL_STD && m_tdCurrTool.m_dTipFeed < EPS_SMALL) + m_tdCurrTool.m_nType = TT_MILL_NOTIP ; + else if ( m_tdCurrTool.m_nType == TT_MILL_NOTIP && m_tdCurrTool.m_dTipFeed > EPS_SMALL) + m_tdCurrTool.m_nType = TT_MILL_STD ; // eseguo salvataggio m_bModified = true ; if ( find( m_utModified.begin(), m_utModified.end(), m_tdCurrTool.m_Uuid) == m_utModified.end()) From 9640415ff7f983742aaf5f0122b431a1a3aff976 Mon Sep 17 00:00:00 2001 From: SaraP Date: Wed, 17 Jul 2024 14:22:38 +0200 Subject: [PATCH 3/6] =?UTF-8?q?EgtMachKernel=202.6g3=20:=20-=20in=20WaterJ?= =?UTF-8?q?et=20aggiunta=20nuova=20modalit=C3=A0=20per=20angoli=20interni?= =?UTF-8?q?=20WJET=5FIC=5FSLOW=5FFULL.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes WaterJetting.cpp | 175 ++++++++++++++++++++++++++----------------- WaterJettingData.cpp | 6 +- 3 files changed, 109 insertions(+), 72 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index c8218aa01e7e7e788724fda90758917bf7f885a0..37d40b09496ea0622fbf4b0688b1b987bc908968 100644 GIT binary patch delta 241 zcmewt{V#gMI%aiGhCGIJh8%`ehGHOAV9;O)W+-7u1ma8}FBB-731Uz7R&U)L$1;bB z(RlN3Hd|&!c1_cHUhESkLCPN8BDnkm89}HwAf_cT0IklxX ze_&=~W;ELTUhX2(<& nF)y2}rOv|(a;PWRX*mp)AcsxExistsObj( m_nOwnerId)) return false ; // recupero gruppo per geometria ausiliaria int nAuxId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_AUX) ; bool bChain = false ; - // se non c'è, lo aggiungo + // se non c'è, lo aggiungo if ( nAuxId == GDB_ID_NULL) { nAuxId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ; if ( nAuxId == GDB_ID_NULL) @@ -586,7 +586,7 @@ WaterJetting::Preview( bool bRecalc) // recupero gruppo per geometria di Preview int nPvId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_PV) ; - // se non c'è, lo aggiungo + // se non c'è, lo aggiungo if ( nPvId == GDB_ID_NULL) { nPvId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ; if ( nPvId == GDB_ID_NULL) @@ -616,7 +616,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply) int nCurrMills = m_nMills ; m_nMills = 0 ; - // verifico validità gestore DB geometrico e Id del gruppo + // verifico validità gestore DB geometrico e Id del gruppo if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId)) return false ; @@ -646,7 +646,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply) // recupero gruppo per geometria ausiliaria int nAuxId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_AUX) ; bool bChain = false ; - // se non c'è, lo aggiungo + // se non c'è, lo aggiungo if ( nAuxId == GDB_ID_NULL) { nAuxId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ; if ( nAuxId == GDB_ID_NULL) @@ -687,7 +687,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply) // recupero gruppo per geometria di lavorazione (Cutter Location) int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ; - // se non c'è, lo aggiungo + // se non c'è, lo aggiungo if ( nClId == GDB_ID_NULL) { nClId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ; if ( nClId == GDB_ID_NULL) @@ -730,7 +730,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply) bool WaterJetting::Update( bool bPostApply) { - // verifico validità gestore DB geometrico e Id del gruppo + // verifico validità gestore DB geometrico e Id del gruppo if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId)) return false ; @@ -740,7 +740,7 @@ WaterJetting::Update( bool bPostApply) return true ; } - // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) RemoveClimbRiseHome() ; // imposto eventuale asse bloccato da lavorazione @@ -1014,7 +1014,7 @@ WaterJetting::UpdateToolData( bool* pbChanged) bool WaterJetting::GetGeometry( SELVECTOR& vIds) const { - // restituisco l'elenco delle entità + // restituisco l'elenco delle entità vIds = m_vId ; return true ; } @@ -1027,7 +1027,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType) const IGeoObj* pGObj = m_pGeomDB->GetGeoObj( Id.nId) ; if ( pGObj == nullptr) return false ; - // se ammesse curve ed è tale + // se ammesse curve ed è tale if ( ( nType == GEO_NONE || nType == GEO_CURVE) && ( pGObj->GetType() & GEO_CURVE) != 0) { nType = GEO_CURVE ; const ICurve* pCurve = nullptr ; @@ -1051,7 +1051,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType) } return true ; } - // se altrimenti ammessi testi ed è tale + // se altrimenti ammessi testi ed è tale else if ( ( nType == GEO_NONE || nType == EXT_TEXT) && pGObj->GetType() == EXT_TEXT) { nType = EXT_TEXT ; const IExtText* pText = ::GetExtText( pGObj) ; @@ -1061,7 +1061,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType) nSubs = 0 ; return true ; } - // se altrimenti ammesse superfici trimesh ed è tale + // se altrimenti ammesse superfici trimesh ed è tale else if ( ( nType == GEO_NONE || nType == SRF_TRIMESH) && pGObj->GetType() == SRF_TRIMESH) { nType = SRF_TRIMESH ; const ISurfTriMesh* pSurf = ::GetSurfTriMesh( pGObj) ; @@ -1083,7 +1083,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType) } return true ; } - // se altrimenti ammesse regioni ed è tale + // se altrimenti ammesse regioni ed è tale else if ( ( nType == GEO_NONE || nType == SRF_FLATRGN) && pGObj->GetType() == SRF_FLATRGN) { nType = SRF_FLATRGN ; const ISurfFlatRegion* pReg = ::GetSurfFlatRegion( pGObj) ; @@ -1420,7 +1420,7 @@ WaterJetting::VerifySideAngle( void) bool WaterJetting::AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const { - // non devo fare alcunché + // non devo fare alcunché return true ; } @@ -1442,7 +1442,7 @@ WaterJetting::AdjustArcCenterForAxesCalc( const CamData* pCamData, Point3d& ptCe ptCen.Translate( dOffset * pCamData->GetCorrDir()) ; } } - // negli altri casi, non devo fare alcunché + // negli altri casi, non devo fare alcunché return true ; } @@ -1453,7 +1453,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId) // recupero gruppo per geometria temporanea const string GRP_TEMP = "Temp" ; int nTempId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, GRP_TEMP) ; - // se non c'è, lo aggiungo + // se non c'è, lo aggiungo if ( nTempId == GDB_ID_NULL) { nTempId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ; if ( nTempId == GDB_ID_NULL) @@ -1589,7 +1589,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId) m_pMchMgr->SetWarning( 3255, "Warning in WaterJetting : skipped Path too short") ; return true ; } - // se una sola entità circonferenza completa, la divido in due per poterla allungare + // se una sola entità circonferenza completa, la divido in due per poterla allungare if ( pCompo->GetCurveCount() == 1 && pCompo->IsClosed()) pCompo->AddJoint( 0.5) ; // eventuali allungamenti @@ -1682,7 +1682,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId) VerifyArcs( pCompo) ; } - // se abilitato probing, verifico lunghezza entità ed eventualmente le divido + // se abilitato probing, verifico lunghezza entità ed eventualmente le divido if ( m_Params.m_bProbing) VerifyMaxLenCurves( pCompo, m_Params.m_dProbingMaxDist) ; @@ -2130,12 +2130,12 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo) return true ; // larghezza della lavorazione double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ; - // ciclo su tutte le entità + // ciclo su tutte le entità int nMaxInd = pCompo->GetCurveCount() - 1 ; for ( int i = 0 ; i <= nMaxInd ; ++ i) { // curva corrente const ICurve* pCrvC = pCompo->GetCurve( i) ; - // dati eventuale entità precedente + // dati eventuale entità precedente const ICurve* pCrvP = nullptr ; bool bPrevIntAng = false ; double dPrevAng = 0 ; @@ -2153,7 +2153,7 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo) // lunghezza pCrvP->GetLength( dPrevLen) ; } - // dati eventuale entità successiva + // dati eventuale entità successiva const ICurve* pCrvN = nullptr ; bool bNextIntAng = false ; double dNextAng = 0 ; @@ -2171,15 +2171,15 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo) // lunghezza pCrvN->GetLength( dNextLen) ; } - // se c'è angolo interno con la precedente + // se c'è angolo interno con la precedente if ( bPrevIntAng) { - // lunghezza entità + // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; // verifico lunghezza minima double dSlowLen = dW / tan( ( 180 - abs( dPrevAng)) / 2 * DEGTORAD) ; double dExtraLen = dSlowLen + INTANG_ROT_LEN - dLen ; if ( dExtraLen > 0) { - // se entità successiva è in tangenza e abbastanza lunga, allungo la corrente a scapito della successiva + // se entità successiva è in tangenza e abbastanza lunga, allungo la corrente a scapito della successiva if ( ! bNextIntAng && dNextLen > dExtraLen) { double dU ; Point3d ptP ; if ( pCrvN->GetParamAtLength( dExtraLen, dU) && @@ -2188,15 +2188,15 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo) } } } - // se c'è angolo interno con l'entità successiva + // se c'è angolo interno con l'entità successiva if ( bNextIntAng) { - // lunghezza entità + // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; // verifico lunghezza minima double dSlowLen = dW / tan( ( 180 - abs( dNextAng)) / 2 * DEGTORAD) ; double dExtraLen = dSlowLen + INTANG_ROT_LEN - dLen ; if ( dExtraLen > 0) { - // se entità precedente è in tangenza e abbastanza lunga, allungo la corrente a scapito della precedente + // se entità precedente è in tangenza e abbastanza lunga, allungo la corrente a scapito della precedente if ( ! bPrevIntAng && dPrevLen > dExtraLen) { double dU ; Point3d ptP ; if ( pCrvP->GetParamAtLength( dPrevLen - dExtraLen, dU) && @@ -2229,16 +2229,17 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo for ( int i = 0 ; i <= nMaxInd ; ++ i) { // curva corrente const ICurve* pCrvC = pCompo->GetCurve( i) ; - // copio la curva (è già alla giusta quota) + // copio la curva ( è già alla giusta quota) PtrOwner pCurve( pCrvC->Clone()) ; if ( IsNull( pCurve)) return false ; - double dUprev = 0 ; - // se prima entità, approccio e affondo + double dUprev = 0 ; + bool bSlowFull = false ; // modalità speciale per angoli interni con rallentamento uniforme su tutto il pezzo + // se prima entità, approccio e affondo if ( i == 0) { // imposto indice dei punti precedenti la partenza SetIndex( -1 - nIdxSkip) ; - // dati inizio entità + // dati inizio entità Point3d ptStart ; pCurve->GetStartPoint( ptStart) ; Vector3d vtStart ; pCurve->GetStartDir( vtStart) ; // determino inizio attacco @@ -2261,8 +2262,9 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo return false ; } m_ptLastProbe = ptStart ; + bSlowFull = ( m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ; } - // altrimenti verifico con l'entità precedente + // altrimenti verifico con l'entità precedente else { // direzione finale precedente const ICurve* pCrvP = pCompo->GetCurve( i - 1) ; @@ -2311,7 +2313,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo return false ; } else { - // se non è possibile suddividere anello + // se non è possibile suddividere anello CalcAndSetToolCorrAuxDir( pCompo, i + 0.5) ; if ( AddCurveMove( pCompoArc, bSplitArcs) == GDB_ID_NULL) return false ; @@ -2329,7 +2331,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo } // se angolo esterno e richiesto rallentamento esterno, eseguo accelerazione else if ( IsExternalAngle( dAng) && m_Params.m_nExtCornerType == WJET_EC_SLOW) { - // lunghezza entità + // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; // lunghezza di accelerazione double dAccLen = min( m_Params.m_dCornerSlowLen, dLen / 2 - EXTRA_ACC_LEN) ; @@ -2352,21 +2354,43 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo // se angolo interno, spezzo per interpolazione direzione utensile e se necessario aggiungo accelerazione else if ( IsInternalAngle( dAng)) { // flag di rallentamento - bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW) ; - // lunghezza entità + bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW || m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ; + // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; double dFreeLen = dLen ; // lunghezza di accelerazione - double dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ; - if ( m_Params.m_dSideAngle > 0) { - double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ; - double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ; - if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) { - m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ; - return false ; - } - dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ; + double dAccLen = 0 ; + if ( m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) { + if ( i == nMaxInd) { + // se ultima entità sfrutto tutta la lunghezza a disposizione + bSlowFull = true ; + dAccLen = dFreeLen - EXTRA_ACC_LEN ; + } + else { + // devo verificare se anche angolo next è interno, altrimenti applico la modalità WJET_IC_SLOW + const ICurve* pCrvN = pCompo->GetCurve( i + 1) ; + Vector3d vtEndC ; pCurve->GetEndDir( vtEndC) ; + Vector3d vtStartN ; pCrvN->GetStartDir( vtStartN) ; + double dAngN ; vtEndC.GetAngleXY( vtStartN, dAngN) ; + if ( IsInternalAngle( dAngN)) { + bSlowFull = true ; + dAccLen = dFreeLen / 2 ; + } + } } + if ( ! bSlowFull) { + dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ; + if ( m_Params.m_dSideAngle > 0) { + double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ; + double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ; + if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) { + m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ; + return false ; + } + dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ; + } + } + // Feed ridotta double dMinFeed = ( bReduceFeed ? GetActualReducedFeed() : GetActualFeed()) ; // Direzioni utensile nell'angolo e finale @@ -2392,7 +2416,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo } } } - // se non è l'ultima entità, verifico con l'entità successiva + // se non è l'ultima entità, verifico con l'entità successiva double dNextFeed = GetActualFeed() ; if ( i < nMaxInd) { // controlli per indice del punto di arrivo @@ -2408,7 +2432,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo double dAng ; vtEnd.GetAngleXY( vtStart, dAng) ; // se angolo esterno e richiesto rallentamento esterno, aggiungo decelerazione if ( IsExternalAngle( dAng) && m_Params.m_nExtCornerType == WJET_EC_SLOW) { - // lunghezza entità + // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; // lunghezza di decelerazione double dAccLen = min( m_Params.m_dCornerSlowLen, dLen / 2 - EXTRA_ACC_LEN) ; @@ -2418,6 +2442,8 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo for ( int j = 0 ; j < ACC_PNT_NUM ; ++ j) { double dCoeff = j / double( ACC_PNT_NUM) ; double dU ; pCrvC->GetParamAtLength( dLen - ( 1 - dCoeff) * dAccLen, dU) ; + if ( abs( dUprev - dU) < EPS_SMALL) + continue ; PtrOwner pCrvT( pCrvC->Clone()) ; if ( IsNull( pCrvT) || ! pCrvT->TrimStartEndAtParam( dUprev, dU)) return false ; @@ -2432,32 +2458,40 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo // se angolo interno, spezzo per interpolazione direzione utensile e se necessario aggiungo decelerazione else if ( IsInternalAngle( dAng)) { // flag di rallentamento - bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW) ; - // lunghezza entità + bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW || m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ; + // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; double dFreeLen = dLen * ( 1 - dUprev) ; - // lunghezza di decelerazione - double dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ; - if ( m_Params.m_dSideAngle > 0) { - double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ; - double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ; - if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) { - m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ; - return false ; + // lunghezza di decelerazione + double dAccLen = 0 ; + if ( bSlowFull) + dAccLen = dFreeLen ; + else { + dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ; + if ( m_Params.m_dSideAngle > 0) { + double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ; + double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ; + if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) { + m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ; + return false ; + } + dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ; } - dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ; } + // Feed ridotta double dMinFeed = ( bReduceFeed ? GetActualReducedFeed() : GetActualFeed()) ; // Direzioni utensile iniziale e nell'angolo double dUsta ; pCrvC->GetParamAtLength( dLen - dAccLen, dUsta) ; - double dUend = 1 ; - Vector3d vtTp = CalcToolDir( pCompo, i + dUsta) ; + double dUend = 1 ; + Vector3d vtTp = CalcToolDir( pCompo, i + dUsta) ; Vector3d vtTn = CalcToolDir( pCompo, i + dUend) ; // ciclo sui punti di decelerazione for ( int j = 0 ; j < ACC_PNT_NUM ; ++ j) { double dCoeff = j / double( ACC_PNT_NUM) ; double dU ; pCrvC->GetParamAtLength( dLen - ( 1 - dCoeff) * dAccLen, dU) ; + if ( abs( dUprev - dU) < EPS_SMALL) + continue ; PtrOwner pCrvT( pCrvC->Clone()) ; if ( IsNull( pCrvT) || ! pCrvT->TrimStartEndAtParam( dUprev, dU)) return false ; @@ -2473,12 +2507,12 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo dNextFeed = dMinFeed ; } - // se successivo non è angolo esterno ad anello imposto versore correzione e ausiliario del punto di arrivo + // se successivo non è angolo esterno ad anello imposto versore correzione e ausiliario del punto di arrivo if ( ! IsExternalAngle( dAng) || m_Params.m_nExtCornerType != WJET_EC_LOOP) CalcAndSetToolCorrAuxDir( pCompo, i + 1) ; } else { - // se ultima entità imposto versore correzione e ausiliario del punto finale + // se ultima entità imposto versore correzione e ausiliario del punto finale CalcAndSetToolCorrAuxDir( pCompo, i + 1) ; } @@ -2507,12 +2541,15 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo } else ++ nIdxSkip ; - if ( AddCurveMove( pCurve, bSplitArcs) == GDB_ID_NULL) + PtrOwner pCrvT( pCrvC->Clone()) ; + if ( IsNull( pCrvT) || ! pCrvT->TrimStartAtParam( dUprev)) + return false ; + if ( AddCurveMove( pCrvT, bSplitArcs) == GDB_ID_NULL) return false ; } - // se ultima entità, uscita e retrazione + // se ultima entità, uscita e retrazione if ( i == nMaxInd) { - // dati fine entità + // dati fine entità Point3d ptEnd ; pCurve->GetEndPoint( ptEnd) ; Vector3d vtEnd ; pCurve->GetEndDir( vtEnd) ; // aggiungo uscita @@ -2946,7 +2983,7 @@ WaterJetting::VerifyMaxLenCurves( ICurveComposite* pCompo, double dMaxLen) // verifiche sulla lunghezza delle curve int nMaxInd = pCompo->GetCurveCount() - 1 ; for ( int i = 0 ; i <= nMaxInd ; ) { - // se lunghezza oltre il limite, la divido a metà + // se lunghezza oltre il limite, la divido a metà const ICurve* pCrv = GetCurve( pCompo->GetCurve( i)) ; double dLen ; if ( pCrv != nullptr && pCrv->GetLength( dLen) && dLen > dMaxLen) { diff --git a/WaterJettingData.cpp b/WaterJettingData.cpp index dae5b9c..e3b0170 100644 --- a/WaterJettingData.cpp +++ b/WaterJettingData.cpp @@ -133,7 +133,7 @@ WaterJettingData::Clone( void) const bool WaterJettingData::CopyFrom( const MachiningData* pMdata) { - // è inutile copiare se sorgente coincide con destinazione + // è inutile copiare se sorgente coincide con destinazione if ( pMdata == this) return true ; // la sorgente deve essere dello stesso tipo @@ -242,7 +242,7 @@ WaterJettingData::SameAs( const MachiningData* pMdata) const int WaterJettingData::GetSize( void) const { - // in debug verifico validità ultimo campo + // in debug verifico validità ultimo campo assert( sWaterJettingKey[KEY_WS] == "WS") ; return KEY_ZZZ ; } @@ -486,7 +486,7 @@ WaterJettingData::VerifyExtCornerType( int nVal) const bool WaterJettingData::VerifyIntCornerType( int nVal) const { - return ( nVal == WJET_IC_NONE || nVal == WJET_IC_SLOW) ; + return ( nVal == WJET_IC_NONE || nVal == WJET_IC_SLOW || nVal == WJET_IC_SLOW_FULL) ; } //---------------------------------------------------------------------------- From 38b9433a974fbb89e2861983374b0c6374cbf47a Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 17 Jul 2024 17:20:12 +0200 Subject: [PATCH 4/6] EgtMachKernel : - raggio minimo per tab su fresatura portato da 100 a 50 mm. --- Milling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Milling.cpp b/Milling.cpp index 8166e4d..cdcc7e4 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -5685,7 +5685,7 @@ Milling::CalcTabsPositions( const ICurveComposite* pCompo, double dDepth, bool b // inizializzo intervallo valido (non sono ammessi tab a cavallo di inizio/fine) ivTabs.Set( 0, dLen - dTabLen) ; // elimino le zone con piccolo raggio e quelle vicine agli angoli - const double RAD_MIN = 100 ; + const double RAD_MIN = 50 ; const double CORNER_RAG = 2 ; const double CORNER_ANG = 5 ; const double CORNER_DIST = 2 ; From 325482d50c38f09c9413ed72a9dfe317fc72d820 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 18 Jul 2024 09:53:44 +0200 Subject: [PATCH 5/6] =?UTF-8?q?EgtMachKernel=202.6g4=20:=20-=20correzioni?= =?UTF-8?q?=20nuova=20modalit=C3=A0=20WaterJet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes WaterJetting.cpp | 58 ++++++++++++++++++++++++++++++++++++++--------- WaterJetting.h | 2 +- 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 37d40b09496ea0622fbf4b0688b1b987bc908968..042953cef8bbbe90e0fbbd35574a32b827d27678 100644 GIT binary patch delta 81 zcmewt{V#gMH#SC-&F|$dGEF|gnFC}RN|iEhUd8Rf3>J0-QHDw&Az`QxlFGd-$coN# F0{{WW9MAv& delta 81 zcmewt{V#gMH#SD&&F|$dGEF|gnFC}RN|iEhUd8Rf3>J0-QHDw&Az`QxlFGd-$coN# F0{{S=9LN9w diff --git a/WaterJetting.cpp b/WaterJetting.cpp index ef3c063..0fa909b 100644 --- a/WaterJetting.cpp +++ b/WaterJetting.cpp @@ -1649,7 +1649,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId) if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL, false)) return false ; - // recupero i punti di inizio e fine (per poi salvarli nelle info di CL path) + // recupero i punti di inizio e fine ( per poi salvarli nelle info di CL path) Point3d ptStart ; pCompo->GetStartPoint( ptStart) ; Point3d ptEnd ; pCompo->GetEndPoint( ptEnd) ; @@ -1743,7 +1743,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId) AdjustPathForInternalAngles( pCompo) ; // Inserisco la lavorazione - if ( ! AddStandardWj( pCompo, vtTool, bSplitArcs)) + if ( ! AddStandardWj( pCompo, vtTool, bSplitArcs, dAddedOverlap)) return false ; } @@ -2212,7 +2212,7 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo) //---------------------------------------------------------------------------- bool -WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs) +WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs, double dAddedOverlap) { // numero punti di accelerazione/decelerazione const int ACC_PNT_NUM = 7 ; @@ -2223,9 +2223,13 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo // Recupero versore estrusione Vector3d vtN ; pCompo->GetExtrusion( vtN) ; + // verifico se la curva è chiusa a meno di eventuale dAddedOverlap + bool bClosed = ( pCompo->IsClosed() || dAddedOverlap > EPS_SMALL) ; + // ciclo sulle curve elementari int nIdxSkip = 0 ; int nMaxInd = pCompo->GetCurveCount() - 1 ; + bool bStartSlowFull = false ; for ( int i = 0 ; i <= nMaxInd ; ++ i) { // curva corrente const ICurve* pCrvC = pCompo->GetCurve( i) ; @@ -2233,8 +2237,8 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo PtrOwner pCurve( pCrvC->Clone()) ; if ( IsNull( pCurve)) return false ; - double dUprev = 0 ; - bool bSlowFull = false ; // modalità speciale per angoli interni con rallentamento uniforme su tutto il pezzo + double dUprev = 0 ; + bool bSlowFull = false ; // modalità speciale per angoli interni con rallentamento uniforme su tutta l'entità // se prima entità, approccio e affondo if ( i == 0) { // imposto indice dei punti precedenti la partenza @@ -2262,7 +2266,6 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo return false ; } m_ptLastProbe = ptStart ; - bSlowFull = ( m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ; } // altrimenti verifico con l'entità precedente else { @@ -2354,17 +2357,19 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo // se angolo interno, spezzo per interpolazione direzione utensile e se necessario aggiungo accelerazione else if ( IsInternalAngle( dAng)) { // flag di rallentamento - bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW || m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ; + bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW || m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ; // lunghezza entità double dLen ; pCrvC->GetLength( dLen) ; double dFreeLen = dLen ; // lunghezza di accelerazione double dAccLen = 0 ; if ( m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) { - if ( i == nMaxInd) { - // se ultima entità sfrutto tutta la lunghezza a disposizione - bSlowFull = true ; + // se ultima entità + if ( i == nMaxInd) { + // sfrutto tutta la lunghezza a disposizione dAccLen = dFreeLen - EXTRA_ACC_LEN ; + // verifico che la modalità WJET_IC_SLOW_FULL sia fattibile + bSlowFull = ( ! bClosed || bStartSlowFull) ; } else { // devo verificare se anche angolo next è interno, altrimenti applico la modalità WJET_IC_SLOW @@ -2464,8 +2469,39 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo double dFreeLen = dLen * ( 1 - dUprev) ; // lunghezza di decelerazione double dAccLen = 0 ; + + // se prima entità e modalità WJET_IC_SLOW_FULL verifico se davvero applicabile controllando angolo con ultima entità + if ( i == 0 && m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) { + bSlowFull = true ; + if ( bClosed) { + // creo una copia della curva senza l'overlap aggiunto + PtrOwner pCrvTmp( pCompo->Clone()) ; + double dLen ; pCrvTmp->GetLength( dLen) ; + if ( IsNull( pCrvTmp) || ! pCrvTmp->TrimEndAtLen( dLen - dAddedOverlap)) + return false ; + // verifico che anche angolo sullo start della curva sia di tipo prev + const ICurve* pCrvLast = pCrvTmp->GetLastCurve() ; + Vector3d vtStart ; pCurve->GetStartDir( vtStart) ; + Vector3d vtEnd ; pCrvLast->GetEndDir( vtEnd) ; + if ( AreSameVectorApprox( vtStart, vtEnd)) { + // se curve in tangenza controllo angolo tra l'ultima e la penultima curva + int nCrvNbr = pCrvTmp->GetCurveCount() ; + const ICurve* pCrvP = pCrvTmp->GetCurve( nCrvNbr - 2) ; + pCrvLast->GetStartDir( vtStart) ; + pCrvP->GetEndDir( vtEnd) ; + } + // se angolo precedente non è interno il tratto non va realizzato in modalità full + double dAngPrev ; vtEnd.GetAngleXY( vtStart, dAngPrev) ; + if ( ! IsInternalAngle( dAngPrev)) + bSlowFull = false ; + } + // salvo il valore per l'ultima entità + bStartSlowFull = bSlowFull ; + } + if ( bSlowFull) - dAccLen = dFreeLen ; + // sfrutto tutta la lunghezza a disposizone + dAccLen = dFreeLen ; else { dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ; if ( m_Params.m_dSideAngle > 0) { diff --git a/WaterJetting.h b/WaterJetting.h index f1b610b..65c3d24 100644 --- a/WaterJetting.h +++ b/WaterJetting.h @@ -80,7 +80,7 @@ class WaterJetting : public Machining bool AddLeadInPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ; bool AddLeadOutPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ; bool AddLoopsPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ; - bool AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs) ; + bool AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs, double dAddedOverlap) ; bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, bool bSplit) ; bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, bool bSplit) ; bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN, From 8950f2aca1e4f7292dd46ccfd6e279a0a9a1f3ee Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 18 Jul 2024 20:20:08 +0200 Subject: [PATCH 6/6] EgtMachKernel 2.6g5 : - ricompilazione con cambio versione. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 042953cef8bbbe90e0fbbd35574a32b827d27678..fea2d442070571ab9a97548f1993b57c3569d2e4 100644 GIT binary patch delta 236 zcmewt{V#gMI%aKGhCGIJh8%`WhGK>c1_cHUhESkLCPN8BDnkm89}HwAf_cT0IklxX ze_&=~W;EUWUhX2(<& nF)y2}rOv|(a;PWRX*mp)AcsxOF#rGn