diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 5ed5705..e100eb6 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1225,7 +1225,7 @@ function BeamExec.ProcessFeatures() -- eventuale spostamento fori sui tenoni MoveDrillsOnTenon( vProc) -- se richiesto ribaltamento (oppure rotazione) - if ( bSomeDown or bSomeSide) and not BD.DOWN_HEAD then + if ( bSomeDown or bSomeSide) and not BD.DOWN_HEAD and not BD.TURN then -- ribalto le travi della fase corrente local nRId = nRawId while nRId do @@ -1285,7 +1285,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ORD', nOrd) end -- se richiesta rotazione - if bSomeSide and not BD.DOWN_HEAD then + if bSomeSide and not BD.DOWN_HEAD and not BD.TURN then -- vettore movimento grezzi per rotazione di 90deg local dDeltaYZ = EgtGetRawPartBBox( nRawId):getDimY() - EgtGetRawPartBBox( nRawId):getDimZ() local vtMove = Vector3d( 0, dDeltaYZ / 2, dDeltaYZ / 2) @@ -1359,7 +1359,7 @@ function BeamExec.ProcessFeatures() for i = 1, #vProc do -- creo la lavorazione local Proc = vProc[i] - if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD) then + if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw) if not bOk then nTotErr = nTotErr + 1 diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 0678543..ad27a4c 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -149,7 +149,11 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) end else - nSCC = MCH_SCC.ADIR_ZP + if abs( vtOut:getY()) > abs( vtOut:getZ()) then + nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + else + nSCC = MCH_SCC.ADIR_ZP + end end -- inserisco la lavorazione di taglio local sName = 'Cut_' .. ( EgtGetName( nSurfId) or tostring( nSurfId)) .. '_' .. tostring( nFacet + 1) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 3d78d1c..ed4e289 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2022/03/29 +-- ProcessDrill.lua by Egaltech s.r.l. 2022/04/21 -- Gestione calcolo forature per Travi -- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile. -- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto. @@ -6,6 +6,7 @@ -- 2021/10/29 DS MaxElev anche su fori con svuotatura. -- 2022/03/26 DS Correzioni per fori testa-fianco nel piano. -- 2022/03/29 DS Corretta assegnazione fori molto inclinati fianco/coda a coda. +-- 2022/04/21 DS Corretto riconoscimento fori di coda. -- Tabella per definizione modulo local ProcessDrill = {} @@ -67,8 +68,8 @@ function ProcessDrill.IsTailFeature( Proc, b3Raw) end local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- se entrata principale + local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 if ( Proc.Flg == 2 or ( Proc.Flg == 1 and vtExtr:getZ() >= BD.DRILL_VZ_MIN)) and ( nFcs == 5 or nFcs == 6 or abs( vtExtr:getX()) < BD.DRILL_VX_MAX) then - local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 return ( ( nFcs == 5 or nFcs == 6) and vtExtr:getX() < -0.5) -- altrimenti entrata opposta else @@ -148,13 +149,13 @@ function ProcessDrill.Classify( Proc, b3Raw) return false, false, false end local bOpen = ( Proc.Fce ~= 0) - local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD) and ( Proc.Flg == 2 or Proc.Flg == -2)))) + local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and ( Proc.Flg == 2 or Proc.Flg == -2)))) -- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then if not bOpen then return true, true, false else - return true, not ( BD.ROT90 or BD.DOWN_HEAD), ( BD.ROT90 or BD.DOWN_HEAD) + return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) end else return true, false, false @@ -392,7 +393,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE - if not BD.C_SIMM then + if not BD.C_SIMM and not BD.TURN then nSCC = MCH_SCC.ADIR_YM if AreSameVectorApprox( vtExtr, Z_AX()) then nSCC = MCH_SCC.ADIR_YM diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 2459acb..cac9da3 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -170,7 +170,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut end local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) -- caratteristiche taglio - local bHorizCut = ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) + local bHorizCut = (( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, BD.MAX_DIM_HTCUT_HBEAM) local bDoubleHorizCut = ( BD.DOWN_HEAD and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 2b5f248..210685a 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -682,7 +682,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw) local bDown = ( vtN[1]:getZ() < BD.NZ_MINB and vtN[2]:getZ() < BD.NZ_MINB) or ( vtN[1]:getZ() < BD.NZ_MINA and vtN[2]:getZ() < 0.5 and ( vtN[2]:getZ() < -0.1 or not bSmall)) or ( vtN[2]:getZ() < BD.NZ_MINA and vtN[1]:getZ() < 0.5 and ( vtN[1]:getZ() < -0.1 or not bSmall)) - bDown = ( bDown and not BD.DOWN_HEAD) + bDown = ( bDown and not BD.DOWN_HEAD and not BD.TURN) return true, bDown -- se più di 2 facce else @@ -772,7 +772,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw) local nFaceAdj = GetFaceAdj( Proc, nFacInd, dH, dV) or -1 local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2) -- verifico se è lavorabile solo dal basso - local bDown = ( vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD) + local bDown = ( vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and not BD.TURN) -- se verso il basso, verifico se utilizzabile seconda faccia if bDown then if nFacInd2 and dElev2 < 2 * dElev then @@ -917,7 +917,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead) local bFaceOk = {} bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB) bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB) - if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then + if not bDownHead and not BD.TURN and not bFaceOk[1] and not bFaceOk[2] then local sErr = 'Error : LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr @@ -3276,7 +3276,7 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT) -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE - if not BD.C_SIMM then + if not BD.C_SIMM and not BD.TURN then nSCC = MCH_SCC.ADIR_YM if AreSameVectorApprox( tvtN[2], Z_AX()) then nSCC = MCH_SCC.ADIR_YM @@ -4745,7 +4745,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end -- verifico non sia orientata verso il basso o ci sia una testa dal basso local bFaceDown = ( vtN:getZ() < BD.NZ_MINA) - if bFaceDown and not BD.DOWN_HEAD then + if bFaceDown and not BD.DOWN_HEAD and not BD.TURN then local sErr = 'Error : LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 505a7a2..af7488e 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -170,7 +170,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId) end local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) -- caratteristiche taglio - local bHorizCut = ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) + local bHorizCut = (( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, BD.MAX_DIM_HTCUT_HBEAM) local bDoubleHorizCut = ( BD.DOWN_HEAD and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 7922b7f..2e650b0 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -99,7 +99,7 @@ local function ApplyPocket( Proc, sPocketing, nStep, dSurfStep, nIdSurf, vtExtr) end -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE - if not BD.C_SIMM then + if not BD.C_SIMM and not BD.TURN then nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) @@ -298,7 +298,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE - if not BD.C_SIMM then + if not BD.C_SIMM and not BD.TURN then nSCC = MCH_SCC.ADIR_YM if abs( vtExtr:getY()) > 0.088 then nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)