From 1b6f8b3be4e2ca192b3d78914b6df0865691f29a Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 13 Dec 2022 16:48:48 +0100 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20Tenon=20se=20inclinati?= =?UTF-8?q?=20solo=20verticalmente=20e=20macchine=20tipo=20PF=20(BD.PRESS?= =?UTF-8?q?=5FROLLER)=20si=20riduce=20l'ingombro=20di=20testa=20o=20coda?= =?UTF-8?q?=20-=20in=20LapJoint=20con=203=20o=20pi=C3=B9=20facce=20e=20pri?= =?UTF-8?q?ncipale=20verso=20il=20basso=20modificato=20criterio=20possibil?= =?UTF-8?q?it=C3=A0=20di=20lavorare=20su=20seconda=20faccia=20possibile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 23 ++++++++--------------- LuaLibs/ProcessTenon.lua | 7 ++++--- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 9c54b49..17fbf70 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -710,16 +710,10 @@ function ProcessLapJoint.Classify( Proc, b3Raw) else -- dati della faccia local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) - local nFac2Ind = EgtIf( nFacInd ~= 0, 0, 1) - local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFac2Ind, GDB_ID.ROOT) - if abs( rfFac:getVersY() * vtN2) < 0.5 then - dH, dV = dV, dH - rfFac:rotate( rfFac:getOrigin(), rfFac:getVersZ(), 90) - end + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) -- se può essere fatto con utensile tipo lama local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc) if bUseBHSideMill then - local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then return true, false else @@ -727,8 +721,6 @@ function ProcessLapJoint.Classify( Proc, b3Raw) end -- altrimenti controllo se deve essere ruotato con le altre lavorazioni else - -- dati della faccia - local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) -- cerco se c'è faccia adiacente sul lato più lungo local nFaceAdj = GetFaceAdj( Proc, nFacInd, dH, dV) or -1 local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2) @@ -738,23 +730,24 @@ function ProcessLapJoint.Classify( Proc, b3Raw) if bDown then local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc)) -- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare - local bForceSideMill = ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 2 or EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 3) and ( Proc.Fct == 3 or Proc.Fct == 4)) + local nSideRoughTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') + local bForceSideMill = ( ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4)) if bForceSideMill then bDown = false - elseif nFacInd2 and dElev2 < 2 * dElev then - local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT) + elseif nFacInd2 and dElev2 < 160 and dElev2 < 2 * dElev then + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd2, GDB_ID.ROOT) bDown = ( vtN2:getZ() < BD.NZ_MINB) elseif not nFacInd2 and bIsL and nFaceAdj >= 0 then - local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFaceAdj, GDB_ID.ROOT) + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFaceAdj, GDB_ID.ROOT) bDown = ( vtN2:getZ() < BD.NZ_MINB) end -- verifico se la faccia principale è sottosquadra, ha forma L ed esiste la faccia adiacente elseif vtN:getZ() < -0.2589 and bIsL and nFaceAdj >= 0 then -- box del pezzo local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) - -- se il numero di facce > 2 o il box della feature supera una certa distanza dalle teste allora controllo la z della faccia ausiiaria + -- se più di 2 facce o il box della feature supera una certa distanza dalle teste allora controllo Nz della faccia ausiiaria if Proc.Fct > 2 or ( Proc.Box:getMax():getX() < b3Solid:getMin():getX() - 150) or ( Proc.Box:getMin():getX() > b3Solid:getMax():getX() + 150) then - local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFaceAdj, GDB_ID.ROOT) + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFaceAdj, GDB_ID.ROOT) bDown = ( vtN2:getZ() < BD.NZ_MINB) end end diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index fdf59a4..93acbd4 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2022/11/03 +-- ProcessTenon.lua by Egaltech s.r.l. 2022/12/12 -- Gestione calcolo tenone per Travi -- 2021/10/04 Corretto calcolo HCING per pezzi piccoli. -- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto. @@ -6,6 +6,7 @@ -- 2022/05/28 Spostato calcolo svuotatura in modulo di libreria. -- 2022/09/20 Migliorato il calcolo delle passate laterali; ora considera la reale distanza tra contorno del tenone e estremi della faccia -- 2022/11/03 Corretto uso di bH2 (da sotto solo se anche bMillDown vero). +-- 2022/12/12 Su macchine con rulli pressori e pinze separate si riduce di meno l'ingombro con tenoni inclinati. -- Tabella per definizione modulo local ProcessTenon = {} @@ -287,7 +288,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() local dDelta = 0 if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then - dDelta = - 0.5 * dOffs + dDelta = - EgtIf( BD.PRESS_ROLLER, 0.7, 0.5) * dOffs end if bShortPart and b3Raw:getDimZ() < BD.VICE_MINH and abs( vtN:getZ()) > 0.575 then local b3Base = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD) @@ -298,7 +299,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) elseif Proc.Tail then local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then - dOffs = 0.5 * dOffs + dOffs = EgtIf( BD.PRESS_ROLLER, 0.3, 0.5) * dOffs end BL.UpdateTCING( nRawId, dOffs) end