diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 3f990fc..46ae203 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -195,7 +195,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) -- Se non limitato e da sopra e richiesto con doppio taglio di lama e superiore al limite minimo if not bLimXmin and not bLimXmax and nSide == 1 and bUseBlade and b3Solid:getDimX() > dLimMinPiece - 1 then - -- recupero la lavorazione local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then @@ -290,10 +289,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) end end end - -- se altrimenti non è sotto : lavorazione Long2Cut + -- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut elseif nSide ~= - 1 and nUseMillOnSide == 0 then + -- determino la massima elevazione + local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId) -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Long2Cut') + local sMilling = ML.FindMilling( 'Long2Cut', dElev) if not sMilling then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' EgtOutLog( sErr) @@ -309,7 +310,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth end end - -- se la fine non è limitata e ho un pezzo successivo più distante da metà raggio. setto la fine come limitata + -- se la fine (a sinistra) non è limitata e ho un pezzo successivo più distante da metà raggio. setto la fine come limitata if dDistToNextPiece < dToolDiam/2 and not bLimXmin then bForcedLim = true bLimXmin = true @@ -318,14 +319,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) if bLimXmin and bLimXmax and Proc.Box:getDimX() < 2 * dToolDiam then return MakeByPocketing( Proc, nPhase, nRawId, nPartId) end - -- determino la massima elevazione - local dElev = 0 - local ptT1 = b3Raw:getMax() - local dDist1 = ( ptT1 - ptC) * vtN - dElev = max( dElev, dDist1) - local ptT2 = ptT1 - Y_AX() * b3Raw:getDimY() - local dDist2 = ( ptT2 - ptC) * vtN - dElev = max( dElev, dDist2) -- determino gli estremi local dStartDist = 0 local dStartAccDist = BD.LONGCUT_ENDLEN diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index 3d832b5..c515cee 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/09/26 +-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/10/06 -- Gestione calcolo doppio taglio longitudinale per Travi -- Tabella per definizione modulo @@ -440,8 +440,13 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end -- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut elseif nSide ~= - 1 and nUseMillOnSide == 0 then + -- determino la massima elevazione + local dElev = 0 + local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId) + local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[2], nPartId) + dElev = max( dFacElev1, dFacElev2) -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Long2Cut') + local sMilling = ML.FindMilling( 'Long2Cut', dElev) if not sMilling then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' EgtOutLog( sErr) @@ -465,11 +470,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- se chiuso e corto, applico svuotatura con fresa opportuna if nFaceLimit == 3 and Proc.Box:getDimX() < 2 * dToolDiam then -- svuotatura della prima faccia longitudinale - local dFacElev = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId) - local bOk, sErr = MakeByPocketing( Proc, nPhase, nRawId, nPartId, tFaceLong[1], dFacElev) + local bOk, sErr = MakeByPocketing( Proc, nPhase, nRawId, nPartId, tFaceLong[1], dFacElev1) -- svuotatura della seconda faccia longitudinale if not bOk then return bOk, sErr end - local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[2], nPartId) return MakeByPocketing( Proc, nPhase, nRawId, nPartId, tFaceLong[2], dFacElev2) end -- determino gli estremi