diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 8f10250..4b097e8 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -241,6 +241,10 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH3 = false end SetCurrMachineHeadType() + -- verifico se non richiesta testa sopra e macchina ha solo teste sopra + if not bTopHead and MachineHeadType ~= TWO_UP_DOWN_HEADS and not BD.TURN then + return nil + end -- verifico se testa attiva va bene local sH1Mach = '' local sH1Tool = '' diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 136929b..4dd05e0 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -3683,13 +3683,17 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha sNotes = sNotes .. 'VMRS=0;' EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) -- eseguo - if not ML.ApplyMachining( true, false) then + if not ML.ApplyMachining( true, false) or EgtIsMachiningEmpty() then -- provo ad allargare leggermente la tasca EgtSetMachiningParam( MCH_MP.OFFSR, -0.1) if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) return -1, sErr + elseif EgtIsMachiningEmpty() then + EgtRemoveOperation( nMchFId) + local sErr = 'Impossible to machine (empty toolpath)' + return -3, sErr end end -- se posso applicare la svuotatura sul lato opposto @@ -5238,7 +5242,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL) - if nOk == -2 then + if nOk == -3 then + bTryWithBlades = true + elseif nOk == -2 then if not sMchFind then sMchFind = sMchFindBackUp end diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 3737905..a7354bd 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -453,9 +453,9 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt local dSawRad = dSawDiam / 2 local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN if BD.C_SIMM then - dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL) + dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0)) else - dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL) + dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0)) end end -- se necessari tagli in doppio, eseguo gli opposti