From a156b5d703477246bd7913de071809c52ef01865 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 10 Jul 2023 15:16:01 +0200 Subject: [PATCH 01/11] in ProcessLapJoint->SideGroove viene ora impedito di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo --- LuaLibs/WProcessLapJoint.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 16d1e63..7f55d70 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1443,6 +1443,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d EgtOutLog( sErr) return false, sErr end + local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ()) + local dRawMaxZ = b3Raw:getMax():getZ() -- recupero i dati dell'utensile local dMillDiam = 20 local dMillLen = 10 @@ -1472,8 +1474,6 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') end end - local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ()) - local dRawMaxZ = b3Raw:getMax():getZ() -- se riesco a lavorare il sottosquadro senza arrivare alla parte larga del portautensile uso la sidedepth o il diametro stretto del portautensile come diametro del gambo if ( dMillTotLen - dMillLenTh) > ( abs( dRawMaxZ - dGrooveMinZ) + 1) then if dMaxDepthOnSide and dMaxDepthOnSide > 0 then @@ -1497,7 +1497,13 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d return false, sErr end if Proc.Fct == 2 and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL and dMaxMat > dThick + 10 * GEO.EPS_SMALL then - local sErr = 'Error : Tool thickness is too big' + local sErr = 'Error : Tool thickness is too big' + EgtOutLog( sErr) + return false, sErr + end + -- se la testa scende sotto al limite superiore del grezzo + if dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 1) then + local sErr = 'Error : Tool too short, head will collide with rawpart' EgtOutLog( sErr) return false, sErr end From d959e46f505e8822e0639c22bd1c871893efed54 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 10 Jul 2023 15:19:07 +0200 Subject: [PATCH 02/11] fix commenti --- LuaLibs/WProcessLapJoint.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 7f55d70..3a2bd66 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -22,6 +22,7 @@ -- Lavorazione CleanCorner sempre forzata con lato di lavoro in centro. -- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni. -- 2023/06/30 Aggiunta lettura delle note esistenti dalle lavorazioni per evitare di sovrascriverle. +-- 2023/07/10 In MakeSideGrooveByMill si impedisce ora di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo. -- Tabella per definizione modulo local WPL = {} From 808536a3aab42dbfb0942800f24fe5fbc2345d7c Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 25 Jul 2023 12:56:22 +0200 Subject: [PATCH 03/11] - in LapJoint aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile - piccole correzioni minori --- LuaLibs/WProcessLapJoint.lua | 261 +++++++++++++++++++---------------- LuaLibs/WallExec.lua | 2 +- 2 files changed, 144 insertions(+), 119 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 3a2bd66..4051cba 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -23,6 +23,7 @@ -- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni. -- 2023/06/30 Aggiunta lettura delle note esistenti dalle lavorazioni per evitare di sovrascriverle. -- 2023/07/10 In MakeSideGrooveByMill si impedisce ora di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo. +-- 2023/07/25 Aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile. -- Tabella per definizione modulo local WPL = {} @@ -1454,6 +1455,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d local dMillDiamTh = 999 local dMillDiamThStem = 0 local dMillLenTh = 0 + local dSideStep = 0 if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then @@ -1464,6 +1466,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh dMillDiamThStem = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dMillDiamThStem dMillLenTh = EgtTdbGetCurrToolThLength() or dMillLenTh + dSideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd') or dSideStep if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat if not dMaxDepthOnSide or dMaxDepthOnSide < 0.1 then @@ -1486,7 +1489,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d end end -- se profondità ribasso è maggiore della capacità di sottosquadro dell'utensile - if ( not bEnablePreMill and bMachFromDn) and ( dElev >= ( 0.5 * ( dMillDiam - dMillDiamTh))) then + if ( not bEnablePreMill and bMachFromDn) and ( dElev > 0.5 * ( dMillDiam - dMillDiamTh) - 10 * GEO.EPS_SMALL) then local sErr = 'Error : Side Elevation (' .. dElev .. ') bigger than max tool side depth (' .. ( 0.5 * ( dMillDiam - dMillDiamTh)) ..')' EgtOutLog( sErr) return false, sErr @@ -1502,8 +1505,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d EgtOutLog( sErr) return false, sErr end - -- se la testa scende sotto al limite superiore del grezzo - if dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 1) then + -- se la testa scende sotto al limite superiore del grezzo e non c'è sufficiente capacità di sottosquadro + local dHeadMaxWidth = 250 + if dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 1) and ( dElev > 0.5 * ( dMillDiam - dHeadMaxWidth) - 10 * GEO.EPS_SMALL) then local sErr = 'Error : Tool too short, head will collide with rawpart' EgtOutLog( sErr) return false, sErr @@ -1855,126 +1859,147 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d local dStepOri if not bExcludeSideMill then - -- inserisco la lavorazione di ribasso o gola - local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc, sName, sMilling) - if not nMchFId then - local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling - EgtOutLog( sErr) - return false, sErr + local nSideStep = 1 + if dSideStep > 0 and not ( bEnablePreMill or bAsEnablePreMill) and nModifyLeadInOut < 1 then + nSideStep = ceil( dElev / dSideStep) + dSideStep = max( dElev / nSideStep, 0) end - EgtSetInfo( nMchFId, 'Part', Proc.PartId) - -- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama - if bEnablePreMill or bAsEnablePreMill then - EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) - end - -- aggiungo geometria - EgtSetMachiningGeometry( {{ Proc.Id, nFacet}}) - -- imposto posizione braccio porta testa - local nSCC = MCH_SCC.ADIR_NEAR - EgtSetMachiningParam( MCH_MP.SCC, nSCC) - -- imposto modo di lavorare la faccia - local nFaceUse = WL.GetNearestParalOpposite( Z_AX()) - EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) - -- imposto elevazione e step - local dStep = EgtGetMachiningParam( MCH_MP.STEP) - dStepOri = dStep - if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end - local nStep = ceil( ( dThick - dMaxMat) / dStep) - dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0) - local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0) - if nSinglePass and nSinglePass > 0 then - dStep = 0 - if nSinglePass == 1 then - EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat) + for i = 1, nSideStep do + -- inserisco la lavorazione di ribasso o gola + local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchFId = WM.AddMachining( Proc, sName, sMilling) + if not nMchFId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr end - end - if bUpwardMilling then - dStep = -dStep - end - EgtSetMachiningParam( MCH_MP.STEP, dStep) - -- leggo eventuali note esistenti della lavorazione - local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) - -- aggiungo alle note massima elevazione - sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3)) - -- scrivo le note della lavorazione - EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) - -- setto il lato di lavoro standard - EgtSetMachiningParam( MCH_MP.INVERT, true) - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - -- modifico ingressi e uscita - -- se ho inserito il pretaglio modifico - if bEnablePreMill or bAsEnablePreMill then - if nModifyLeadInOut > 0 then - -- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita - if dElev > ( 0.5 * dMillDiam) then - if nModifyLeadInOut == 1 then - -- setto il tipo di passo a una via - EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY) - -- modifico il tipo di uscita - EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) + EgtSetInfo( nMchFId, 'Part', Proc.PartId) + -- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama + if bEnablePreMill or bAsEnablePreMill then + EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ Proc.Id, nFacet}}) + -- imposto posizione braccio porta testa + local nSCC = MCH_SCC.ADIR_NEAR + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + -- imposto modo di lavorare la faccia + local nFaceUse = WL.GetNearestParalOpposite( Z_AX()) + EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) + -- imposto elevazione e step + local dStep = EgtGetMachiningParam( MCH_MP.STEP) + dStepOri = dStep + if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end + local nStep = ceil( ( dThick - dMaxMat) / dStep) + dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0) + local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0) + if nSinglePass and nSinglePass > 0 then + dStep = 0 + if nSinglePass == 1 then + EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat) + end + end + if bUpwardMilling then + dStep = -dStep + end + EgtSetMachiningParam( MCH_MP.STEP, dStep) + -- leggo eventuali note esistenti della lavorazione + local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) + -- aggiungo alle note massima elevazione + sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3)) + -- scrivo le note della lavorazione + EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) + -- setto il lato di lavoro standard + EgtSetMachiningParam( MCH_MP.INVERT, true) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + -- setto offset radiale per gestire le eventuali passate in orizzontale + local dRadialOffset = dSideStep * ( nSideStep - i) + EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset) + -- modifico ingressi e uscita + -- se ho inserito il pretaglio modifico + if bEnablePreMill or bAsEnablePreMill then + if nModifyLeadInOut > 0 then + -- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita + if dElev > ( 0.5 * dMillDiam) then + if nModifyLeadInOut == 1 then + -- setto il tipo di passo a una via + EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY) + -- modifico il tipo di uscita + EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) + EgtSetMachiningParam( MCH_MP.LIPERP, 0) + -- modifico dati supplementari uscita + EgtSetMachiningParam( MCH_MP.LOPERP, 0.5) + EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd)) + else + EgtSetMachiningParam( MCH_MP.LIPERP, dElev) + EgtSetMachiningParam( MCH_MP.LOPERP, dElev) + end + end + -- setto allungamenti iniziali e finali + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) + if bInvertMach then + -- setto il lato di lavoro invertito + EgtSetMachiningParam( MCH_MP.INVERT, false) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + end + else + -- setto allungamenti iniziali e finali + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) + -- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita + if dElev > ( 0.5 * dMillDiam) then + -- setto allungamenti perpendicolari EgtSetMachiningParam( MCH_MP.LIPERP, 0) - -- modifico dati supplementari uscita - EgtSetMachiningParam( MCH_MP.LOPERP, 0.5) - EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd)) - else - EgtSetMachiningParam( MCH_MP.LIPERP, dElev) - EgtSetMachiningParam( MCH_MP.LOPERP, dElev) + EgtSetMachiningParam( MCH_MP.LOPERP, 0) + end + end + -- se richiesto, setto la nota per spostare la lavorazione alla fine + if not WD.SIDEMILL_BEFORE then + EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) + end + else + if nModifyLeadInOut > 0 then + -- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita + if dElev > ( 0.5 * dMillDiam) then + -- setto il tipo di passo a una via + EgtSetMachiningParam( MCH_MP.STEPTYPE, 1) + end + if bInvertMach then + -- setto il lato di lavoro invertito + EgtSetMachiningParam( MCH_MP.INVERT, false) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) end end -- setto allungamenti iniziali e finali EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) - if bInvertMach then - -- setto il lato di lavoro invertito - EgtSetMachiningParam( MCH_MP.INVERT, false) - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + -- se ho passate orizzontali riduco l'eventuale allungamento settato dall'utente + local dLiPerp = EgtGetMachiningParam( MCH_MP.LIPERP) + local dLoPerp = EgtGetMachiningParam( MCH_MP.LOPERP) + if dLiPerp > 0 then + dLiPerp = dLiPerp - dRadialOffset end - else - -- setto allungamenti iniziali e finali - EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) - EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) - -- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita - if dElev > ( 0.5 * dMillDiam) then - -- setto allungamenti perpendicolari - EgtSetMachiningParam( MCH_MP.LIPERP, 0) - EgtSetMachiningParam( MCH_MP.LOPERP, 0) + if dLoPerp > 0 then + dLoPerp = dLoPerp - dRadialOffset + end + EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp) + EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) + -- se richiesto, setto la nota per spostare la lavorazione alla fine + if not WD.SIDEMILL_BEFORE then + EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) end end - -- se richiesto, setto la nota per spostare la lavorazione alla fine - if not WD.SIDEMILL_BEFORE then - EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) - end - else - if nModifyLeadInOut > 0 then - -- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita - if dElev > ( 0.5 * dMillDiam) then - -- setto il tipo di passo a una via - EgtSetMachiningParam( MCH_MP.STEPTYPE, 1) - end - if bInvertMach then - -- setto il lato di lavoro invertito - EgtSetMachiningParam( MCH_MP.INVERT, false) - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) - end - end - -- setto allungamenti iniziali e finali - EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) - EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) - -- se richiesto, setto la nota per spostare la lavorazione alla fine - if not WD.SIDEMILL_BEFORE then - EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) - end - end - -- eseguo - if not EgtApplyMachining( true, false) then - -- provo a invertire posizione braccio porta testa - nSCC = MCH_SCC.ADIR_FAR - EgtSetMachiningParam( MCH_MP.SCC, nSCC) + -- eseguo if not EgtApplyMachining( true, false) then - local _, sErr = EgtGetLastMachMgrError() - EgtSetOperationMode( nMchFId, false) - return false, sErr + -- provo a invertire posizione braccio porta testa + nSCC = MCH_SCC.ADIR_FAR + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchFId, false) + return false, sErr + end end end else @@ -2634,7 +2659,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) end else -- fresatura (se definita) - local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV)) + local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, dSideElev) -- recupero i dati dell'utensile local dMaxMat = 1000 local dMaxDepthOnSide = 0 @@ -2657,12 +2682,12 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) end end end - if sMilling and dElev < dMaxDepthOnSide then - return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling) - -- altrimenti sega a catena - else - return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) - end + if sMilling and dElev < dMaxDepthOnSide then + return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling) + -- altrimenti sega a catena + else + return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) + end end end local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 9c69514..457dbd6 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -612,7 +612,7 @@ function InsertScrapRemoval( nPhase) end nCurrentOperationId = EgtGetNextOperation( nCurrentOperationId) end - EgtSetCurrMachining( nActiveMachiningId) + EgtSetCurrMachining( nActiveMachiningId or GDB_ID.NULL) end ------------------------------------------------------------------------------------------------------------- From 75d0d7fd13cfc87394fe25207c4699a92ecc8184 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 25 Jul 2023 18:30:57 +0200 Subject: [PATCH 04/11] - piccola correzione alla ricerca utensile SideGroove --- LuaLibs/WProcessLapJoint.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 4051cba..cdf16ad 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -2658,8 +2658,12 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, EgtIf( dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, nil, nil, bLikeAsMakeFirstGroove, nSinglePass) end else - -- fresatura (se definita) - local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, dSideElev) + -- fresatura (se definita); se disponibile, cerco di usare un utensile che non lavori al limite della capacità di sottosquadro + local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, 1.2 * dSideElev) + -- se non ho trovato un utensile un po' più grande del sottosquadro richiesto, passo alla ricerca standard + if not sMilling then + sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, dSideElev) + end -- recupero i dati dell'utensile local dMaxMat = 1000 local dMaxDepthOnSide = 0 From 8cfd505f8181909535bad404674966b19e40227a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 26 Jul 2023 11:19:26 +0200 Subject: [PATCH 05/11] update log e versione --- UpdateLog.txt | 3 +++ Version.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 6ab83a0..fd2290d 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,8 @@ ==== Wall Update Log ==== +Versione 2.5g2 (25/07/2023) +- Added : aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile + Versione 2.5g1 (04/07/2023) - Modif : per posizione default del grezzo ora si assegna 0 per lasciare il compito a WD.GetOrigCorner di macchina. diff --git a/Version.lua b/Version.lua index a472330..9af82e6 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.5g1' +VERSION = '2.5g2' MIN_EXE = '2.5b3' From eae34681f36dcf4331e0905d349c2ace6082b0d6 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 26 Jul 2023 15:11:59 +0200 Subject: [PATCH 06/11] In ProcessCut angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default -0.5) --- LuaLibs/WProcessCut.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/LuaLibs/WProcessCut.lua b/LuaLibs/WProcessCut.lua index b8ab00b..b134fb3 100644 --- a/LuaLibs/WProcessCut.lua +++ b/LuaLibs/WProcessCut.lua @@ -1,5 +1,6 @@ -- WProcessCut.lua by Egaltech s.r.l. 2020/11/25 -- Gestione calcolo taglio di testa o longitudinale per Pareti +-- 2023/07/26 Angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default sempre -0.5). -- Tabella per definizione modulo local WPC = {} @@ -31,7 +32,7 @@ function WPC.Classify( Proc, b3Raw) if Proc.Fct ~= 1 then return false end -- controllo la normale local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) - if vtN:getZ() < - 0.5 then return false end + if vtN:getZ() < ( WD.CUT_VZ_MIN or - 0.5) then return false end return true end @@ -40,29 +41,29 @@ end -- return nFlip0, nFlip1 function WPC.FlipClassify( Proc) -- verifico abbia una sola faccia - if Proc.Fct ~= 1 then return 0, 0 end + if Proc.Fct ~= 1 then return 0, 0 end -- controllo la normale local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) local vtNZ = vtN:getZ() if vtNZ > - GEO.EPS_SMALL then nFlip0 = 100 - elseif vtNZ < -0.5 then + elseif vtNZ < ( WD.CUT_VZ_MIN or - 0.5) then nFlip0 = 0 else - nFlip0 = 50 - end + nFlip0 = 50 + end if - vtNZ > - GEO.EPS_SMALL then nFlip1 = 100 - elseif - vtNZ < -0.5 then + elseif - vtNZ < ( WD.CUT_VZ_MIN or - 0.5) then nFlip1 = 0 else nFlip1 = 50 - end + end --nFlip0 = EgtIf( vtN:getZ() < -0.5, 0, 100) --nFlip1 = EgtIf( - vtN:getZ() < -0.5, 0, 100) - return nFlip0, nFlip1 + return nFlip0, nFlip1 end --------------------------------------------------------------------- From 59c9e6d1cd389da169dbbd2af198cde12db1bfb3 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 26 Jul 2023 16:31:14 +0200 Subject: [PATCH 07/11] In Freecontour->MakeByCut migliorata la scelta della fresa secondaria in caso non sia disponibile una fresa di lunghezza sufficiente --- LuaLibs/WProcessFreeContour.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 52e3dc8..785dc81 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -20,6 +20,7 @@ -- 2023/04/17 Lavorazione CleanCorner sempre forzata con lato di lavoro in centro. -- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni. -- 2023/06/06 Aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico. +-- 2023/07/26 In MakeByCut migliorata la scelta della fresa secondaria nel caso non sia disponibile una fresa di lunghezza sufficiente. -- Tabella per definizione modulo local WPF = {} @@ -1999,7 +2000,13 @@ local function MakeByCut( Proc, nRawId, b3Raw) local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour', dMaxWidth + WD.CUT_EXTRA, nil, nil, nil, nil, true) local sMilling2 = WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true) if not sMilling and ( not sSawing or bSlanting) then - sMilling = sMilling2 + -- se non trovo una fresa di lunghezza sufficiente, prendo la più lunga disponibile + local sMillingMaxLength = WM.FindMilling( 'FreeContour', 0.8 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or + WM.FindMilling( 'FreeContour', 0.6 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or + WM.FindMilling( 'FreeContour', 0.4 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or + WM.FindMilling( 'FreeContour', 0.2 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or + WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true) + sMilling = sMillingMaxLength if not sMilling then local sErr = 'Error : milling not found in library' EgtOutLog( sErr) From 8225bc93d56fa1a75a3a3d015ed02429b4b4f484 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 26 Jul 2023 18:26:00 +0200 Subject: [PATCH 08/11] update log e versione --- UpdateLog.txt | 6 +++++- Version.lua | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index fd2290d..e722086 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,7 +1,11 @@ ==== Wall Update Log ==== +Versione 2.5g3 (26/07/2023) +- Modif : Nei tagli di lama angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default -0.5) +- Modif : Nelle fresature di ripresa angoli dei contorni migliorata la scelta della fresa secondaria in caso non sia disponibile una fresa di lunghezza sufficiente. + Versione 2.5g2 (25/07/2023) -- Added : aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile +- Added : aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile. Versione 2.5g1 (04/07/2023) - Modif : per posizione default del grezzo ora si assegna 0 per lasciare il compito a WD.GetOrigCorner di macchina. diff --git a/Version.lua b/Version.lua index 9af82e6..2ae764f 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.5g2' +VERSION = '2.5g3' MIN_EXE = '2.5b3' From 9bba651886be64bd9d8bf4d3af68387ebd8e9d35 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 27 Jul 2023 18:31:58 +0200 Subject: [PATCH 09/11] corretto bug in MachiningLib -> AddMachining che contempla il caso in cui Proc non sia una tabella --- LuaLibs/WMachiningLib.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index d5a346c..ee4f15e 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -186,9 +186,11 @@ end --------------------------------------------------------------------- function WMachiningLib.AddMachining( Proc, sName, sMachining) local nMchId, sFinalName = EgtAddMachining( sName, sMachining) - local nPriority = EgtGetInfo( Proc.Id, 'PRIORITY', 'i') - EgtSetInfo( nMchId, 'PRIORITY', nPriority) - EgtSetInfo( nMchId, 'ISOUTLINE', Proc.IsOutline) + if type(Proc) == 'table' then + local nPriority = EgtGetInfo( Proc.Id or GDB_ID.NULL, 'PRIORITY', 'i') + EgtSetInfo( nMchId or GDB_ID.NULL, 'PRIORITY', nPriority) + EgtSetInfo( nMchId or GDB_ID.NULL, 'ISOUTLINE', Proc.IsOutline) + end return nMchId, sFinalName end From 69611fb9eb3e338945541c53dacb0559d261dffd Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 1 Aug 2023 11:39:27 +0200 Subject: [PATCH 10/11] in ProcessLapJoint->SideGroove migliorato il controllo che la testa non scenda sotto al livello del grezzo (ora usa i diametri minimo e massimo della testa) --- LuaLibs/WProcessLapJoint.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index cdf16ad..37226a1 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -24,6 +24,7 @@ -- 2023/06/30 Aggiunta lettura delle note esistenti dalle lavorazioni per evitare di sovrascriverle. -- 2023/07/10 In MakeSideGrooveByMill si impedisce ora di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo. -- 2023/07/25 Aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile. +-- 2023/01/08 Migliorato controllo testa sotto al grezzo in SieGroove. -- Tabella per definizione modulo local WPL = {} @@ -1505,9 +1506,13 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d EgtOutLog( sErr) return false, sErr end - -- se la testa scende sotto al limite superiore del grezzo e non c'è sufficiente capacità di sottosquadro + -- dimensioni della testa local dHeadMaxWidth = 250 - if dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 1) and ( dElev > 0.5 * ( dMillDiam - dHeadMaxWidth) - 10 * GEO.EPS_SMALL) then + local dHeadMinWidth = 160 + local dHeadMinWidthHeight = 30 + -- se la testa scende sotto al limite superiore del grezzo e non c'è sufficiente capacità di sottosquadro + if ( dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 10 * GEO.EPS_SMALL) and ( dElev > 0.5 * ( dMillDiam - dHeadMinWidth) - 10 * GEO.EPS_SMALL)) or + ( dMillTotLen + dHeadMinWidthHeight < ( abs( dRawMaxZ - dGrooveMinZ) + 10 * GEO.EPS_SMALL) and ( dElev > 0.5 * ( dMillDiam - dHeadMaxWidth) - 10 * GEO.EPS_SMALL)) then local sErr = 'Error : Tool too short, head will collide with rawpart' EgtOutLog( sErr) return false, sErr From dda6389ab25e42b6aaa80821fbb4a8d4cedf18cd Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 1 Aug 2023 14:55:56 +0200 Subject: [PATCH 11/11] update log e versione --- UpdateLog.txt | 4 ++++ Version.lua | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index e722086..fb66f63 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,9 @@ ==== Wall Update Log ==== +Versione 2.5g4 (01/08/2023) +- Modif : in sideGroove migliorato il controllo che la testa non scenda sotto al livello del grezzo (ora considera anche il diametro minimo della testa). +- Fixed : corretto bug in MachiningLib -> AddMachining che contempla il caso in cui Proc non sia una tabella + Versione 2.5g3 (26/07/2023) - Modif : Nei tagli di lama angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default -0.5) - Modif : Nelle fresature di ripresa angoli dei contorni migliorata la scelta della fresa secondaria in caso non sia disponibile una fresa di lunghezza sufficiente. diff --git a/Version.lua b/Version.lua index 2ae764f..25ceeaa 100644 --- a/Version.lua +++ b/Version.lua @@ -1,6 +1,6 @@ --- Version.lua by Egalware s.r.l. 2023/07/04 +-- Version.lua by Egalware s.r.l. 2023/08/01 -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.5g3' +VERSION = '2.5g4' MIN_EXE = '2.5b3'