From f30558db045d4f349d2d63e8484e9d6ee147153f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 7 Nov 2023 09:37:33 +0100 Subject: [PATCH] DataBeam : - migliorie e correzioni alla ricerca di lavorazioni di foratura con AngularTransmission ("_AT") - migliorata gestione dei fori e delle tasche con AngularTransmission. --- LuaLibs/MachiningLib.lua | 9 +++++---- LuaLibs/ProcessDrill.lua | 17 ++++++++++------- LuaLibs/ProcessLapJoint.lua | 22 ++++++++++++++++------ 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index d3322d7..3918710 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1,4 +1,4 @@ --- MachiningLib.lua by Egaltech s.r.l. 2022/05/07 +-- MachiningLib.lua by Egaltech s.r.l. 2023/11/06 -- Libreria ricerca lavorazioni per Travi -- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste. -- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati @@ -7,6 +7,7 @@ -- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile. -- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile. -- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT". +-- 2023/11/06 Migliorie e correzioni alle forature con AngularTransmission ("_AT"). -- Tabella per definizione modulo local MachiningLib = {} @@ -177,7 +178,7 @@ end --------------------------------------------------------------------- function VerifyTool( MachiningType, sType, Params, bH2) if MachiningType == MCH_MY.DRILLING then - if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'Drill_AT') or EgtStartsWith( sType, 'AngleDrill') then + if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'AngleDrill') then return VerifyDrill( Params.Diam, Params.Depth, bH2) elseif EgtStartsWith( sType, 'Pocket') then return VerifyDrillPocket( Params.Diam, Params.Depth, bH2) @@ -382,8 +383,8 @@ end --------------------------------------------------------------------- function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission) local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Drill_AT', 'Drill'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2) - if ( not MachiningName or MachiningName == '') and not bAngleTransmission then - MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Pocket', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead) + if ( not MachiningName or MachiningName == '') then + MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead) end if MachiningName and MachiningName ~= '' then return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index ee0addd..2eb3f9b 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2023/09/26 +-- ProcessDrill.lua by Egaltech s.r.l. 2023/11/06 -- Gestione calcolo forature per Travi -- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile. -- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto. @@ -19,6 +19,7 @@ -- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax. -- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali. -- 2023/09/26 Se errore in applicazione lavorazione si inverte e riprova solo se foratura singola su foro aperto. +-- 2023/11/06 Migliorata gestione dei fori con AngularTransmission. -- Tabella per definizione modulo local ProcessDrill = {} @@ -133,8 +134,9 @@ function ProcessDrill.Split( Proc, b3Raw) -- restituisco se va fatto in doppio (solo fori orizzontali) local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and ( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6)) + local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX())) local bSlant = ( abs( vtExtr:getX()) > BD.DRILL_VX_MAX) - return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and not bSlant) + return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm) and not bSlant) end --------------------------------------------------------------------- @@ -168,17 +170,18 @@ function ProcessDrill.Classify( Proc, b3Raw) end local bOpen = ( Proc.Fce ~= 0) local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and abs( Proc.Flg) == 2))) + local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX())) -- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then if not bOpen then -- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione - if BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreOppositeVectorApprox( vtExtr, Z_AX()) then + if bAngTransm then return true, false, false else return true, true, false end else - return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) + return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) end else return true, false, false @@ -250,9 +253,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- verifico possibilità di foratura da sotto local bDownDrill = ( BD.TURN or ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true))) -- se presente rinvio angolare - local bDrillAngTrasm = ( BD.ANG_TRASM and AreOppositeVectorApprox( vtExtr, Z_AX()) and not bOpen) + local bDrillAngTrasm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreOppositeVectorApprox( vtExtr, Z_AX())) -- verifico che il foro non sia fattibile solo da sotto - local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) and not bDrillAngTrasm + local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill and not bDrillAngTrasm) if bToInvert and ( not bOpen or Proc.Flg ~= 1) then local sErr = 'Error : drilling from bottom impossible' EgtOutLog( sErr) @@ -461,7 +464,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- aggiungo geometria EgtSetMachiningGeometry( {{ AuxId, -1}}) -- eventuale inversione - if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then + if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' then EgtSetMachiningParam( MCH_MP.INVERT, bToInvert) else EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 2bac0b2..c24ff45 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -83,6 +83,7 @@ -- 2023/10/27 In Lapjoint 2 facce con angolo > 90 deg, se forzata fresa, si svuota la faccia principale e si lavora poi la faccia inclinata. -- 2023/11/03 Aggiunta MakeStaircaseStep per lavorazione con fresa + lama di gradini scala. Smusso opzionale. -- 2023/11/06 In MakeStaircaseStep gestito ritorno. +-- 2023/11/06 Migliorie per lavorazione con AngularTransmission con FAST. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -759,10 +760,11 @@ function ProcessLapJoint.Classify( Proc, b3Raw) return false end end - -- se è presente il rinvio angolare ed è una tasca cieca perfettamente verticale, da sotto, non ruoto - if BD.ANG_TRASM and Proc.Fct == 5 then + -- se è presente il rinvio angolare con lavorazioni di tasca ed è una tasca perfettamente verticale da sotto, non ruoto + if BD.ANG_TRASM and Proc.Fct >= 4 and not bClosedOrthoFaces then local vtNBottomFace = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) - if AreOppositeVectorApprox( vtNBottomFace, Z_AX()) then + if AreOppositeVectorApprox( vtNBottomFace, Z_AX()) and + ( Proc.Fct >= 5 and ML.FindPocketing( 'Pocket_AT') or ( Proc.Fct < 5 and ML.FindPocketing( 'OpenPocket_AT'))) then return true, false end end @@ -4857,8 +4859,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa else local bUseOtherFace local bLapJointAngTrasm = false - -- se è presente il rinvio angolare ed è una tasca cieca perfettamente verticale, da sotto - if BD.ANG_TRASM and Proc.Fct == 5 and AreOppositeVectorApprox( vtN, Z_AX()) then + -- se è presente il rinvio angolare ed è una tasca perfettamente verticale, da sotto + if BD.ANG_TRASM and Proc.Fct >= 4 and AreOppositeVectorApprox( vtN, Z_AX()) then bLapJointAngTrasm = true -- se orientata verso il basso e non c'è testa da sotto, verifico l'alternativa elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 then @@ -4918,7 +4920,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342) -- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola) sMchFind = 'Pocket' - if bLapJointAngTrasm then sMchFind = 'Pocket_AT' end local dDiam = min( dH, dV) local bTailOnSide = ( Proc.Box:getMin():getX() - b3Solid:getMin():getX() < 0.1 and not Proc.Tail and not bAllWithEndCap) if ( Proc.Fct == 1) or (( Proc.Fct == 2 or Proc.Fct == 3) and bIsL) or ((( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 4 and not bTailOnSide)) and bSinglePart) then @@ -4968,6 +4969,15 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa nUseRoughTool = 1 end end + -- se abilitato rinvio da sotto + if bLapJointAngTrasm then + if not EgtEndsWith( sMchFind, '_AT') then + sMchFind = sMchFind .. '_AT' + end + if not EgtEndsWith( sMchFindBackUp, '_AT') then + sMchFindBackUp = sMchFindBackUp .. '_AT' + end + end -- se da sotto, imposto massima lunghezza secondo la direzione local dMaxTotLen if bMillDown and BD.GetBottomToolMaxTotLen then