From bec5751e8cda2c90cd859ef41216236f65a784e7 Mon Sep 17 00:00:00 2001 From: "daniele.nicoli" Date: Tue, 4 Aug 2026 09:45:13 +0200 Subject: [PATCH] =?UTF-8?q?-=20LapJoint,=20MakeByPockets=20-=20se=20lavora?= =?UTF-8?q?zione=20in=20doppio=20taglia=20fino=20a=20met=C3=A0=20tasca=20e?= =?UTF-8?q?=20non=20oltre=20(+BD.CUT=5FEXTRA=5FMIN)=20la=20considero=20com?= =?UTF-8?q?unque=20completa=20e=20non=20eseguo=20lavorazione=20di=20pulizi?= =?UTF-8?q?a=20laterale.=20-=20LapJoint,=20MakeRoundCleanContour=20-=20se?= =?UTF-8?q?=20tasca=20passante=20solo=20da=20sopra=20o=20da=20sotto=20e=20?= =?UTF-8?q?fresa=20di=20contorno=20non=20lavora=20tutto,=20attiva=20lavora?= =?UTF-8?q?zione=20in=20doppio.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 47 +++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index cd84499..cf4710b 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1792,7 +1792,9 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw, dDepth, bOneShot) -- recupero la lavorazione senza considerare l'elevazione perché viene calcolata l'elevazione utile - local sMilling = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not( bMillDown and not bDoubleSide), bMillDown and not bDoubleSide) + local bTopHead = not( bMillDown and not bDoubleSide) + local bDownHead = bMillDown and not bDoubleSide + local sMilling = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, bTopHead, bDownHead) if not sMilling then local sMyWarn = 'Warning : SmallToolContour not found in library' EgtOutLog( sMyWarn) @@ -1954,24 +1956,31 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw, EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) -- inversione direzione utensile local bInvertMach = false + local bInvertTool = false if nPathInt then - if bMillDown and not bDoubleSide then + if bDownHead then if vtN1:getZ() > 10 * GEO.EPS_SMALL then - EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + bInvertTool = true + bInvertMach = true + end + elseif bMillDown and bDoubleSide then + if vtN1:getZ() > 10 * GEO.EPS_SMALL and bDownHead then + bInvertTool = true bInvertMach = true end else -- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale) - if vtN1:getZ() < BD.NZ_MINA and abs(vtN1:getZ()) >= 0.707 then - EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + if vtN1:getZ() < BD.NZ_MINA and abs( vtN1:getZ()) >= 0.707 then + bInvertTool = true bInvertMach = true -- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti - elseif not bDoubleSide and vtN1:getY() > GEO.EPS_SMALL then - EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + elseif not bDoubleSide and vtN1:getY() > 10 * GEO.EPS_SMALL then + bInvertTool = true bInvertMach = true end end end + EgtSetMachiningParam( MCH_MP.TOOLINVERT, bInvertMach) -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE if not BD.C_SIMM then @@ -2046,7 +2055,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw, -- imposto lato di lavoro sinistro EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) -- imposto direzione utensile opposta - EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bInvertTool) -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE if not BD.C_SIMM then @@ -2075,7 +2084,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw, EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth) -- setto se devo invertire il percorso local bInvert = CheckToInvert( nIdPath, true) - EgtSetMachiningParam( MCH_MP.INVERT, not bInvert) + EgtSetMachiningParam( MCH_MP.INVERT, not EgtIf( bInvertMach, not bInvert, bInvert)) -- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or '' sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0) @@ -4590,9 +4599,11 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha else dMachDepth = dMaxDepthDn - ( dDepth / 2) - dCollSic dElev = dMaxDepthDn - bComplete = false - sWarn = 'Warning : elevation bigger than max tool depth' - EgtOutLog( sWarn) + if dMaxDepthDn < ( dDepth / 2) + dCollSic + 100 * GEO.EPS_SMALL then + bComplete = false + sWarn = 'Warning : elevation bigger than max tool depth' + EgtOutLog( sWarn) + end end else -- se anche lavorando dal lato opposto non riesco a svuotare completamente la fessura @@ -4600,9 +4611,11 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha if dMaxDepth < ( dDepth / 2) + BD.CUT_EXTRA + dCollSic then dMachDepth = dMaxDepth - (dDepth / 2) - dCollSic dElev = dMaxDepth - bComplete = false - sWarn = 'Warning : elevation bigger than max tool depth' - EgtOutLog( sWarn) + if dMaxDepth < ( dDepth / 2) + dCollSic + 100 * GEO.EPS_SMALL then + bComplete = false + sWarn = 'Warning : elevation bigger than max tool depth' + EgtOutLog( sWarn) + end end end if bMakeContour then @@ -8181,7 +8194,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown, bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid, - dDepth, bOneShotm) + dDepth, bOneShot) if not bOk then return false, sWarn2 end if sWarn2 then if not sWarn then sWarn = '' end @@ -8273,7 +8286,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown, bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid, - dDepth, bOneShotm) + dDepth, bOneShot) if not bOk then return false, sWarn2 end if sWarn2 then if not sWarn then sWarn = '' end