From ec65b6cf769c3e32a154c0cb15fc9e0b946bbd29 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 4 Sep 2020 07:21:20 +0000 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20Chamfer=20corretta=20gi?= =?UTF-8?q?unzione=20tra=20lavorazioni=20successive=20per=20feature=20lung?= =?UTF-8?q?a=20-=20in=20FreeContour=20e=20RoundArch=20aggiunta=20gestione?= =?UTF-8?q?=20forzatura=20codolo=20centrale=20anzich=C3=A8=20laterale=20-?= =?UTF-8?q?=20in=20LapJoint=20migliorata=20gestione=20lama=20con=20fessura?= =?UTF-8?q?=20e=20corretta=20gestione=20lato=20asseC=20per=20antischeggia?= =?UTF-8?q?=20con=20lama=20invertiti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessChamfer.lua | 15 +++-- LuaLibs/ProcessFreeContour.lua | 22 ++++-- LuaLibs/ProcessLapJoint.lua | 119 +++++++++++++++++++++++++-------- LuaLibs/ProcessRoundArch.lua | 22 ++++-- 4 files changed, 130 insertions(+), 48 deletions(-) diff --git a/LuaLibs/ProcessChamfer.lua b/LuaLibs/ProcessChamfer.lua index 98adaa1..3540250 100644 --- a/LuaLibs/ProcessChamfer.lua +++ b/LuaLibs/ProcessChamfer.lua @@ -1,4 +1,4 @@ --- ProcessChamfer.lua by Egaltech s.r.l. 2020/06/09 +-- ProcessChamfer.lua by Egaltech s.r.l. 2020/09/01 -- Gestione calcolo profilo libero per Travi -- Tabella per definizione modulo @@ -80,11 +80,11 @@ function ProcessChamfer.Make( Proc, nPhase, nRawId, nPartId) EgtSetOperationMode( nMchId, false) return false, sErr end - -- altrimenti smusso standard else -- normale ed elevazione della faccia principale local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) + local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT) local _, dElev = BL.GetPointDirDepth( nPartId, ptC, vtN) local bFront = ( vtN:getY() < 0) -- limitazioni su inizio e fine derivanti da altre facce @@ -119,6 +119,9 @@ function ProcessChamfer.Make( Proc, nPhase, nRawId, nPartId) end -- determino numero di parti local dLen = Proc.Box:getDimX() + -- calcolo la differenza tra lunghezza faccia 0 e lunghezza feature + -- per far corrispondere i punti di inizio-fine delle lavorazioni multiple (a passi) + local dAddLen = (( dH - dLen) / EgtIf( bLimXmax and bLimXmin , 2, 1)) local dStartAccDist = BD.LONGCUT_ENDLEN local dEndAccDist = BD.LONGCUT_ENDLEN local nC = ceil( ( dLen - dStartAccDist - dEndAccDist) / BD.LONGCUT_MAXLEN) @@ -157,11 +160,11 @@ function ProcessChamfer.Make( Proc, nPhase, nRawId, nPartId) -- imposto attacchi e uscite local dSal, dEal if bFront then - dSal = EgtIf( i == 1, dStartAll, -( i - 1) * dC) - dEal = EgtIf( i == nC, dEndAll, -( nC - i) * dC) + dSal = EgtIf( i == 1, dStartAll, -( i - 1) * dC - dAddLen + 0.5) + dEal = EgtIf( i == nC, dEndAll, -( nC - i) * dC - dAddLen + 0.5) else - dSal = EgtIf( i == nC, dStartAll, -( nC - i) * dC) - dEal = EgtIf( i == 1, dEndAll, -( i - 1) * dC) + dSal = EgtIf( i == nC, dStartAll, -( nC - i) * dC - dAddLen + 0.5) + dEal = EgtIf( i == 1, dEndAll, -( i - 1) * dC - dAddLen + 0.5) end EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.LIPERP, dMillDiam / 4) diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 6ba97f5..cbdeabc 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -1,4 +1,4 @@ --- ProcessFreeContour.lua by Egaltech s.r.l. 2020/08/26 +-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/09/03 -- Gestione calcolo profilo libero per Travi -- Tabella per definizione modulo @@ -215,12 +215,20 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) dDepth = dDepth + BD.CUT_EXTRA end end - if dDepth > dMaxDepth then - if bCanDouble then - nDouble = 2 - dDepth = min( 0.5 * dDepth, dMaxDepth) - else - dDepth = dMaxDepth + -- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga + if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and + bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then + nDouble = 2 + dDepth = min( ( b3Raw:getDimY() - BD.DIM_STRIP) * 0.5, dMaxDepth) + else + -- se altezza geometria supera capacità taglio utensile ed è orizzontale setto per eseguire codolo in centro + if dDepth > dMaxDepth then + if bCanDouble then + nDouble = 2 + dDepth = min( 0.5 * dDepth, dMaxDepth) + else + dDepth = dMaxDepth + end end end -- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y- diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 2560094..2ef6294 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/08/28 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/09/03 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -3253,6 +3253,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) sPocketing = sMyPocketing end end + -- se feature 16 e forzata lama e forma ad U, annulla la svuotatura + if Proc.Prc == 16 and bForceUseBlade and Proc.Fct == 3 and bIsU then + sPocketing = nil + end -- se non trova una svuotatura adatta if not sPocketing then -- se forma a L provo con contornatura @@ -3265,35 +3269,86 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) else local bTryWithBlades = true local nOk, bOk, sStat, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces - -- in base al flag interno e al numero di facce e se ha forma ad U: provo prima la svuotatura sul fianco e - -- se non è possibile allora provo in seguito con lama o segacatena - -- o passare subito dalla lavorazione con lama/sega catena - if bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU then - -- lavoro con svuotature (singola o doppia contrapposta) - nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFind, true, b3Solid) - if nOk < 0 then - return false, sErr - elseif nOk > 0 then - bTryWithBlades = false - end - bOk = true - end - -- Se la svuotatura precedente non è stata fatta e smusso non è esclusivo, provo con le lame - if bTryWithBlades and nChamfer < 2 then - bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces, nBottomFace) - if not bOk and sStat == 'MNF' then - sPocketing = ML.FindPocketing( sMchFind, dDiam) - if not sPocketing then - local sErr = 'Error : pocketing not found in library' - EgtOutLog( sErr) - return false, sErr + -- se feature 16 e abilitato il parametro Q01 (=1) provo prima con la lama e poi con la fresa + if Proc.Prc == 16 and bForceUseBlade then + -- Se la svuotatura precedente non è stata fatta e smusso non è esclusivo, provo con le lame + if bTryWithBlades and nChamfer < 2 then + bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces, nBottomFace) + if not bOk then + -- in base al flag interno e al numero di facce e se ha forma ad U: provo prima la svuotatura sul fianco e + -- se non è possibile allora provo in seguito con lama o segacatena + -- o passare subito dalla lavorazione con lama/sega catena + if Proc.Fct == 3 and bIsU then + -- lavoro con svuotature (singola o doppia contrapposta) + nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFind, true, b3Solid) + if nOk < 0 then + return false, sErr + elseif nOk == 0 then + if sStat == 'MNF' then + sPocketing = ML.FindPocketing( sMchFind, dDiam) + if not sPocketing then + local sErr = 'Error : pocketing not found in library' + EgtOutLog( sErr) + return false, sErr + end + else + return bOk, sWarn + end + else + bOk = true + return bOk, sErr + end + else + sPocketing = ML.FindPocketing( sMchFind, dDiam) + if not sPocketing then + local sErr = 'Error : pocketing not found in library' + EgtOutLog( sErr) + return false, sErr + end + end + else + return bOk, sWarn end + else + bOk = true + return bOk, sWarn + end + else + -- in base al flag interno e al numero di facce e se ha forma ad U: provo prima la svuotatura sul fianco e + -- se non è possibile allora provo in seguito con lama o segacatena + -- o passare subito dalla lavorazione con lama/sega catena + if bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU then + -- lavoro con svuotature (singola o doppia contrapposta) + nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFind, true, b3Solid) + if nOk < 0 then + return false, sErr + elseif nOk > 0 then + bTryWithBlades = false + end + bOk = true + end + -- 03/09/2020 da conferma di Fabio Squaratti: Per ora solo sulla feature 016: + -- se ha fallito la fresatura (qua sopra) allora di defalut ( anche se il flag Q della lama è disattivato) prima provo la lama + if Proc.Prc == 16 then + bForceUseBlade = true + end + -- Se la svuotatura precedente non è stata fatta e smusso non è esclusivo, provo con le lame + if bTryWithBlades and nChamfer < 2 then + bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces, nBottomFace) + if not bOk and sStat == 'MNF' then + sPocketing = ML.FindPocketing( sMchFind, dDiam) + if not sPocketing then + local sErr = 'Error : pocketing not found in library' + EgtOutLog( sErr) + return false, sErr + end + else + return bOk, sWarn + end + -- altrimenti ho già svuotato dal fianco, esco else return bOk, sWarn end - -- altrimenti ho già svuotato dal fianco, esco - else - return bOk, sWarn end end else @@ -3371,9 +3426,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) elseif nSCC == MCH_SCC.ADIR_XM then nInvSCC = MCH_SCC.ADIR_XP elseif nSCC == MCH_SCC.ADIR_YP then - nInvSCC = MCH_SCC.ADIR_YM + if abs( vtN:getY()) < 0.707 then + nInvSCC = MCH_SCC.ADIR_YM + else + nInvSCC = nSCC + end elseif nSCC == MCH_SCC.ADIR_YM then - nInvSCC = MCH_SCC.ADIR_YP + if abs( vtN:getY()) < 0.707 then + nInvSCC = MCH_SCC.ADIR_YP + else + nInvSCC = nSCC + end else nInvSCC = nSCC end diff --git a/LuaLibs/ProcessRoundArch.lua b/LuaLibs/ProcessRoundArch.lua index 3b4441c..ae56a22 100644 --- a/LuaLibs/ProcessRoundArch.lua +++ b/LuaLibs/ProcessRoundArch.lua @@ -1,4 +1,4 @@ --- ProcessRoundArch.lua by Egaltech s.r.l. 2019/12/07 +-- ProcessRoundArch.lua by Egaltech s.r.l. 2020/09/03 -- Gestione calcolo archi per Travi -- Tabella per definizione modulo @@ -155,12 +155,20 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) dDepth = dDepth + BD.CUT_EXTRA end end - if dDepth > dMaxDepth then - if bCanDouble then - nDouble = 2 - dDepth = min( 0.5 * dDepth, dMaxDepth) - else - dDepth = dMaxDepth + -- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga + if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and + bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then + nDouble = 2 + dDepth = min( ( b3Raw:getDimY() - BD.DIM_STRIP) * 0.5, dMaxDepth) + else + -- se altezza geometria supera capacità taglio utensile ed è orizzontale setto per eseguire codolo in centro + if dDepth > dMaxDepth then + if bCanDouble then + nDouble = 2 + dDepth = min( 0.5 * dDepth, dMaxDepth) + else + dDepth = dMaxDepth + end end end -- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-