From 1d2c145b852fadcd45627d38c75ee160b67fef97 Mon Sep 17 00:00:00 2001 From: DarioS Date: Sat, 29 Jan 2022 19:15:37 +0100 Subject: [PATCH] DataWall : - aggiunta gestione orientamento asse C per SideMill con asse utensile verticale. --- LuaLibs/WProcessLapJoint.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index f69a557..a003a49 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1344,7 +1344,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist) EgtSetMachiningParam( MCH_MP.LOPERP, dSideDist + WD.CUT_SIC) -- imposto posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP - if AreSameVectorApprox( vtN, Z_AX()) then + if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) @@ -1642,7 +1642,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d EgtSetMachiningGeometry( {{ Proc.Id, nFacet}}) -- imposto posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP - if AreSameVectorApprox( vtN, Z_AX()) then + if abs( vtN:getZ()) < GEO.EPS_SMALL then nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) @@ -1738,7 +1738,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d end -- verifico se devo lavorare anche la seconda faccia basandomi sul valore dell'angolo interno if dAng and dAng > -90 + 10 * GEO.EPS_SMALL then - local nOtherFacet = abs(nFacet - 1) + local nOtherFacet = abs( nFacet - 1) -- inserisco la lavorazione di contornatura local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMchFId = EgtAddMachining( sName, sMilling) @@ -1751,8 +1751,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, nOtherFacet}}) -- imposto posizione braccio porta testa + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nOtherFacet, GDB_ID.ROOT) local nSCC = MCH_SCC.ADIR_ZP - if AreSameVectorApprox( vtN, Z_AX()) then + if AreSameOrOppositeVectorApprox( vtN2, Z_AX()) then nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP) end EgtSetMachiningParam( MCH_MP.SCC, nSCC)