diff --git a/BatchProcess.lua b/BatchProcess.lua index e6c16ca..99846c2 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -1,4 +1,4 @@ --- BatchProcess.lua by Egaltech s.r.l. 2021/04/09 +-- BatchProcess.lua by Egaltech s.r.l. 2021/06/23 -- Gestione calcolo batch disposizione e lavorazioni per Pareti -- 2020/07/24 Nuvola di punti riferita allo Zero Tavola. -- 2020/10/28 Corretto spostamento pezzi per rotazioni (0 o 180) e inversioni( 0, 90, 180, o 270). @@ -296,8 +296,9 @@ if bToProcess then end EgtSetInfo( vWall[i].Id, 'INVERTED_DONE', dInvAng) end - -- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre 0 o 180 deg) - if not bProj and dRotAng and dInvAng then + -- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre multipli di 90 deg) + local sType = EgtGetInfo( vWall[i].Id, 'TYPE', 's') + if not bProj and dRotAng and dInvAng and sType ~= 'LAYER' then if abs( dInvAng - 0) < GEO.EPS_ANG_SMALL then if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() @@ -306,17 +307,19 @@ if bToProcess then end elseif abs( dInvAng - 90) < GEO.EPS_ANG_SMALL or abs( dInvAng + 270) < GEO.EPS_ANG_SMALL then vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() - if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then + if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL or abs( dRotAng + 180) < GEO.EPS_ANG_SMALL then + vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() + elseif abs( dRotAng - 270) < GEO.EPS_ANG_SMALL or abs( dRotAng + 90) < GEO.EPS_ANG_SMALL then vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() end elseif abs( dInvAng - 180) < GEO.EPS_ANG_SMALL or abs( dInvAng + 180) < GEO.EPS_ANG_SMALL then vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() if abs( dRotAng - 0) < GEO.EPS_ANG_SMALL then vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() - --elseif abs( dRotAng - 270) < GEO.EPS_ANG_SMALL or abs( dRotAng + 90) < GEO.EPS_ANG_SMALL then - -- vWall[i].PosX = vWall[i].PosX + vWall[i].Box:getDimX() + elseif abs( dRotAng - 270) < GEO.EPS_ANG_SMALL or abs( dRotAng + 90) < GEO.EPS_ANG_SMALL then + vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() elseif abs( dRotAng - 90) < GEO.EPS_ANG_SMALL or abs( dRotAng + 270) < GEO.EPS_ANG_SMALL then - vWall[i].PosX = vWall[i].PosX + vWall[i].Box:getDimX() + vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() end elseif abs( dInvAng - 270) < GEO.EPS_ANG_SMALL or abs( dInvAng + 90) < GEO.EPS_ANG_SMALL then if abs( dRotAng - 0) < GEO.EPS_ANG_SMALL then diff --git a/Process.lua b/Process.lua index a714921..f16ee8b 100644 --- a/Process.lua +++ b/Process.lua @@ -1,4 +1,4 @@ --- Process.lua by Egaltech s.r.l. 2021/04/13 +-- Process.lua by Egaltech s.r.l. 2021/06/23 -- Gestione calcolo disposizione e lavorazioni per Pareti -- Si opera sulla macchina corrente -- 2020/12/09 Come per BatchProcess.lua si gestiscono anche rotazioni di inversione con valori negativi. @@ -126,8 +126,9 @@ local function MyProcessInputData() end EgtSetInfo( vWall[i].Id, 'INVERTED_DONE', dInvAng) end - -- correzioni per rotazioni non centrate di produzioni di TS3 (quasi sempre 0 o 180 deg) - if not bProj and dRotAng and dInvAng then + -- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre multipli di 90 deg) + local sType = EgtGetInfo( vWall[i].Id, 'TYPE', 's') + if not bProj and dRotAng and dInvAng and sType ~= 'LAYER' then if abs( dInvAng - 0) < GEO.EPS_ANG_SMALL then if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() @@ -136,17 +137,19 @@ local function MyProcessInputData() end elseif abs( dInvAng - 90) < GEO.EPS_ANG_SMALL or abs( dInvAng + 270) < GEO.EPS_ANG_SMALL then vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() - if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then + if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL or abs( dRotAng + 180) < GEO.EPS_ANG_SMALL then + vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() + elseif abs( dRotAng - 270) < GEO.EPS_ANG_SMALL or abs( dRotAng + 90) < GEO.EPS_ANG_SMALL then vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() end elseif abs( dInvAng - 180) < GEO.EPS_ANG_SMALL or abs( dInvAng + 180) < GEO.EPS_ANG_SMALL then vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() if abs( dRotAng - 0) < GEO.EPS_ANG_SMALL then vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() - --elseif abs( dRotAng - 270) < GEO.EPS_ANG_SMALL or abs( dRotAng + 90) < GEO.EPS_ANG_SMALL then - -- vWall[i].PosX = vWall[i].PosX + vWall[i].Box:getDimX() + elseif abs( dRotAng - 270) < GEO.EPS_ANG_SMALL or abs( dRotAng + 90) < GEO.EPS_ANG_SMALL then + vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() elseif abs( dRotAng - 90) < GEO.EPS_ANG_SMALL or abs( dRotAng + 270) < GEO.EPS_ANG_SMALL then - vWall[i].PosX = vWall[i].PosX + vWall[i].Box:getDimX() + vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY() end elseif abs( dInvAng - 270) < GEO.EPS_ANG_SMALL or abs( dInvAng + 90) < GEO.EPS_ANG_SMALL then if abs( dRotAng - 0) < GEO.EPS_ANG_SMALL then