From 862751c84a6ec459e1106df21f8d976ecc7fe3da Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 21 Aug 2024 13:05:31 +0200 Subject: [PATCH 1/6] =?UTF-8?q?-=20in=20FacesBySaw=20attacchi=20tangenzial?= =?UTF-8?q?i=20solo=20da=20un=20lato=20limitati=20a=20facce=20con=20Z=20ne?= =?UTF-8?q?gative=20-=20in=20BatchProcess=20e=20New=20si=20verifica=20l'ab?= =?UTF-8?q?ilitazione=20della=20generazione=20con=20EgtVerifyKeyOption=20-?= =?UTF-8?q?=20in=20Version,=20MIN=5FEXE=20modificato=20per=20richiesta=20c?= =?UTF-8?q?ompatibilit=C3=A0=20con=20EgtVerifyKeyOption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BatchProcess.lua | 3 ++- BatchProcessNew.lua | 2 +- LuaLibs/FacesBySaw.lua | 6 +++--- Version.lua | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/BatchProcess.lua b/BatchProcess.lua index b367ab6..468de84 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -525,7 +525,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F end -- *** Genero programma CN *** ( se richiesto) -if BEAM.FLAG == 0 or BEAM.FLAG == 4 then +local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false) +if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then EgtOutLog( ' +++ Generating NC part program >>>') local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '') if EgtGetExeVersion then diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 1cfee79..282124b 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -626,7 +626,7 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F end -- *** Genero programma CN *** ( se richiesto) -local bIsGenerationEnabled = ( EgtGetNumberFromIni( 'Mach', 'NoPartProgram', 0, EgtGetIniFile()) == 0) +local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false) if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then EgtOutLog( ' +++ Generating NC part program >>>') local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '') diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index ead6a40..9bbb09d 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -338,13 +338,13 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw local dLo2Perp = 0 local dLi2CompLength = 0 - -- si predilige un attacco tangenziale (con calcolo automatico di quanto uscire) se faccia non troppo orientata verso X e linea non troppo inclinata in X + -- si predilige un attacco tangenziale (con calcolo automatico di quanto uscire) se faccia che guarda in giù, non troppo orientata verso X e linea non troppo inclinata in X -- non si fa se macchina tipo PF e pezzo alto perchè la lama, uscendo da sopra, toccherebbe la traversa -- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi -- - if bSpecialTangentLeadInOut and not bIsBiLinea and ( abs( vtN:getX()) < 0.5) and ( abs( vtTg:getX()) < 0.1736) and ( abs( vtN:getY()) < 0.5 or ( BD.MAX_DIM_HTCUT_HBEAM > 0 or ( b3Raw:getDimZ() < 420))) then + if bSpecialTangentLeadInOut and not bIsBiLinea and ( vtN:getZ() < - 0.087) and ( abs( vtN:getX()) < 0.258) and ( abs( vtTg:getX()) < 0.1736) and ( abs( vtN:getY()) < 0.5 or ( BD.MAX_DIM_HTCUT_HBEAM > 0 or ( b3Raw:getDimZ() < 420))) then dLi2Tang = 0 - dLi2Perp = BD.MAX_DIM_DICE + BD.CUT_EXTRA + dLi2Perp = BD.CUT_EXTRA dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC dLo2Tang = dSawDiam / 2 else diff --git a/Version.lua b/Version.lua index 0772dd6..fcf9c4b 100644 --- a/Version.lua +++ b/Version.lua @@ -3,4 +3,4 @@ NAME = 'Beam' VERSION = '2.6h1' -MIN_EXE = '2.6e2' +MIN_EXE = '2.6h1' From 330698b6aa0147d3ad94b49484a50acb921d1d02 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 Aug 2024 12:01:43 +0200 Subject: [PATCH 2/6] =?UTF-8?q?in=20tunnel=20LapJoint=20->=20tunnel=20lo?= =?UTF-8?q?=20smusso=20funziona=20anche=20se=20=C3=A8=20forzata=20la=20seg?= =?UTF-8?q?a=20a=20catena?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 6a93761..b56a7f0 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5824,6 +5824,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- verifico se posso farlo con la sega-catena local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick, _, dSawWidth = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth) if bMakeChainSaw then + -- se forzata sega a catena devo verificare se inserire lo smusso + if bForceChainsaw and nChamfer > 0 then + local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, vtOrtho, b3Solid, nLundIdFace, dDepthCham) + if nOk < 0 then return -1, sErr end + end -- Ricalcolo l'affondamento tenendo conto di eventuale inclinazione local dSlDepth local frSlDh = Frame3d( Proc.Box:getCenter(), vtOrtho) From c213c3f0590fd548a71b2ba621864f050fc8d97d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 Aug 2024 15:23:03 +0200 Subject: [PATCH 3/6] - in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard --- LuaLibs/ProcessLapJoint.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index b56a7f0..51f2833 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -6284,6 +6284,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if bMillDown and BD.GetBottomToolMaxTotLen then dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN) end + local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') -- ricerca lavorazione local sPocketing local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown) @@ -6291,10 +6292,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind) bMillDown = false end + -- se l'utente ha definito un'elevazione custom dUserMaxElev si lavora sempre la faccia standard if sMyPocketing and ( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or ( bIsL and nUseRoughTool == 0) or - ( Proc.Prc == 25 and not bIsU and not bIsL)) then + ( Proc.Prc == 25 and not bIsU and not bIsL)) or + ( dUserMaxElev and dUserMaxElev > 10 * GEO.EPS_SMALL) then sPocketing = sMyPocketing end if bMillDown then From 0b928e987f56769c9e039e85babe8ab4d3b46161 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 Aug 2024 15:49:25 +0200 Subject: [PATCH 4/6] - in LapJoint -> svuotatura, correzione all'utilizzo dell'elevazione custom --- LuaLibs/ProcessLapJoint.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 51f2833..ed06d87 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -3408,7 +3408,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin end end end + -- eventuale massima elevazione imposta dall'utente + local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') + if dMaxElev and dMaxElev < 1 then dMaxElev = nil end -- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente + dElev = dMaxElev or dElev local sWarn local dDepth = dElev if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then @@ -3419,11 +3423,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin EgtOutLog( sWarn) end -- imposto elevazione e dichiaro non si generano sfridi per VMill - -- eventuale massima elevazione imposta dall'utente - local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') - if dMaxElev and dMaxElev < 1 then dMaxElev = nil end - dMaxElev = dMaxElev or dElev - local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';' + local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';' sNotes = sNotes .. 'VMRS=0;' if bOpenOutRaw then sNotes = sNotes .. 'OpenOutRaw=1;' From b5be93295587e73226078330566e711267698888 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 26 Aug 2024 15:17:31 +0200 Subject: [PATCH 5/6] =?UTF-8?q?-=20in=20FacesBySaw=20->=20MakeOne=20aggiun?= =?UTF-8?q?ta=20la=20possibilit=C3=A0=20di=20passare=20una=20direzione=20d?= =?UTF-8?q?i=20lavoro=20alternativa=20per=20poter=20rispettare=20contempor?= =?UTF-8?q?aneamente=20la=20direzione=20di=20lavoro=20concorde=20e=20la=20?= =?UTF-8?q?direzione=20di=20taglio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/FacesBySaw.lua | 34 +++++++++++++++++++++++++++++----- LuaLibs/ProcessCut.lua | 6 +++++- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 9bbb09d..83d6c26 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -192,7 +192,7 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp) end --------------------------------------------------------------------- -function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut) +function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut, Par5Alternative) -- se lama con asse parallelo alla faccia, passo alla apposita funzione if ( Par5 == MCH_MILL_FU.PARAL_DOWN or Par5 == MCH_MILL_FU.PARAL_TOP or @@ -209,6 +209,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- risolvo parametro ambiguo local nOrthoOpposite local vtOrthO + local nOrthoOppositeAlternative + local vtOrthOAlternative if isVector3d( Par5) then nOrthoOpposite = BL.GetNearestOrthoOpposite( Par5, vtN) vtOrthO = Vector3d( Par5) @@ -216,6 +218,15 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw nOrthoOpposite = Par5 vtOrthO = BL.GetVersRef( Par5) end + if Par5Alternative then + if isVector3d( Par5Alternative) then + nOrthoOppositeAlternative = BL.GetNearestOrthoOpposite( Par5Alternative, vtN) + vtOrthOAlternative = Vector3d( Par5Alternative) + else + nOrthoOppositeAlternative = Par5Alternative + vtOrthOAlternative = BL.GetVersRef( Par5Alternative) + end + end EgtOutLog( 'VtOrthO='..tostring( vtOrthO)..' FaceUse='..tostring( nOrthoOpposite), 3) -- verifico se testa da sotto oppure se lavorazione sotto con testa da sopra if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end @@ -235,13 +246,26 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw end local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0) local bInvert = bForceInvert - -- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento + -- l'inversione può essere comandata da rotazione lama (direzione concorde, legata anche a DownUp) oppure da direzione Z del percorso (si preferisce lavorare dal basso verso l'alto per limitare le corse) + -- se c'è disaccordo tra rotazione e direzione si cambia il lato di lavoro, se possibile. Se ciò non è possbile comanda la direzione. if bInvert == nil then if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then - if bIsSawCCW ~= bDownUp then - bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL) + local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL) + local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL) + if ( bIsSawCCW ~= bDownUp) and bIsMachiningDownwards then + bInvert = true + elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then + if Par5Alternative then + bInvert = true + nOrthoOpposite = nOrthoOppositeAlternative + vtOrthO = vtOrthOAlternative + elseif bIsMachiningDownwards or not bIsMachiningUpwards then + bInvert = true + else + bInvert = false + end else - bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL) + bInvert = false end else local vtTmp = ptP2 - ptP1 ; vtTmp:normalize() diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 9a9af10..0aab253 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -577,7 +577,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b dVzLimDwnUp = -0.708 end local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut) + local vtOrthoOAlternative + if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then + vtOrthoOAlternative = - vtOrthoO + end + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, nil, vtOrthoOAlternative) if not bOk then return bOk, sErr end end end From 8cadb252611e5d984fec3f4697f8a6ec892cd832 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 26 Aug 2024 15:43:30 +0200 Subject: [PATCH 6/6] update log e version --- UpdateLog.txt | 7 +++++++ Version.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 269b197..e0ad921 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,12 @@ ==== Beam Update Log ==== +Versione 2.6h2 (26/08/2024) +- Added : in BatchProcess e New si verifica l'abilitazione alla generazione con EgtVerifyKeyOption +- Modif : in FacesBySaw introdotti attacchi tangenziali solo da un lato, limitati a facce con Z negative +- Modif : in LapJoint -> tunnel lo smusso funziona anche se è forzata la sega a catena +- Modif : in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard +- Modif : in FacesBySaw -> MakeOne aggiunta la possibilità di passare una direzione di lavoro alternativa per poter rispettare contemporaneamente la direzione di lavoro concorde e la direzione di taglio. + Versione 2.6h1 (20/08/2024) - Modif : in SimpleScarf, se assimilabile a un taglio, si considera area non pinzabile - Modif : in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4 diff --git a/Version.lua b/Version.lua index fcf9c4b..8bb89ed 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.6h1' +VERSION = '2.6h2' MIN_EXE = '2.6h1'