diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 5985b98..2794704 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -956,7 +956,9 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dV local Ktp = 1.1 if BD.KIOTP then Ktp = BD.KIOTP end if abs( vtTg:getX()) < 0.9848 and - ( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5)) or ( Ktp*dLenLi2 < dLenLi and Ktp*dLenLo2 < dLenLo) or Ktp*( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then + ( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5)) or + ( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 400 and BD.C_SIMM and BD.MAX_HEIGHT > 450) or + ( Ktp * dLenLi2 < dLenLi and Ktp * dLenLo2 < dLenLo) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp end -- posizione braccio diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 1c5e0f0..b383c61 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -234,7 +234,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw) if not BD.C_SIMM and abs( vtN:getX()) < 0.5 then dNzLimDwnUp = -0.707 end local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) - if bFromBottom == nil then bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtN:getX() < 0 and vtN:getZ() > 0.25) end + if bFromBottom == nil then + bFromBottom = ( vtN:getZ() > 0.25 and ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtN:getX() < 0)) + end -- verifico se da considerare taglio lungo ( non da sotto, inclinato meno di 21.56deg, largo come la trave e abbastanza lungo) local bLongCut = ( not bDownCut and vtN:getZ() > 0.93 and Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 58c799a..d65394d 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -247,6 +247,23 @@ local function GetChainSawBlockedAxis( nInd) end end +--------------------------------------------------------------------- +local function GetChainSawInitAngs( vtN, vtO) + if BD.GetChainSawInitAngs then + return BD.GetChainSawInitAngs( vtN, vtO) + else + if BD.C_SIMM then + if vtN:getY() > 0 then + return 'C=180' + else + return 'C=-180' + end + else + return '' + end + end +end + --------------------------------------------------------------------- local function VerifyChainSaw( Proc, dMinDim, dMaxDim, vtOrtho) local bUseChainSaw = false @@ -2995,15 +3012,9 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, 0, - dSawWidth / 2)) EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, 0, - dSawWidth / 2)) end - -- imposto angolo 3° asse rot + -- imposto angolo 3° asse rot e eventuale angolo suggerito per inizio EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 1)) - if BD.C_SIMM then - if vtN:getY() > 0 then - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=180') - else - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=-180') - end - end + EgtSetMachiningParam( MCH_MP.INITANGS, GetChainSawInitAngs( vtN, rfFac:getVersZ())) -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) @@ -3026,13 +3037,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end -- impostazione alternativa angolo 3° asse rot EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 2)) - if BD.C_SIMM then - if vtN:getY() > 0 then - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=180') - else - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=-180') - end - end + EgtSetMachiningParam( MCH_MP.INITANGS, GetChainSawInitAngs( vtN, rfFac:getVersZ())) if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) @@ -3071,7 +3076,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- al momento, dato che la fessura è passante da parte a parte, gestisco solo la lavorazione -- dall'alto e di fronte (da dietro è disabilitata perchè ho exracorsa con la FAST). -- Questa feature non è applicata su facce di testa e quindi non controllo l'entrata in X - if abs(vtOrtho:getZ()) >= 0.707 then + if abs( vtOrtho:getZ()) >= 0.707 then EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN) --elseif abs(vtOrtho:getZ()) < 0.707 and abs(vtOrtho:getY()) > 0.707 then else @@ -3085,13 +3090,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end -- imposto angolo 3° asse rot EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 1)) - if BD.C_SIMM then - if vtN:getY() > 0 then - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=180') - else - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=-180') - end - end + EgtSetMachiningParam( MCH_MP.INITANGS, GetChainSawInitAngs( vtN, vtOrtho)) -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) @@ -3116,14 +3115,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end -- impostazione alternativa angolo 3° asse rot EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 2)) - if BD.C_SIMM then - local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) - if vtN:getY() > 0 then - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=180') - else - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=-180') - end - end + EgtSetMachiningParam( MCH_MP.INITANGS, GetChainSawInitAngs( vtN, vtOrtho)) if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) @@ -4414,8 +4406,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa else EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) end + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) -- imposto angolo 3° asse rot EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 1)) + EgtSetMachiningParam( MCH_MP.INITANGS, GetChainSawInitAngs( vtN, vtOrtho)) -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) @@ -4436,14 +4430,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa return false, sErr end EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 2)) - if BD.C_SIMM then - local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) - if vtN:getY() > 0 then - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=180') - else - EgtSetMachiningParam( MCH_MP.INITANGS, 'C=-180') - end - end + EgtSetMachiningParam( MCH_MP.INITANGS, GetChainSawInitAngs( vtN, vtOrtho)) if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false)