From 1471d17d8f4e2b0cf4ffe8e17b649f7679563356 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 29 Nov 2021 15:10:35 +0100 Subject: [PATCH] DataBeam : - House mortise sempre prima di (dt)mortise, house tenon sempre dopo (dt)tenon. --- LuaLibs/BeamExec.lua | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 7e94afe..63d1bcc 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2021/07/13 +-- BeamExec.lua by Egaltech s.r.l. 2021/11/27 -- Libreria esecuzione lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. @@ -22,6 +22,7 @@ -- 2020/12/29 Aggiunta gestione fori in doppio. -- 2021/02/25 Aggiunta gestione eventuale ricalcolo per macchine tipo PF. -- 2021/07/13 Aggiunta gestione posizionamento pezzo TR/BR per macchine con carico a destra e scarico a sinistra. +-- 2021/11/27 House mortise sempre prima di (dt)mortise, house tenon sempre dopo (dt)tenon. -- Tabella per definizione modulo local BeamExec = {} @@ -453,6 +454,21 @@ local function OrderFeatures( vProc, b3Raw) if B1.Head ~= B2.Head then return B1.Head end + -- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone + if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and + B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then + return ( ( B1.Prc == 50 or B1.Prc == 55) and B2.Prc == 52) + end + -- se primo house mortise, secondo mortise e si intersecano, metto prima house mortise + if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and + B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then + return true + end + -- se primo mortise, secondo house mortise e si intersecano, metto prima house mortise + if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and Mortise.Identify( B2) and B2.Prc == 53 and + B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then + return false + end -- se entrambi di testa e primo รจ scasso o mortasa va messo dopo if B1.Head and B2.Head and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then return false @@ -510,11 +526,6 @@ local function OrderFeatures( vProc, b3Raw) return ( B1.Diam > B2.Diam) end end - -- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone - if Tenon.Identify( B1) and Tenon.Identify( B2) and - B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then - return ( B1.Prc == 50 and B2.Prc == 52) - end -- confronto standard if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) > 0.4 * ( B1.Box:getDimX() + B2.Box:getDimX()) then return B1.Box:getCenter():getX() > B2.Box:getCenter():getX()