DataWall :

- correzioni per rotazione di inversione pezzi con valori negativi.
This commit is contained in:
Dario Sassi
2020-12-09 17:37:53 +00:00
parent b05386b850
commit dcb43a8665
2 changed files with 25 additions and 11 deletions
+19 -6
View File
@@ -1,6 +1,7 @@
-- Process.lua by Egaltech s.r.l. 2020/11/18
-- Process.lua by Egaltech s.r.l. 2020/12/09
-- 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.
-- Intestazioni
require( 'EgtBase')
@@ -118,21 +119,33 @@ local function MyProcessInputData()
-- inversione
local dInvAng = EgtGetInfo( vWall[i].Id, 'INVERTED', 'd')
if dInvAng then
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and not EgtExistsInfo( vWall[i].Id, 'INVERTED_DONE') then
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and abs( dInvAng + 180) > GEO.EPS_ANG_SMALL and not EgtExistsInfo( vWall[i].Id, 'INVERTED_DONE') then
local ptInvCen = b3Solid:getCenter()
EgtRotate( vWall[i].Id, ptInvCen, Z_AX(), dInvAng - 180, GDB_RT.GLOB)
b3Solid:rotate( ptInvCen, Z_AX(), dInvAng - 180)
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
if abs( dInvAng) > GEO.EPS_ANG_SMALL then
vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX()
if abs( dRotAng) < GEO.EPS_ANG_SMALL 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()
end
elseif abs( dRotAng) > GEO.EPS_ANG_SMALL then
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
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()
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
vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX()
end
end
end
end