From 2e2c2188ce282b52b1d743fa1485b7eb739f73a4 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 12 Jul 2024 12:52:53 +0200 Subject: [PATCH 01/18] - gestite lavorazioni singole da fare dopo separazione, tramite restituzione di AddedIds dalle Make - al momento implementato per caso specifico di LongDoubleCut (e Lapjoint riconducibile a LongDoubleCut) --- LuaLibs/BeamExec.lua | 43 +++++++++++++++++++++++++------- LuaLibs/ProcessLapJoint.lua | 4 +-- LuaLibs/ProcessLongDoubleCut.lua | 26 +++++++++++++++++-- 3 files changed, 60 insertions(+), 13 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index af2d211..eed5a0a 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1275,6 +1275,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN local bOk = true local sErr = '' local nNewPhase = -1 + local AddedIds EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1) -- se intestatura ( 1-340-X ) if Hcut.Identify( Proc) then @@ -1300,7 +1301,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN elseif Long2Cut.Identify( Proc) then -- se due facce longitudinali, eseguo doppio taglio longitudinale if Long2Cut.GetLongFacesCount( Proc) == 2 then - bOk, sErr = Long2Cut.Make( Proc, nPhase, nRawId, nPartId) + bOk, sErr, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId) -- altrimenti eseguo singolo taglio longitudinale else bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId) @@ -1318,7 +1319,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN -- o se rivestimento ( 3/4-034-X) o se mezzolegno chalet ( 4-037-X) o se tasca ( 4-039-X) o se taglio triangolato ( 4-120-X) elseif LapJoint.Identify( Proc) then -- esecuzione mezzo-legno o scanalatura - bOk, sErr = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) + bOk, sErr, _, AddedIds = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- se smusso ( 3/4-036-X) elseif Chamfer.Identify( Proc) then -- esecuzione smusso @@ -1423,7 +1424,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN EgtOutLog( sErr) bOk = false end - return bOk, sErr, ( nNewPhase or -1) + return bOk, sErr, ( nNewPhase or -1), AddedIds end ------------------------------------------------------------------------------------------------------------- @@ -2096,7 +2097,8 @@ function BeamExec.ProcessFeatures() -- flag feature precedente in doppio local nPrevDouble = 0 -- inserisco le lavorazioni da lavorare ribaltate - for i = 1, #vProc do + local i = 1 + while i <= #vProc do -- creo la lavorazione local Proc = vProc[i] if Proc.Flg ~= 0 and Proc.Down then @@ -2107,7 +2109,13 @@ function BeamExec.ProcessFeatures() Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase) Proc.PrevDouble = nPrevDouble nPrevDouble = Proc.Double - local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + -- lavorazioni da fare dopo separazione + if AddedIds and #AddedIds > 0 then + for j = 1, #AddedIds do + table.insert( vProc, AddedIds[j]) + end + end if not bOk then nTotErr = nTotErr + 1 table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId}) @@ -2137,6 +2145,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ROT', -2) end end + i = i + 1 end -- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard if not bSplitRot then @@ -2178,7 +2187,8 @@ function BeamExec.ProcessFeatures() local nPrevDouble = 0 -- inserisco le lavorazioni da lavorare ruotate local nSideMchOk = 0 - for i = 1, #vProc do + local i = 1 + while i <= #vProc do -- creo la lavorazione local Proc = vProc[i] if Proc.Flg ~= 0 and Proc.Side then @@ -2189,7 +2199,13 @@ function BeamExec.ProcessFeatures() Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase) Proc.PrevDouble = nPrevDouble nPrevDouble = Proc.Double - local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT) + local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT) + -- lavorazioni da fare dopo separazione + if AddedIds and #AddedIds > 0 then + for j = 1, #AddedIds do + table.insert( vProc, AddedIds[j]) + end + end if not bOk then nTotErr = nTotErr + 1 table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId}) @@ -2222,6 +2238,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ROT', -1) end end + i = i + 1 end -- se non sono state inserite lavorazioni di fianco, elimino la fase perchè inutile e dannosa if nSideMchOk == 0 then @@ -2248,7 +2265,8 @@ function BeamExec.ProcessFeatures() -- flag feature precedente in doppio local nPrevDouble = 0 -- inserisco le lavorazioni non ribaltate della trave - for i = 1, #vProc do + local i = 1 + while i <= #vProc do -- creo la lavorazione local Proc = vProc[i] if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then @@ -2259,7 +2277,13 @@ function BeamExec.ProcessFeatures() Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase) Proc.PrevDouble = nPrevDouble nPrevDouble = Proc.Double - local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + -- lavorazioni da fare dopo separazione + if AddedIds and #AddedIds > 0 then + for j = 1, #AddedIds do + table.insert( vProc, AddedIds[j]) + end + end if not bOk then nTotErr = nTotErr + 1 table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId}) @@ -2287,6 +2311,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ORD', nOrd) end end + i = i + 1 end EgtOutLog( ' *** End AddMachinings ***', 1) -- passo al grezzo successivo diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 2ca42cd..d6acd24 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -7210,13 +7210,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- leggo i parametri Q per utilizzare la fresa di fianco e/o lama local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 local bUseBlade = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1 - local bOk, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) + local bOk, sMyWarn, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) -- se non sono riuscito a farlo di lama, riprovo con la fresa if not bOk and bUseBlade then bUseBlade = false return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) else - return bOk, sMyWarn + return bOk, sMyWarn, nil, AddedIds end -- prima faccia terminale elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index e6e9934..c16493b 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -37,6 +37,7 @@ EgtOutLog( ' ProcessLongDoubleCut started', 1) -- Dati local BD = require( 'BeamData') local ML = require( 'MachiningLib') +local Topology = require( 'FeatureTopology') local dLimMinPiece = BD.LEN_SHORT_PART or 1000 @@ -324,6 +325,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local nFaceLimit, tFaceLong, ptC, vtN = IdentifyFaces( Proc) local dLen = Proc.Box:getDimX() + -- inizializzazione tabella con eventuali lavorazioni create a posteriori da ritornare al chiamante + local AddedIds = {} + -- recupero lunghezza grezzo totale da info sulla macchinata local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd') local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX() @@ -1269,6 +1273,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end end + if Proc.bMoveAfterSplit then + nC = 1 + dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5) + dEndDist = - ( dToolDiam / 2 + 5) + end if nIni == 2 then dStartDist, dEndDist = dEndDist, dStartDist dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist @@ -1380,6 +1389,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end end + if not Proc.MoveAfterSplit and not bEndFixed and not bConvex then + -- recupero gruppo per geometria addizionale + local nAddGrpId = BL.GetAddGroup( nPartId) + if not nAddGrpId then + local sErr = 'Error : missing AddGroup' + EgtOutLog( sErr) + return false, sErr + end + local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL + local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId, bMoveAfterSplit = true} + Topology.Classify( AddProc, b3Raw) + table.insert( AddedIds, AddProc) + end -- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown else @@ -1822,8 +1844,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end - return true, sWarn -end + return true, sWarn, nil, AddedIds +end --------------------------------------------------------------------- return ProcessLong2Cut From afc4c6aafff812f27b10f88b465fd95c30963460 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 17 Jul 2024 11:46:07 +0200 Subject: [PATCH 02/18] - corretto problema in LongDoubleCut in cui si sbagliava la riduzione di affondamento con lama da sotto - in Lapjoint aggiunta Q_FORCE_CHAINSAW per forzare sega a catena anche in casi in cui ci passerebbe la fresa --- LuaLibs/ProcessLapJoint.lua | 35 ++++++++++++++++++++++++-------- LuaLibs/ProcessLongDoubleCut.lua | 32 ++++++++++++++++------------- 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index d6acd24..6d26ba0 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -141,6 +141,9 @@ local Q_SIDE_ROUGH_TOOL = '' -- i local Q_ANTISPLINT_TYPE = '' -- i local Q_BLADE_ON_ALONG_FACE = '' -- i local Q_MAX_ELEVATION = '' -- d +local Q_SAW_PLUS_CHAIN = '' -- i +local Q_FORCE_CHAINSAW = '' -- i + -- variabile smussi local bMadeChamfer @@ -182,6 +185,7 @@ local function AssignQIdent( Proc) Q_MAX_ELEVATION = 'Q10' Q_STAIRCASE = '' Q_SAW_PLUS_CHAIN = 'Q11' + Q_FORCE_CHAINSAW = 'Q12' if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then Q_FORCE_BLADE = 'Q01' -- i @@ -5731,17 +5735,27 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if nChamfer < 0 then return false, sErrCham end + -- eventuale forzatura sega a catena + local bForceChainsaw = ( EgtGetInfo( Proc.Id, Q_FORCE_CHAINSAW, 'i') or 0) > 0 -- se è un tunnel provo a vedere se è possibile lavorarlo con la svuotatura o con la sega catena if bClosedOrthoFaces then local bTryWithBlades = true + local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace + -- forzata sega a catena + if bForceChainsaw then + -- ottengo le dimensioni del tunnel + dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId) -- lavoro fessura con svuotature (singola o doppia contrapposta) - local sMyMchFind = 'Pocket' - local nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, + else + local sMyMchFind = 'Pocket' + local nOk, sErr + nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces) - if nOk < 0 then - return false, sErr - elseif nOk > 0 then - bTryWithBlades = false + if nOk < 0 then + return false, sErr + elseif nOk > 0 then + bTryWithBlades = false + end end -- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena if bTryWithBlades and nChamfer < 2 then @@ -6232,6 +6246,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if bForceSideMill then sPocketing = nil end + -- se forzata sega a catena + if bForceChainsaw then + sPocketing = nil + end -- leggo parametro Q local nQAntisplintResult = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0 -- se lavorazione fresa come lama disabilito eventuale antischeggia @@ -6453,8 +6471,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) end end - -- in tutti gli altri casi lancio la MakeByPockets (lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo) - else + -- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets + -- lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo + elseif not bForceChainsaw then -- se 2 facce setto i parametri corretti per la MakeByPockets if bForceSideMill and Proc.Fct == 2 then bIs3Faces = false diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index c16493b..93b49f5 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -949,18 +949,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- altrimenti concavo else - -- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. - for k = 1, #vOrd do - if vWidth[vOrd[k]] + BD.CUT_SIC > dMaxDepth then - if not( ProcessLong2Cut.Identify( Proc)) then - return false - else - local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[k]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' - if not sWarn then sWarn = '' end - sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) - end - end - end -- si percorrono i lati alto e basso della faccia for i = 1, nC do -- Posizione braccio portatesta @@ -990,6 +978,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster EgtOutLog( sErr) return false, sErr end + -- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. + local dCheckDepth = 0 + if bCanUseBlade then + dCheckDepth = dMaxDepth + elseif bCanUseUnderBlade then + dCheckDepth = dMaxDepthDn + end + if vWidth[vOrd[j]] + 100 * GEO.EPS_SMALL > dCheckDepth then + if not( ProcessLong2Cut.Identify( Proc)) then + return false + else + local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[j]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dCheckDepth, 1) .. ')' + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + end + end -- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama if nSide <= 0 and bCanUseUnderBlade then if ( vWidth[vOrd[j]] / 2) > dMaxDepthDn then @@ -1003,7 +1007,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local dLioPerp if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90 - local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0) + local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0) -- se la faccia è più grande del massimo materiale lama, allora limito lavorazione if dMinOffsBigFace > 0 then dOffset = dMinOffsBigFace @@ -1015,7 +1019,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC else -- il secondo ridotto della distanza minima e della componente spessore della lama - local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0) + local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0) -- se la faccia è più grande del massimo materiale lama, allora limito lavorazione if dMinOffsBigFace > 0 then dOffset = dMinOffsBigFace From d0cf5887d3304226c4ea64523e9d26779a155206 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 17 Jul 2024 12:28:21 +0200 Subject: [PATCH 03/18] =?UTF-8?q?-in=20LongCut=20invertito=20senso=20di=20?= =?UTF-8?q?rotazione=20truciolatore=20(ora=20=C3=A8=20in=20discordanza)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLongCut.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 13875c6..a7ee835 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1391,7 +1391,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, 0}}) -- inverto se utensile antiorario per garantire senso di percorrenza migliore - local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 + local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) > 0 -- setto workside e eventuale inversione if bInvert then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) From cde5b137ae0f9a00284a35b9c62bd7ed1dd9acd4 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 17 Jul 2024 15:24:10 +0200 Subject: [PATCH 04/18] update log e versione per 2.6g3 --- UpdateLog.txt | 5 +++++ Version.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index ad1f666..a993f19 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,10 @@ ==== Beam Update Log ==== +Versione 2.6g3 (07/07/2024) +- Added : aggiunta possibilità di funzione GetNzLimDownUp specifica per ogni macchina +- Modif : anche nel taglio a cubetti si chiama GetNzLimDownUp di macchina, se presente, per decidere limite orientamento lama verso il basso +- Modif : in BeamExec inserito controllo massimo numero di facce per lanciare GetFacetsInfo +- Fixed : in LapJoint corretto typo in nome variabile che provocava mancata impostazione asse bloccato Versione 2.6g2 (04/07/2024) - Modif : le lavorazioni BlockHaus, se vicine alla coda, vengono spostate dopo il taglio di separazione diff --git a/Version.lua b/Version.lua index 653c3c4..bd283c8 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.6g2' +VERSION = '2.6g3' MIN_EXE = '2.6e2' From 028688b88a9278531b9bbd35a374bdf7e8b0da9d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 17 Jul 2024 16:06:26 +0200 Subject: [PATCH 05/18] - in SawPlusChain con tunnel passante fatto da un solo lato, se apply della sega a catena fallisce per finecorsa, si riapplica dal lato opposto --- LuaLibs/ProcessLapJoint.lua | 43 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 6d26ba0..63feadd 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5110,22 +5110,29 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw) local nErr nErr, sErr = EgtGetLastMachMgrError() -- se mortasatura e l'errore è compatibile (Axes values not calculable) si prova con l'altra configurazione dell'asse bloccato - -- TODO valutare se c'è modo di capire preventivamente la configurazione dell'asse bloccato e quindi rimuovere questa parte di codice - if Machining.Type == MCH_OY.MORTISING and nErr == 2507 then - if Machining.BlockedAxis.Orientation == 'perpendicular' then - Machining.BlockedAxis.Orientation = 'parallel' - else - Machining.BlockedAxis.Orientation = 'perpendicular' + if Machining.Type == MCH_OY.MORTISING then + -- se errore "Axes values not calculable" si prova con l'altra configurazione dell'asse bloccato + if nErr == 2507 then + if Machining.BlockedAxis.Orientation == 'perpendicular' then + Machining.BlockedAxis.Orientation = 'parallel' + else + Machining.BlockedAxis.Orientation = 'perpendicular' + end + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut)) + if Machining.SuggestedAngles.Index == 1 then + Machining.SuggestedAngles.Index = 2 + else + Machining.SuggestedAngles.Index = 1 + end + EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index)) + sErr = '' + bIsApplyOk = ML.ApplyMachining( true, false) + -- se errore "Outstroke" e permesso ToolInvert provo ad invertire il lato di lavorazione + elseif Machining.AllowToolInvert and nErr == 2508 then + EgtSetMachiningParam( MCH_MP.TOOLINVERT, not Machining.ToolInvert) + sErr = '' + bIsApplyOk = ML.ApplyMachining( true, false) end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut)) - if Machining.SuggestedAngles.Index == 1 then - Machining.SuggestedAngles.Index = 2 - else - Machining.SuggestedAngles.Index = 1 - end - EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index)) - sErr = '' - bIsApplyOk = ML.ApplyMachining( true, false) end if not bIsApplyOk then nErr, sErr = EgtGetLastMachMgrError() @@ -5334,6 +5341,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.CanApply = true Mortising.Message = '' Mortising.ProcId = Proc.Id + Mortising.AllowToolInvert = false local bNeedToMachineOtherSide = false local dTestCornerRadius = 43 -- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend @@ -5382,6 +5390,11 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.Type = MCH_OY.MORTISING Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name) + -- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke) + if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then + Mortising.AllowToolInvert = true + end + -- verifica dimensioni tasca compatibili -- se tasca meno spessa della sega a catena la strategia non è applicabile if Mortising.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then From adf465c5e2b9dc0883cb39ac7ae5f7ecc53784c1 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 18 Jul 2024 18:41:09 +0200 Subject: [PATCH 06/18] =?UTF-8?q?-in=20SawPlusChain=20non=20non=20si=20app?= =?UTF-8?q?licano=20lavorazioni=20con=20lama=20da=20sotto=20(lama=20da=20s?= =?UTF-8?q?otto=20al=20momento=20non=20gestita)=20-in=20SawPlusChain=20ora?= =?UTF-8?q?=20se=20una=20lavorazione=20non=20=C3=A8=20applicabile=20si=20p?= =?UTF-8?q?rosegue=20con=20le=20altre=20invece=20di=20uscire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 55 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 63feadd..697ff84 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5189,18 +5189,16 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found' Cutting.CanApply = false EgtOutLog( Cutting.Message) - return Cutting end Cutting.Type = MCH_OY.MILLING Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name) - -- verifica dimensioni tasca compatibili + -- verifica dimensioni tasca e direzione compatibili -- se tasca meno spessa della lama la strategia non è applicabile if Cutting.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade thickness' Cutting.CanApply = false EgtOutLog( Cutting.Message) - return Cutting end if #( Proc.MainFaces.SideFaces) > 1 then -- se tasca più stretta della lama la strategia non è applicabile @@ -5208,9 +5206,13 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade diameter' Cutting.CanApply = false EgtOutLog( Cutting.Message) - return Cutting end end + if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then + Cutting.CanApply = false + Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom' + EgtOutLog( Cutting.Message) + end -- parametri della lavorazione -- inizio e fine aperti o chiusi @@ -5385,7 +5387,6 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - chainsaw not found' Mortising.CanApply = false EgtOutLog( Mortising.Message) - return Mortising end Mortising.Type = MCH_OY.MORTISING Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name) @@ -5401,7 +5402,6 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw thickness' Mortising.CanApply = false EgtOutLog( Mortising.Message) - return Mortising end if #( Proc.MainFaces.SideFaces) > 1 then -- se tasca più stretta della sega a catena la strategia non è applicabile @@ -5409,7 +5409,6 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw width' Mortising.CanApply = false EgtOutLog( Mortising.Message) - return Mortising end end @@ -5568,9 +5567,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) local bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end local dBottomDepthToMachine = Cutting.RadialOffset -- lato opposto del tunnel @@ -5579,9 +5578,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end else -- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato @@ -5592,9 +5591,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end end -- eventuale lavorazione di lama - lato della tasca in cui finisce la lavorazione @@ -5603,9 +5602,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end end -- la lama è arrivata sul fondo e tasca passante, non servono ulteriori lavorazioni @@ -5639,9 +5638,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsMortisingOk = false if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) - end - if not bIsMortisingOk then - return bIsMortisingOk, Mortising.Message + if not bIsMortisingOk then + return bIsMortisingOk, Mortising.Message + end end else -- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato @@ -5652,9 +5651,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsMortisingOk = false if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) - end - if not bIsMortisingOk then - return bIsMortisingOk, Mortising.Message + if not bIsMortisingOk then + return bIsMortisingOk, Mortising.Message + end end end -- eventuale lavorazione di sega a catena - lato della tasca in cui finisce la lavorazione @@ -5663,9 +5662,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsMortisingOk = false if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) - end - if not bIsMortisingOk then - return bIsMortisingOk, Mortising.Message + if not bIsMortisingOk then + return bIsMortisingOk, Mortising.Message + end end end end From 9d3edbfb54045c4316d2e9bc2e0b82cafd49d3b2 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 19 Jul 2024 16:08:18 +0200 Subject: [PATCH 07/18] - in BatchProcessNew bToRecalc forzato se flasg 3 o 4 - in ProcessLapJoint si evita di tentare di lavorare con sega a catena da sotto --- BatchProcessNew.lua | 2 +- LuaLibs/ProcessLapJoint.lua | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 3d32ed0..7496722 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -562,7 +562,7 @@ else -- Passo in modalità lavora EgtSetCurrMachGroup( EgtGetLastMachGroup()) -- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni - if bToRecalc then + if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>') EgtImportSetup() EgtApplyAllMachinings() diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 697ff84..6a5921e 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5411,6 +5411,11 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine EgtOutLog( Mortising.Message) end end + if EdgeToMachine.ToolDirection:getZ() < - 10 * GEO.EPS_ANG_SMALL then + Mortising.CanApply = false + Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : skipped chainsaw from bottom' + EgtOutLog( Mortising.Message) + end -- parametri della lavorazione -- inizio e fine aperti o chiusi From 5047d5b6520ba02ab8fc57737dcc34919f745511 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 5 Aug 2024 09:24:14 +0200 Subject: [PATCH 08/18] In SimpleSarf, se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda --- LuaLibs/ProcessSimpleScarf.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessSimpleScarf.lua b/LuaLibs/ProcessSimpleScarf.lua index 49aab92..9a24b7f 100644 --- a/LuaLibs/ProcessSimpleScarf.lua +++ b/LuaLibs/ProcessSimpleScarf.lua @@ -4,6 +4,7 @@ -- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut. -- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour. -- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo. +-- 2024/08/05 Se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda -- Tabella per definizione modulo local ProcessSimpleScarf = {} @@ -148,7 +149,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT -- se ci sono meno di due facce si riduce a una normale Cut local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) if nFacetCnt < 2 then - local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail) + local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail, true) return bOk, sErr end -- dati delle facce From 4961d2d528f60826de554452c079aa74a4973a77 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 6 Aug 2024 15:25:37 +0200 Subject: [PATCH 09/18] - in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4 --- LuaLibs/ProcessLapJoint.lua | 54 +++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 6a5921e..3589adb 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -2551,7 +2551,7 @@ end --------------------------------------------------------------------- local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham) - -- Se variabile globale indica che lo smusso è gi stato fatto, esco + -- Se variabile globale indica che lo smusso è già stato fatto, esco if bMadeChamfer then return 0 end @@ -2565,6 +2565,7 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI end -- ottengo le curve di contorno libero local nAuxId1, nAuxId2, nNumIdAux + local bIsOpenPath = false if bIs3Faces then -- estraggo i percorsi nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) @@ -2575,6 +2576,36 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI else nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) if not nNumIdAux then nNumIdAux = 0 end + -- se non è una curva chiusa bisogna estrarre le sole curve da lavorare + if Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then + local IdsToMachine = {} + bIsOpenPath = true + local nFirstId, nIdCount = EgtExplodeCurveCompo( nAuxId1) + for i = nFirstId, nFirstId + nIdCount - 1, 1 do + -- se segmento di retta + if EgtGetType( i) == GDB_TY.CRV_LINE then + local _, nEntitiesCount = EgtCurveDomain(i) + for j = 0, nEntitiesCount - 1 do + local ptStart = EgtUP( i, j, GDB_RT.GLOB) + local ptEnd = EgtUP( i, j + 1, GDB_RT.GLOB) + if ( AreSameVectorApprox( vtOrtho, X_AX()) and ( abs( ptStart:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, -X_AX()) and ( abs( ptStart:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, -Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, -Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) + ) then + table.insert( IdsToMachine, i) + end + end + else + return 0 + end + end + local ptNear = EgtSurfTmFacetCenter(Proc.Id, 0, GDB_ID.ROOT) + nAuxId1 = EgtCurveCompoByReorder( nAddGrpId, IdsToMachine, ptNear, true, GDB_ID.ROOT) + nNumIdAux = 1 + end end local dExtra = 2 @@ -2594,13 +2625,20 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI end else AuxId = nAuxId1 + i - 1 - vtExtr, _, _ = EgtCurveArea( AuxId) - end - if vtExtr then - if not bIs3Faces then + if bIsOpenPath then + _, vtExtr = EgtCurveIsFlat( AuxId) + else + vtExtr, _, _ = EgtCurveArea( AuxId) + end + if vtExtr then local fFrCurve = EgtGetGlobFrame( AuxId) vtExtr:toGlob( fFrCurve) + if bIsOpenPath and vtExtr * vtOrtho < GEO.EPS_SMALL then + vtExtr = -vtExtr + end end + end + if vtExtr then -- if bIs3Faces and i == nNumIdAux then -- vtExtr = -vtExtr -- end @@ -2844,6 +2882,12 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, local nOk, sErr = MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham) if nOk < 0 then return false, sErr end end + -- slot aperta su due lati + elseif Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then + if nChamfer > 0 then + local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, rfFac:getVersZ(), b3Solid, nil, dDepthCham) + if nOk < 0 then return false, sErr end + end end if not dDepth then dDepth = dElev end -- Recupero le facce adiacenti alla principale From 94159f88f31094cd2a5b2970fededb061eddd209 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 7 Aug 2024 16:11:38 +0200 Subject: [PATCH 10/18] - in FacesBySaw.MakeOne se si ha outstroke si tenta attacco alternativo --- LuaLibs/FacesBySaw.lua | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 5978ec1..908d1bb 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -402,7 +402,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw dLoPerp = BD.COLL_SIC else bLioTang = true - dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp + dLiTang, dLi2Tang = dLi2Tang, dLiTang + dLiPerp, dLi2Perp = dLi2Perp, dLiPerp + dLoTang, dLo2Tang = dLo2Tang, dLoTang + dLoPerp, dLo2Perp = dLo2Perp, dLoPerp end end -- posizione braccio @@ -487,7 +490,23 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- eventuali note if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end -- eseguo - if not ML.ApplyMachining( true, false) then + local bIsApplyOk = ML.ApplyMachining( true, false) + if not bIsApplyOk then + local nErr = EgtGetLastMachMgrError() + -- se errore outstroke (2318) provo a invertire il tipo di attacco (perpendicolare o tangenziale) + if nErr == 2318 then + dLiTang, dLi2Tang = dLi2Tang, dLiTang + dLiPerp, dLi2Perp = dLi2Perp, dLiPerp + dLoTang, dLo2Tang = dLo2Tang, dLoTang + dLoPerp, dLo2Perp = dLo2Perp, dLoPerp + EgtSetMachiningParam( MCH_MP.LITANG, dLiTang) + EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp) + EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang) + EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) + bIsApplyOk = ML.ApplyMachining( true, false) + end + end + if not bIsApplyOk then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) return false, sErr From fc0fba5bd3cdd42e288aafee817e7fa2324344c7 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 7 Aug 2024 17:45:38 +0200 Subject: [PATCH 11/18] - in FacesBySaw revert delle modifiche precedenti per problemi di chiusura rulli --- LuaLibs/FacesBySaw.lua | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 908d1bb..5978ec1 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -402,10 +402,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw dLoPerp = BD.COLL_SIC else bLioTang = true - dLiTang, dLi2Tang = dLi2Tang, dLiTang - dLiPerp, dLi2Perp = dLi2Perp, dLiPerp - dLoTang, dLo2Tang = dLo2Tang, dLoTang - dLoPerp, dLo2Perp = dLo2Perp, dLoPerp + dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp end end -- posizione braccio @@ -490,23 +487,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- eventuali note if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end -- eseguo - local bIsApplyOk = ML.ApplyMachining( true, false) - if not bIsApplyOk then - local nErr = EgtGetLastMachMgrError() - -- se errore outstroke (2318) provo a invertire il tipo di attacco (perpendicolare o tangenziale) - if nErr == 2318 then - dLiTang, dLi2Tang = dLi2Tang, dLiTang - dLiPerp, dLi2Perp = dLi2Perp, dLiPerp - dLoTang, dLo2Tang = dLo2Tang, dLoTang - dLoPerp, dLo2Perp = dLo2Perp, dLoPerp - EgtSetMachiningParam( MCH_MP.LITANG, dLiTang) - EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp) - EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang) - EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) - bIsApplyOk = ML.ApplyMachining( true, false) - end - end - if not bIsApplyOk then + if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) return false, sErr From 587aaaafce46503dd7f7508b83c79d82d6ec00fe Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 8 Aug 2024 15:20:51 +0200 Subject: [PATCH 12/18] - in FacesBySaw->MakeOne, se attacco tangenziale e cubetti paralleli, si attacca e stacca sempre dallo stesso lato - modificate di conseguenza funzioni significative che generano questi tipi di taglio --- LuaLibs/FacesBySaw.lua | 30 ++++++++++++++++++++++++------ LuaLibs/ProcessBlockHausFront.lua | 3 ++- LuaLibs/ProcessCut.lua | 12 ++++++++---- LuaLibs/ProcessDovetail.lua | 3 ++- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 5978ec1..95b5981 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) +function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bIsDicingHorizontalCut) -- 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 @@ -330,8 +330,22 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box) local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp) local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp) + local dLiCompLength = 0 -- attacco tangente - local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box) + local dLi2Tang = 0 + local dLi2Perp = 0 + local dLo2Tang = 0 + local dLo2Perp = 0 + local dLi2CompLength = 0 + + if bIsDicingHorizontalCut and not bIsBiLinea then + dLi2Tang = 0 + dLi2Perp = BD.MAX_DIM_DICE + BD.CUT_EXTRA + dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC + dLo2Tang = dSawDiam / 2 + else + dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box) + end local dLenLi2 = abs( dLi2Tang) local dLenLo2 = abs( dLo2Tang) @@ -402,7 +416,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw dLoPerp = BD.COLL_SIC else bLioTang = true - dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp + dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength end end -- posizione braccio @@ -475,6 +489,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw if BD.TURN and bLioTang == 1 then EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TG_PERP) end EgtSetMachiningParam( MCH_MP.LITANG, dLiTang) EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp) + EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength) if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang) EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) @@ -624,7 +639,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd]) -- lavoro la faccia for j = 1, #vCuts[i] do - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end @@ -684,14 +700,16 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, end -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i][j] then - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end end -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i+1][j] then - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( ( i + 1) % 2 == 0) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessBlockHausFront.lua b/LuaLibs/ProcessBlockHausFront.lua index 1a1cc32..3a3a3cc 100644 --- a/LuaLibs/ProcessBlockHausFront.lua +++ b/LuaLibs/ProcessBlockHausFront.lua @@ -219,7 +219,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO else dExtraTrim = dMiddleExtraTrim end - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index d34c9eb..3017085 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -548,7 +548,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b dVzLimDwnUp = -0.708 end end - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end end -- tutti gli altri casi vengono saltati @@ -575,7 +576,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end end end @@ -757,14 +759,16 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead) end -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i][j] then - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nli, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end end -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i+1][j] then - local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end end end diff --git a/LuaLibs/ProcessDovetail.lua b/LuaLibs/ProcessDovetail.lua index 17574e8..e82c676 100644 --- a/LuaLibs/ProcessDovetail.lua +++ b/LuaLibs/ProcessDovetail.lua @@ -533,7 +533,8 @@ local function MakeCutsByDice( Proc, b3Raw, vCuts, bHead, vtRef, dFinalExtraTrim else dExtraTrim = dMiddleExtraTrim end - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -( dTrim + dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bIsDicingHorizontalCut = ( i % 2 == 0) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -( dTrim + dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) if not bOk then return bOk, sErr end From 749cd1e2bb86e7a32c2a99ec1972601ed2b70d1f Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 9 Aug 2024 12:00:20 +0200 Subject: [PATCH 13/18] - in FacesBySaw limiti alle normali se attacco tangenziale dallo stesso lato --- LuaLibs/FacesBySaw.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 95b5981..c456778 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -338,7 +338,9 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw local dLo2Perp = 0 local dLi2CompLength = 0 - if bIsDicingHorizontalCut and not bIsBiLinea then + -- 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 + -- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi + if bIsDicingHorizontalCut and not bIsBiLinea and ( abs( vtN:getX()) < 0.707) and ( abs( vtTg:getX()) < 0.1736) then dLi2Tang = 0 dLi2Perp = BD.MAX_DIM_DICE + BD.CUT_EXTRA dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC From fa5aac926ef7e48f8e03fcca4cbef08da20aba43 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 9 Aug 2024 12:02:27 +0200 Subject: [PATCH 14/18] =?UTF-8?q?-=20attacchi=20=20tangenziali=20solo=20da?= =?UTF-8?q?=20un=20lato=20lasciati=20solo=20per=20se=20FacesBySaw=20=C3=A8?= =?UTF-8?q?=20chiamata=20da=20ProcessCut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessBlockHausFront.lua | 3 +-- LuaLibs/ProcessDovetail.lua | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/LuaLibs/ProcessBlockHausFront.lua b/LuaLibs/ProcessBlockHausFront.lua index 3a3a3cc..1a1cc32 100644 --- a/LuaLibs/ProcessBlockHausFront.lua +++ b/LuaLibs/ProcessBlockHausFront.lua @@ -219,8 +219,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO else dExtraTrim = dMiddleExtraTrim end - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessDovetail.lua b/LuaLibs/ProcessDovetail.lua index e82c676..17574e8 100644 --- a/LuaLibs/ProcessDovetail.lua +++ b/LuaLibs/ProcessDovetail.lua @@ -533,8 +533,7 @@ local function MakeCutsByDice( Proc, b3Raw, vCuts, bHead, vtRef, dFinalExtraTrim else dExtraTrim = dMiddleExtraTrim end - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -( dTrim + dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -( dTrim + dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) if not bOk then return bOk, sErr end From f8c40739da32b4689dedcf2942ae71305b49aa62 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 19 Aug 2024 17:37:16 +0200 Subject: [PATCH 15/18] - in attacchi tangenziali solo da un lato alcune correzioni - aggiunta la raccolta delle Affected Faces a tutti i casi in cui si crea una feature a posteriori (non presente nel btl) --- LuaLibs/FacesBySaw.lua | 16 ++++++++-------- LuaLibs/ProcessBlockHausFront.lua | 6 ++++-- LuaLibs/ProcessCut.lua | 16 ++++++++-------- LuaLibs/ProcessDoubleCut.lua | 6 ++++-- LuaLibs/ProcessDovetail.lua | 3 ++- LuaLibs/ProcessDtMortise.lua | 3 ++- LuaLibs/ProcessDtTenon.lua | 3 ++- LuaLibs/ProcessLapJoint.lua | 3 ++- LuaLibs/ProcessMortise.lua | 3 ++- LuaLibs/ProcessProfCamb.lua | 3 ++- LuaLibs/ProcessProfConcave.lua | 3 ++- LuaLibs/ProcessProfConvex.lua | 3 ++- LuaLibs/ProcessProfFront.lua | 3 ++- LuaLibs/ProcessProfHead.lua | 3 ++- LuaLibs/ProcessRidgeLap.lua | 3 ++- LuaLibs/ProcessStepJoint.lua | 9 ++++++--- LuaLibs/ProcessTenon.lua | 3 ++- LuaLibs/ProcessTyroleanDovetail.lua | 6 ++++-- 18 files changed, 58 insertions(+), 37 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index c456778..514bf5b 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, bIsDicingHorizontalCut) +function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut) -- 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 @@ -340,7 +340,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- 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 -- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi - if bIsDicingHorizontalCut and not bIsBiLinea and ( abs( vtN:getX()) < 0.707) and ( abs( vtTg:getX()) < 0.1736) then + if bSpecialTangentLeadInOut and not bIsBiLinea and ( abs( vtN:getX()) < 0.5) and ( abs( vtTg:getX()) < 0.1736) then dLi2Tang = 0 dLi2Perp = BD.MAX_DIM_DICE + BD.CUT_EXTRA dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC @@ -641,8 +641,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd]) -- lavoro la faccia for j = 1, #vCuts[i] do - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end @@ -702,16 +702,16 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, end -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i][j] then - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i+1][j] then - local bIsDicingHorizontalCut = ( ( i + 1) % 2 == 0) - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bSpecialTangentLeadInOut = ( ( i + 1) % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessBlockHausFront.lua b/LuaLibs/ProcessBlockHausFront.lua index 1a1cc32..0d97ac5 100644 --- a/LuaLibs/ProcessBlockHausFront.lua +++ b/LuaLibs/ProcessBlockHausFront.lua @@ -151,7 +151,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then @@ -242,7 +243,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 3017085..9a9af10 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -548,8 +548,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b dVzLimDwnUp = -0.708 end end - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end -- tutti gli altri casi vengono saltati @@ -576,8 +576,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bIsDicingHorizontalCut) + 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) if not bOk then return bOk, sErr end end end @@ -759,16 +759,16 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead) end -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i][j] then - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nli, nil, bIsDicingHorizontalCut) + 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_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i+1][j] then - local bIsDicingHorizontalCut = ( i % 2 == 0) - local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bIsDicingHorizontalCut) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end end diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index 39981b4..6635955 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -521,7 +521,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true) if not bOk then return bOk, sErr end end @@ -533,7 +534,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessDovetail.lua b/LuaLibs/ProcessDovetail.lua index 17574e8..49546f5 100644 --- a/LuaLibs/ProcessDovetail.lua +++ b/LuaLibs/ProcessDovetail.lua @@ -1433,7 +1433,8 @@ local function MakeAuxCut( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol return true end -- inserisco la lavorazione - local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail} + local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end -- imposto la nota nel gruppo aggiuntivo di lavorazione per evitare di tagliare una seconda volta diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 870af05..d15c819 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -210,7 +210,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index a9123bc..e8f3686 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -207,7 +207,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 3589adb..6a93761 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1191,7 +1191,8 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, nCha EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local nCutFacet = EgtSurfTmFacetCount( AddId) if nCutFacet == 1 then return Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index db80299..527173b 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -417,7 +417,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index 39bcb6b..831cbbb 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -307,7 +307,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index 4eb7029..58a9c56 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -311,7 +311,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index 5988c77..fa5d0ad 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -311,7 +311,8 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfFront.lua b/LuaLibs/ProcessProfFront.lua index 4c09578..997e01a 100644 --- a/LuaLibs/ProcessProfFront.lua +++ b/LuaLibs/ProcessProfFront.lua @@ -258,7 +258,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index 5b685a8..3cdfbf8 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -293,7 +293,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessRidgeLap.lua b/LuaLibs/ProcessRidgeLap.lua index 4d57e48..b1f4c67 100644 --- a/LuaLibs/ProcessRidgeLap.lua +++ b/LuaLibs/ProcessRidgeLap.lua @@ -134,7 +134,8 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- applico taglio di lama local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessStepJoint.lua b/LuaLibs/ProcessStepJoint.lua index fd267f9..88c0780 100644 --- a/LuaLibs/ProcessStepJoint.lua +++ b/LuaLibs/ProcessStepJoint.lua @@ -212,7 +212,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end end @@ -223,7 +224,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end end @@ -392,7 +394,8 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 696be04..3ea367e 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -200,7 +200,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) else local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( bShortPart and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) if not bOk then diff --git a/LuaLibs/ProcessTyroleanDovetail.lua b/LuaLibs/ProcessTyroleanDovetail.lua index b8d00ce..03f2917 100644 --- a/LuaLibs/ProcessTyroleanDovetail.lua +++ b/LuaLibs/ProcessTyroleanDovetail.lua @@ -232,7 +232,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then @@ -330,7 +331,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then From ebe3d79c11c8cc9c977fd91b8fd2702c7e50c355 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 20 Aug 2024 17:02:37 +0200 Subject: [PATCH 16/18] - in FacesBySaw attacchi tangenziali solo da un lato limitati a facce con basse componenti Y - in split e headcut i tagli addizionali orizzontali o verticali, se la macchina ha i ruli, si fanno sempre con attacco tangenziale --- LuaLibs/FacesBySaw.lua | 12 +++++++----- LuaLibs/ProcessHeadCut.lua | 6 ++++-- LuaLibs/ProcessSplit.lua | 6 ++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 514bf5b..ead6a40 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -45,7 +45,7 @@ local BD = require( 'BeamData') local ML = require( 'MachiningLib') --------------------------------------------------------------------- -function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert) +function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut) EgtOutLog( 'FacesBySaw.MakeParallelOne', 3) -- dati della faccia local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT) @@ -76,7 +76,7 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD local bLioTang local Ktp = 1.1 if BD.KIOTP then Ktp = BD.KIOTP end - if Ktp * dLi2Tang < dLiPerp then + if bForceTangentLeadInOut or ( Ktp * dLi2Tang < dLiPerp) then bLioTang = true dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp if BD.TURN then @@ -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) +function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut) -- 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 @@ -200,7 +200,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw Par5 == MCH_MILL_FU.PARAL_BACK or Par5 == MCH_MILL_FU.PARAL_LEFT or Par5 == MCH_MILL_FU.PARAL_RIGHT) then - return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert) + return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut) end -- la lama ha asse perpendicolare alla faccia EgtOutLog( 'FacesBySaw.MakeOne', 3) @@ -339,8 +339,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw 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 + -- 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) then + -- + 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 dLi2Tang = 0 dLi2Perp = BD.MAX_DIM_DICE + BD.CUT_EXTRA dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 12ccc6d..31f4069 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -173,7 +173,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw ) for j = nVerticalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_FRONT local dVerticalCutOffset = dVerticalSliceHeight * -j - bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return bOk, sErr end end return bOk, sErr @@ -359,7 +360,8 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut for j = nHorizontalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_DOWN local dHorizontalCutOffset = dHorizontalSliceHeight * -j - local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return bOk, sErr end end -- se necessario taglio verticale doppio, eseguo l'opposto diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 1493b6b..829f68c 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -272,7 +272,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes) for j = nVerticalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_FRONT local dVerticalCutOffset = dVerticalSliceHeight * -j - bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return bOk, sErr end end return bOk, sErr @@ -607,7 +608,8 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt for j = nHorizontalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_DOWN local dHorizontalCutOffset = dHorizontalSliceHeight * -j - local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return false, sErr end end -- se necessario taglio verticale doppio, eseguo l'opposto From ffaf33c62eebd552810972d023e45e3e19682822 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 20 Aug 2024 17:34:46 +0200 Subject: [PATCH 17/18] =?UTF-8?q?in=20BatchProcessNew=20se=20flag=20apposi?= =?UTF-8?q?to=20in=20Cam5=20la=20generazione=20=C3=A8=20disabilitata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BatchProcessNew.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 7496722..1cfee79 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -626,7 +626,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 = ( EgtGetNumberFromIni( 'Mach', 'NoPartProgram', 0, EgtGetIniFile()) == 0) +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 From 9de88ffe84b4d633e9fc2fc9875b9d38406b3bdb Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 20 Aug 2024 17:45:00 +0200 Subject: [PATCH 18/18] update log e version --- UpdateLog.txt | 8 +++++++- Version.lua | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index b8842c2..269b197 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,6 +1,12 @@ ==== Beam Update Log ==== -Versione 2.6g4 (2024/07/19) +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 +- Modif : varie modifiche ai tagli di lama per evitare chiusura rulli pneumatici e finecorsa +- Modif : in BatchProcessNew, se presente flag apposito in EgtCam5, si evita la generazione + +Versione 2.6g4 (19/07/2024) - Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE Versione 2.6g3 (07/07/2024) diff --git a/Version.lua b/Version.lua index 83e67a1..0772dd6 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.6g4' +VERSION = '2.6h1' MIN_EXE = '2.6e2'