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
+6 -5
View File
@@ -1,7 +1,8 @@
-- BatchProcess.lua by Egaltech s.r.l. 2020/10/28
-- BatchProcess.lua by Egaltech s.r.l. 2020/12/03
-- 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).
-- 2020/12/03 Ora riconosciute rotazioni di inversione con angoli negativi.
-- Intestazioni
@@ -266,7 +267,7 @@ if bToProcess then
-- inversione
local dInvAng = EgtGetInfo( vWall[i].Id, 'INVERTED', 'd')
if dInvAng then
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL then
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and abs( dInvAng + 180) > GEO.EPS_ANG_SMALL then
local ptInvCen = b3Solid:getCenter()
EgtRotate( vWall[i].Id, ptInvCen, Z_AX(), dInvAng - 180, GDB_RT.GLOB)
b3Solid:rotate( ptInvCen, Z_AX(), dInvAng - 180)
@@ -279,17 +280,17 @@ if bToProcess then
if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then
vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY()
end
elseif abs( dInvAng - 90) < 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 then
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 then
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