From a4ce17b068a6c5972e5d1bd1ada663944cdd0213 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Sep 2019 10:45:50 +0000 Subject: [PATCH] DataBeam : - altre migliorie a LapJoint e LongCut. --- LuaLibs/ProcessLapJoint.lua | 10 +++++----- LuaLibs/ProcessLongCut.lua | 13 ++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 127d2d5..6214b00 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2019/09/27 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/09/30 -- Gestione calcolo mezzo-legno per Travi -- Tabella per definizione modulo @@ -37,8 +37,8 @@ function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH) if Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dCurrOvmH - BD.MAX_DIST_HTFEA then return false end - -- la sua lunghezza non deve superare la metà della lunghezza della trave - if Proc.Box:getDimX() > 0.5 * b3Raw:getDimX() then + -- la sua lunghezza non deve superare il massimo e 1/3 della lunghezza della trave + if Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.33 *b3Raw:getDimX()) then return false end -- se una o due facce ora è sicuramente di testa @@ -73,8 +73,8 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw) if Proc.Box:getMin():getX() > b3Raw:getMin():getX() + BD.MAX_DIST_HTFEA then return false end - -- la sua lunghezza non deve superare 1/4 della lunghezza della trave - if Proc.Box:getDimX() > 0.25 * b3Raw:getDimX() then + -- la sua lunghezza non deve superare il massimo e 1/3 della lunghezza della trave + if Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.33 * b3Raw:getDimX()) then return false end -- se una o due facce ora è sicuramente di coda diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index df7c732..633613e 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -83,10 +83,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam end end + -- determino se lavorazione da davanti o da dietro + local bFront = ( vtN:getY() < 0) + -- determino gli estremi local dStartDist = 0 local dStartAccDist = BD.LONGCUT_ENDLEN local bStartFixed = true - if ( bLimXmin and vtN:getY() < 0) or ( bLimXmax and vtN:getY() > 0) then + if ( bLimXmin and bFront) or ( bLimXmax and not bFront) then dStartDist = dToolDiam / 2 dStartAccDist = BD.LONGCUT_MAXLEN bStartFixed = false @@ -94,7 +97,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) local dEndDist = 0 local dEndAccDist = BD.LONGCUT_ENDLEN local bEndFixed = true - if ( bLimXmin and vtN:getY() > 0) or ( bLimXmax and vtN:getY()< 0) then + if ( bLimXmin and not bFront) or ( bLimXmax and bFront) then dEndDist = dToolDiam / 2 dEndAccDist = BD.LONGCUT_MAXLEN bEndFixed = false @@ -136,6 +139,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) dEndAccDist = 0 end end + -- determino l'utilizzo della faccia + local nFaceUse = EgtIf( abs( vtN:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK)) -- si percorre il lato basso della faccia local nM = 0 for i = 1, nC do @@ -166,11 +171,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- imposto offset radiale (nullo se concavo) - if k >1 then + if k > 1 then EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep) else EgtSetMachiningParam( MCH_MP.OFFSR, - BD.CUT_EXTRA) end + -- imposto uso della faccia + EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError()