diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index b0c303a..e492b59 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -191,9 +191,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 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 --------------------------------------------------------------------- diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index cd6bf6d..b3be5cc 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -21,6 +21,7 @@ -- 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/06/26 Funzione Is3EdgesApprox spostata in WallLib. +-- 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 = {} @@ -1915,7 +1916,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) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 575aa19..1486626 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -22,6 +22,9 @@ -- 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. +-- 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 = {} @@ -1464,6 +1467,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,6 +1477,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 @@ -1482,6 +1488,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 @@ -1493,8 +1500,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 @@ -1506,7 +1511,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 @@ -1518,7 +1523,18 @@ 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 + -- dimensioni della testa + local dHeadMaxWidth = 250 + 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 end @@ -1869,132 +1885,153 @@ 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)) - -- se lavorazione in doppio aggiungo le rispettive note - if Proc.Double and Proc.Double == 2 then - sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) - sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', Proc.MirrorAx) - sUserNotes = EgtSetValInNotes( sUserNotes, 'DeltaZ', Proc.MirrorDeltaZ) - end - -- 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)) + -- se lavorazione in doppio aggiungo le rispettive note + if Proc.Double and Proc.Double == 2 then + sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) + sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', Proc.MirrorAx) + sUserNotes = EgtSetValInNotes( sUserNotes, 'DeltaZ', Proc.MirrorDeltaZ) + end + -- 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 @@ -2687,8 +2724,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)) + -- 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 @@ -2711,12 +2752,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 72c266c..20713a8 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -637,7 +637,7 @@ function InsertScrapRemoval( nPhase) end nCurrentOperationId = EgtGetNextOperation( nCurrentOperationId) end - EgtSetCurrMachining( nActiveMachiningId) + EgtSetCurrMachining( nActiveMachiningId or GDB_ID.NULL) end ------------------------------------------------------------------------------------------------------------- diff --git a/UpdateLog.txt b/UpdateLog.txt index 6ab83a0..fb66f63 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,16 @@ ==== 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. + +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..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.5g1' +VERSION = '2.5g4' MIN_EXE = '2.5b3'