diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 7496722..1cfee79 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -626,7 +626,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F end -- *** Genero programma CN *** ( se richiesto) -if BEAM.FLAG == 0 or BEAM.FLAG == 4 then +local bIsGenerationEnabled = ( EgtGetNumberFromIni( 'Mach', 'NoPartProgram', 0, EgtGetIniFile()) == 0) +if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then EgtOutLog( ' +++ Generating NC part program >>>') local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '') if EgtGetExeVersion then diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index af2d211..eed5a0a 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1275,6 +1275,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN local bOk = true local sErr = '' local nNewPhase = -1 + local AddedIds EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1) -- se intestatura ( 1-340-X ) if Hcut.Identify( Proc) then @@ -1300,7 +1301,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN elseif Long2Cut.Identify( Proc) then -- se due facce longitudinali, eseguo doppio taglio longitudinale if Long2Cut.GetLongFacesCount( Proc) == 2 then - bOk, sErr = Long2Cut.Make( Proc, nPhase, nRawId, nPartId) + bOk, sErr, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId) -- altrimenti eseguo singolo taglio longitudinale else bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId) @@ -1318,7 +1319,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN -- o se rivestimento ( 3/4-034-X) o se mezzolegno chalet ( 4-037-X) o se tasca ( 4-039-X) o se taglio triangolato ( 4-120-X) elseif LapJoint.Identify( Proc) then -- esecuzione mezzo-legno o scanalatura - bOk, sErr = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) + bOk, sErr, _, AddedIds = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- se smusso ( 3/4-036-X) elseif Chamfer.Identify( Proc) then -- esecuzione smusso @@ -1423,7 +1424,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN EgtOutLog( sErr) bOk = false end - return bOk, sErr, ( nNewPhase or -1) + return bOk, sErr, ( nNewPhase or -1), AddedIds end ------------------------------------------------------------------------------------------------------------- @@ -2096,7 +2097,8 @@ function BeamExec.ProcessFeatures() -- flag feature precedente in doppio local nPrevDouble = 0 -- inserisco le lavorazioni da lavorare ribaltate - for i = 1, #vProc do + local i = 1 + while i <= #vProc do -- creo la lavorazione local Proc = vProc[i] if Proc.Flg ~= 0 and Proc.Down then @@ -2107,7 +2109,13 @@ function BeamExec.ProcessFeatures() Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase) Proc.PrevDouble = nPrevDouble nPrevDouble = Proc.Double - local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + -- lavorazioni da fare dopo separazione + if AddedIds and #AddedIds > 0 then + for j = 1, #AddedIds do + table.insert( vProc, AddedIds[j]) + end + end if not bOk then nTotErr = nTotErr + 1 table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId}) @@ -2137,6 +2145,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ROT', -2) end end + i = i + 1 end -- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard if not bSplitRot then @@ -2178,7 +2187,8 @@ function BeamExec.ProcessFeatures() local nPrevDouble = 0 -- inserisco le lavorazioni da lavorare ruotate local nSideMchOk = 0 - for i = 1, #vProc do + local i = 1 + while i <= #vProc do -- creo la lavorazione local Proc = vProc[i] if Proc.Flg ~= 0 and Proc.Side then @@ -2189,7 +2199,13 @@ function BeamExec.ProcessFeatures() Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase) Proc.PrevDouble = nPrevDouble nPrevDouble = Proc.Double - local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT) + local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT) + -- lavorazioni da fare dopo separazione + if AddedIds and #AddedIds > 0 then + for j = 1, #AddedIds do + table.insert( vProc, AddedIds[j]) + end + end if not bOk then nTotErr = nTotErr + 1 table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId}) @@ -2222,6 +2238,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ROT', -1) end end + i = i + 1 end -- se non sono state inserite lavorazioni di fianco, elimino la fase perchè inutile e dannosa if nSideMchOk == 0 then @@ -2248,7 +2265,8 @@ function BeamExec.ProcessFeatures() -- flag feature precedente in doppio local nPrevDouble = 0 -- inserisco le lavorazioni non ribaltate della trave - for i = 1, #vProc do + local i = 1 + while i <= #vProc do -- creo la lavorazione local Proc = vProc[i] if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then @@ -2259,7 +2277,13 @@ function BeamExec.ProcessFeatures() Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase) Proc.PrevDouble = nPrevDouble nPrevDouble = Proc.Double - local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) + -- lavorazioni da fare dopo separazione + if AddedIds and #AddedIds > 0 then + for j = 1, #AddedIds do + table.insert( vProc, AddedIds[j]) + end + end if not bOk then nTotErr = nTotErr + 1 table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId}) @@ -2287,6 +2311,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ORD', nOrd) end end + i = i + 1 end EgtOutLog( ' *** End AddMachinings ***', 1) -- passo al grezzo successivo diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 5978ec1..ead6a40 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -45,7 +45,7 @@ local BD = require( 'BeamData') local ML = require( 'MachiningLib') --------------------------------------------------------------------- -function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert) +function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut) EgtOutLog( 'FacesBySaw.MakeParallelOne', 3) -- dati della faccia local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT) @@ -76,7 +76,7 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD local bLioTang local Ktp = 1.1 if BD.KIOTP then Ktp = BD.KIOTP end - if Ktp * dLi2Tang < dLiPerp then + if bForceTangentLeadInOut or ( Ktp * dLi2Tang < dLiPerp) then bLioTang = true dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp if BD.TURN then @@ -192,7 +192,7 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp) end --------------------------------------------------------------------- -function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth) +function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut) -- se lama con asse parallelo alla faccia, passo alla apposita funzione if ( Par5 == MCH_MILL_FU.PARAL_DOWN or Par5 == MCH_MILL_FU.PARAL_TOP or @@ -200,7 +200,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw Par5 == MCH_MILL_FU.PARAL_BACK or Par5 == MCH_MILL_FU.PARAL_LEFT or Par5 == MCH_MILL_FU.PARAL_RIGHT) then - return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert) + return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut) end -- la lama ha asse perpendicolare alla faccia EgtOutLog( 'FacesBySaw.MakeOne', 3) @@ -330,8 +330,26 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box) local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp) local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp) + local dLiCompLength = 0 -- attacco tangente - local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box) + local dLi2Tang = 0 + local dLi2Perp = 0 + local dLo2Tang = 0 + local dLo2Perp = 0 + local dLi2CompLength = 0 + + -- si predilige un attacco tangenziale (con calcolo automatico di quanto uscire) se faccia non troppo orientata verso X e linea non troppo inclinata in X + -- non si fa se macchina tipo PF e pezzo alto perchè la lama, uscendo da sopra, toccherebbe la traversa + -- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi + -- + if bSpecialTangentLeadInOut and not bIsBiLinea and ( abs( vtN:getX()) < 0.5) and ( abs( vtTg:getX()) < 0.1736) and ( abs( vtN:getY()) < 0.5 or ( BD.MAX_DIM_HTCUT_HBEAM > 0 or ( b3Raw:getDimZ() < 420))) then + dLi2Tang = 0 + dLi2Perp = BD.MAX_DIM_DICE + BD.CUT_EXTRA + dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC + dLo2Tang = dSawDiam / 2 + else + dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box) + end local dLenLi2 = abs( dLi2Tang) local dLenLo2 = abs( dLo2Tang) @@ -402,7 +420,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw dLoPerp = BD.COLL_SIC else bLioTang = true - dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp + dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength end end -- posizione braccio @@ -475,6 +493,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw if BD.TURN and bLioTang == 1 then EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TG_PERP) end EgtSetMachiningParam( MCH_MP.LITANG, dLiTang) EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp) + EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength) if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang) EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) @@ -624,7 +643,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd]) -- lavoro la faccia for j = 1, #vCuts[i] do - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end @@ -684,14 +704,16 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, end -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i][j] then - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i+1][j] then - local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bSpecialTangentLeadInOut = ( ( i + 1) % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessBlockHausFront.lua b/LuaLibs/ProcessBlockHausFront.lua index 1a1cc32..0d97ac5 100644 --- a/LuaLibs/ProcessBlockHausFront.lua +++ b/LuaLibs/ProcessBlockHausFront.lua @@ -151,7 +151,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then @@ -242,7 +243,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index d34c9eb..9a9af10 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -548,7 +548,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b dVzLimDwnUp = -0.708 end end - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end -- tutti gli altri casi vengono saltati @@ -575,7 +576,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end end @@ -757,14 +759,16 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead) end -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i][j] then - local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) if vCuts[i+1][j] then - local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) + local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut) if not bOk then return bOk, sErr end end end diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index 39981b4..6635955 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -521,7 +521,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true) if not bOk then return bOk, sErr end end @@ -533,7 +534,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessDovetail.lua b/LuaLibs/ProcessDovetail.lua index 17574e8..49546f5 100644 --- a/LuaLibs/ProcessDovetail.lua +++ b/LuaLibs/ProcessDovetail.lua @@ -1433,7 +1433,8 @@ local function MakeAuxCut( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol return true end -- inserisco la lavorazione - local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail} + local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end -- imposto la nota nel gruppo aggiuntivo di lavorazione per evitare di tagliare una seconda volta diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 870af05..d15c819 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -210,7 +210,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index a9123bc..e8f3686 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -207,7 +207,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 12ccc6d..31f4069 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -173,7 +173,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw ) for j = nVerticalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_FRONT local dVerticalCutOffset = dVerticalSliceHeight * -j - bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return bOk, sErr end end return bOk, sErr @@ -359,7 +360,8 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut for j = nHorizontalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_DOWN local dHorizontalCutOffset = dHorizontalSliceHeight * -j - local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return bOk, sErr end end -- se necessario taglio verticale doppio, eseguo l'opposto diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 2ca42cd..6a93761 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -141,6 +141,9 @@ local Q_SIDE_ROUGH_TOOL = '' -- i local Q_ANTISPLINT_TYPE = '' -- i local Q_BLADE_ON_ALONG_FACE = '' -- i local Q_MAX_ELEVATION = '' -- d +local Q_SAW_PLUS_CHAIN = '' -- i +local Q_FORCE_CHAINSAW = '' -- i + -- variabile smussi local bMadeChamfer @@ -182,6 +185,7 @@ local function AssignQIdent( Proc) Q_MAX_ELEVATION = 'Q10' Q_STAIRCASE = '' Q_SAW_PLUS_CHAIN = 'Q11' + Q_FORCE_CHAINSAW = 'Q12' if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then Q_FORCE_BLADE = 'Q01' -- i @@ -1187,7 +1191,8 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, nCha EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local nCutFacet = EgtSurfTmFacetCount( AddId) if nCutFacet == 1 then return Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) @@ -2547,7 +2552,7 @@ end --------------------------------------------------------------------- local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham) - -- Se variabile globale indica che lo smusso è gi stato fatto, esco + -- Se variabile globale indica che lo smusso è già stato fatto, esco if bMadeChamfer then return 0 end @@ -2561,6 +2566,7 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI end -- ottengo le curve di contorno libero local nAuxId1, nAuxId2, nNumIdAux + local bIsOpenPath = false if bIs3Faces then -- estraggo i percorsi nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) @@ -2571,6 +2577,36 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI else nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) if not nNumIdAux then nNumIdAux = 0 end + -- se non è una curva chiusa bisogna estrarre le sole curve da lavorare + if Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then + local IdsToMachine = {} + bIsOpenPath = true + local nFirstId, nIdCount = EgtExplodeCurveCompo( nAuxId1) + for i = nFirstId, nFirstId + nIdCount - 1, 1 do + -- se segmento di retta + if EgtGetType( i) == GDB_TY.CRV_LINE then + local _, nEntitiesCount = EgtCurveDomain(i) + for j = 0, nEntitiesCount - 1 do + local ptStart = EgtUP( i, j, GDB_RT.GLOB) + local ptEnd = EgtUP( i, j + 1, GDB_RT.GLOB) + if ( AreSameVectorApprox( vtOrtho, X_AX()) and ( abs( ptStart:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, -X_AX()) and ( abs( ptStart:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, -Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or + AreSameVectorApprox( vtOrtho, -Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) + ) then + table.insert( IdsToMachine, i) + end + end + else + return 0 + end + end + local ptNear = EgtSurfTmFacetCenter(Proc.Id, 0, GDB_ID.ROOT) + nAuxId1 = EgtCurveCompoByReorder( nAddGrpId, IdsToMachine, ptNear, true, GDB_ID.ROOT) + nNumIdAux = 1 + end end local dExtra = 2 @@ -2590,13 +2626,20 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI end else AuxId = nAuxId1 + i - 1 - vtExtr, _, _ = EgtCurveArea( AuxId) - end - if vtExtr then - if not bIs3Faces then + if bIsOpenPath then + _, vtExtr = EgtCurveIsFlat( AuxId) + else + vtExtr, _, _ = EgtCurveArea( AuxId) + end + if vtExtr then local fFrCurve = EgtGetGlobFrame( AuxId) vtExtr:toGlob( fFrCurve) + if bIsOpenPath and vtExtr * vtOrtho < GEO.EPS_SMALL then + vtExtr = -vtExtr + end end + end + if vtExtr then -- if bIs3Faces and i == nNumIdAux then -- vtExtr = -vtExtr -- end @@ -2840,6 +2883,12 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, local nOk, sErr = MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham) if nOk < 0 then return false, sErr end end + -- slot aperta su due lati + elseif Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then + if nChamfer > 0 then + local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, rfFac:getVersZ(), b3Solid, nil, dDepthCham) + if nOk < 0 then return false, sErr end + end end if not dDepth then dDepth = dElev end -- Recupero le facce adiacenti alla principale @@ -5106,22 +5155,29 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw) local nErr nErr, sErr = EgtGetLastMachMgrError() -- se mortasatura e l'errore è compatibile (Axes values not calculable) si prova con l'altra configurazione dell'asse bloccato - -- TODO valutare se c'è modo di capire preventivamente la configurazione dell'asse bloccato e quindi rimuovere questa parte di codice - if Machining.Type == MCH_OY.MORTISING and nErr == 2507 then - if Machining.BlockedAxis.Orientation == 'perpendicular' then - Machining.BlockedAxis.Orientation = 'parallel' - else - Machining.BlockedAxis.Orientation = 'perpendicular' + if Machining.Type == MCH_OY.MORTISING then + -- se errore "Axes values not calculable" si prova con l'altra configurazione dell'asse bloccato + if nErr == 2507 then + if Machining.BlockedAxis.Orientation == 'perpendicular' then + Machining.BlockedAxis.Orientation = 'parallel' + else + Machining.BlockedAxis.Orientation = 'perpendicular' + end + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut)) + if Machining.SuggestedAngles.Index == 1 then + Machining.SuggestedAngles.Index = 2 + else + Machining.SuggestedAngles.Index = 1 + end + EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index)) + sErr = '' + bIsApplyOk = ML.ApplyMachining( true, false) + -- se errore "Outstroke" e permesso ToolInvert provo ad invertire il lato di lavorazione + elseif Machining.AllowToolInvert and nErr == 2508 then + EgtSetMachiningParam( MCH_MP.TOOLINVERT, not Machining.ToolInvert) + sErr = '' + bIsApplyOk = ML.ApplyMachining( true, false) end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut)) - if Machining.SuggestedAngles.Index == 1 then - Machining.SuggestedAngles.Index = 2 - else - Machining.SuggestedAngles.Index = 1 - end - EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index)) - sErr = '' - bIsApplyOk = ML.ApplyMachining( true, false) end if not bIsApplyOk then nErr, sErr = EgtGetLastMachMgrError() @@ -5178,18 +5234,16 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found' Cutting.CanApply = false EgtOutLog( Cutting.Message) - return Cutting end Cutting.Type = MCH_OY.MILLING Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name) - -- verifica dimensioni tasca compatibili + -- verifica dimensioni tasca e direzione compatibili -- se tasca meno spessa della lama la strategia non è applicabile if Cutting.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade thickness' Cutting.CanApply = false EgtOutLog( Cutting.Message) - return Cutting end if #( Proc.MainFaces.SideFaces) > 1 then -- se tasca più stretta della lama la strategia non è applicabile @@ -5197,9 +5251,13 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade diameter' Cutting.CanApply = false EgtOutLog( Cutting.Message) - return Cutting end end + if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then + Cutting.CanApply = false + Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom' + EgtOutLog( Cutting.Message) + end -- parametri della lavorazione -- inizio e fine aperti o chiusi @@ -5330,6 +5388,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.CanApply = true Mortising.Message = '' Mortising.ProcId = Proc.Id + Mortising.AllowToolInvert = false local bNeedToMachineOtherSide = false local dTestCornerRadius = 43 -- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend @@ -5373,18 +5432,21 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - chainsaw not found' Mortising.CanApply = false EgtOutLog( Mortising.Message) - return Mortising end Mortising.Type = MCH_OY.MORTISING Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name) + -- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke) + if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then + Mortising.AllowToolInvert = true + end + -- verifica dimensioni tasca compatibili -- se tasca meno spessa della sega a catena la strategia non è applicabile if Mortising.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw thickness' Mortising.CanApply = false EgtOutLog( Mortising.Message) - return Mortising end if #( Proc.MainFaces.SideFaces) > 1 then -- se tasca più stretta della sega a catena la strategia non è applicabile @@ -5392,9 +5454,13 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw width' Mortising.CanApply = false EgtOutLog( Mortising.Message) - return Mortising end end + if EdgeToMachine.ToolDirection:getZ() < - 10 * GEO.EPS_ANG_SMALL then + Mortising.CanApply = false + Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : skipped chainsaw from bottom' + EgtOutLog( Mortising.Message) + end -- parametri della lavorazione -- inizio e fine aperti o chiusi @@ -5551,9 +5617,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) local bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end local dBottomDepthToMachine = Cutting.RadialOffset -- lato opposto del tunnel @@ -5562,9 +5628,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end else -- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato @@ -5575,9 +5641,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end end -- eventuale lavorazione di lama - lato della tasca in cui finisce la lavorazione @@ -5586,9 +5652,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsCuttingOk = false if Cutting.CanApply then bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) - end - if not bIsCuttingOk then - return bIsCuttingOk, Cutting.Message + if not bIsCuttingOk then + return bIsCuttingOk, Cutting.Message + end end end -- la lama è arrivata sul fondo e tasca passante, non servono ulteriori lavorazioni @@ -5622,9 +5688,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsMortisingOk = false if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) - end - if not bIsMortisingOk then - return bIsMortisingOk, Mortising.Message + if not bIsMortisingOk then + return bIsMortisingOk, Mortising.Message + end end else -- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato @@ -5635,9 +5701,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsMortisingOk = false if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) - end - if not bIsMortisingOk then - return bIsMortisingOk, Mortising.Message + if not bIsMortisingOk then + return bIsMortisingOk, Mortising.Message + end end end -- eventuale lavorazione di sega a catena - lato della tasca in cui finisce la lavorazione @@ -5646,9 +5712,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) bIsMortisingOk = false if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) - end - if not bIsMortisingOk then - return bIsMortisingOk, Mortising.Message + if not bIsMortisingOk then + return bIsMortisingOk, Mortising.Message + end end end end @@ -5731,17 +5797,27 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if nChamfer < 0 then return false, sErrCham end + -- eventuale forzatura sega a catena + local bForceChainsaw = ( EgtGetInfo( Proc.Id, Q_FORCE_CHAINSAW, 'i') or 0) > 0 -- se è un tunnel provo a vedere se è possibile lavorarlo con la svuotatura o con la sega catena if bClosedOrthoFaces then local bTryWithBlades = true + local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace + -- forzata sega a catena + if bForceChainsaw then + -- ottengo le dimensioni del tunnel + dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId) -- lavoro fessura con svuotature (singola o doppia contrapposta) - local sMyMchFind = 'Pocket' - local nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, + else + local sMyMchFind = 'Pocket' + local nOk, sErr + nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces) - if nOk < 0 then - return false, sErr - elseif nOk > 0 then - bTryWithBlades = false + if nOk < 0 then + return false, sErr + elseif nOk > 0 then + bTryWithBlades = false + end end -- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena if bTryWithBlades and nChamfer < 2 then @@ -6232,6 +6308,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if bForceSideMill then sPocketing = nil end + -- se forzata sega a catena + if bForceChainsaw then + sPocketing = nil + end -- leggo parametro Q local nQAntisplintResult = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0 -- se lavorazione fresa come lama disabilito eventuale antischeggia @@ -6453,8 +6533,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) end end - -- in tutti gli altri casi lancio la MakeByPockets (lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo) - else + -- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets + -- lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo + elseif not bForceChainsaw then -- se 2 facce setto i parametri corretti per la MakeByPockets if bForceSideMill and Proc.Fct == 2 then bIs3Faces = false @@ -7210,13 +7291,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- leggo i parametri Q per utilizzare la fresa di fianco e/o lama local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 local bUseBlade = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1 - local bOk, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) + local bOk, sMyWarn, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) -- se non sono riuscito a farlo di lama, riprovo con la fresa if not bOk and bUseBlade then bUseBlade = false return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) else - return bOk, sMyWarn + return bOk, sMyWarn, nil, AddedIds end -- prima faccia terminale elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 13875c6..a7ee835 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1391,7 +1391,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, 0}}) -- inverto se utensile antiorario per garantire senso di percorrenza migliore - local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 + local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) > 0 -- setto workside e eventuale inversione if bInvert then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index e6e9934..93b49f5 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -37,6 +37,7 @@ EgtOutLog( ' ProcessLongDoubleCut started', 1) -- Dati local BD = require( 'BeamData') local ML = require( 'MachiningLib') +local Topology = require( 'FeatureTopology') local dLimMinPiece = BD.LEN_SHORT_PART or 1000 @@ -324,6 +325,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local nFaceLimit, tFaceLong, ptC, vtN = IdentifyFaces( Proc) local dLen = Proc.Box:getDimX() + -- inizializzazione tabella con eventuali lavorazioni create a posteriori da ritornare al chiamante + local AddedIds = {} + -- recupero lunghezza grezzo totale da info sulla macchinata local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd') local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX() @@ -945,18 +949,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- altrimenti concavo else - -- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. - for k = 1, #vOrd do - if vWidth[vOrd[k]] + BD.CUT_SIC > dMaxDepth then - if not( ProcessLong2Cut.Identify( Proc)) then - return false - else - local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[k]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' - if not sWarn then sWarn = '' end - sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) - end - end - end -- si percorrono i lati alto e basso della faccia for i = 1, nC do -- Posizione braccio portatesta @@ -986,6 +978,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster EgtOutLog( sErr) return false, sErr end + -- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. + local dCheckDepth = 0 + if bCanUseBlade then + dCheckDepth = dMaxDepth + elseif bCanUseUnderBlade then + dCheckDepth = dMaxDepthDn + end + if vWidth[vOrd[j]] + 100 * GEO.EPS_SMALL > dCheckDepth then + if not( ProcessLong2Cut.Identify( Proc)) then + return false + else + local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[j]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dCheckDepth, 1) .. ')' + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + end + end -- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama if nSide <= 0 and bCanUseUnderBlade then if ( vWidth[vOrd[j]] / 2) > dMaxDepthDn then @@ -999,7 +1007,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local dLioPerp if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90 - local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0) + local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0) -- se la faccia è più grande del massimo materiale lama, allora limito lavorazione if dMinOffsBigFace > 0 then dOffset = dMinOffsBigFace @@ -1011,7 +1019,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC else -- il secondo ridotto della distanza minima e della componente spessore della lama - local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0) + local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0) -- se la faccia è più grande del massimo materiale lama, allora limito lavorazione if dMinOffsBigFace > 0 then dOffset = dMinOffsBigFace @@ -1269,6 +1277,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end end + if Proc.bMoveAfterSplit then + nC = 1 + dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5) + dEndDist = - ( dToolDiam / 2 + 5) + end if nIni == 2 then dStartDist, dEndDist = dEndDist, dStartDist dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist @@ -1380,6 +1393,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end end + if not Proc.MoveAfterSplit and not bEndFixed and not bConvex then + -- recupero gruppo per geometria addizionale + local nAddGrpId = BL.GetAddGroup( nPartId) + if not nAddGrpId then + local sErr = 'Error : missing AddGroup' + EgtOutLog( sErr) + return false, sErr + end + local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL + local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId, bMoveAfterSplit = true} + Topology.Classify( AddProc, b3Raw) + table.insert( AddedIds, AddProc) + end -- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown else @@ -1822,8 +1848,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end - return true, sWarn -end + return true, sWarn, nil, AddedIds +end --------------------------------------------------------------------- return ProcessLong2Cut diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index db80299..527173b 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -417,7 +417,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index 39bcb6b..831cbbb 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -307,7 +307,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index 4eb7029..58a9c56 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -311,7 +311,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index 5988c77..fa5d0ad 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -311,7 +311,8 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfFront.lua b/LuaLibs/ProcessProfFront.lua index 4c09578..997e01a 100644 --- a/LuaLibs/ProcessProfFront.lua +++ b/LuaLibs/ProcessProfFront.lua @@ -258,7 +258,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index 5b685a8..3cdfbf8 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -293,7 +293,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- altrimenti applico taglio di lama else local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) if not bOk then return false, sErr diff --git a/LuaLibs/ProcessRidgeLap.lua b/LuaLibs/ProcessRidgeLap.lua index 4d57e48..b1f4c67 100644 --- a/LuaLibs/ProcessRidgeLap.lua +++ b/LuaLibs/ProcessRidgeLap.lua @@ -134,7 +134,8 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- applico taglio di lama local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessSimpleScarf.lua b/LuaLibs/ProcessSimpleScarf.lua index 49aab92..9a24b7f 100644 --- a/LuaLibs/ProcessSimpleScarf.lua +++ b/LuaLibs/ProcessSimpleScarf.lua @@ -4,6 +4,7 @@ -- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut. -- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour. -- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo. +-- 2024/08/05 Se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda -- Tabella per definizione modulo local ProcessSimpleScarf = {} @@ -148,7 +149,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT -- se ci sono meno di due facce si riduce a una normale Cut local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) if nFacetCnt < 2 then - local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail) + local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail, true) return bOk, sErr end -- dati delle facce diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 1493b6b..829f68c 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -272,7 +272,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes) for j = nVerticalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_FRONT local dVerticalCutOffset = dVerticalSliceHeight * -j - bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return bOk, sErr end end return bOk, sErr @@ -607,7 +608,8 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt for j = nHorizontalCuts, 1, -1 do local nFaceUse = MCH_MILL_FU.PARAL_DOWN local dHorizontalCutOffset = dHorizontalSliceHeight * -j - local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw) + local bForceTangentLeadInOut = BD.PRESS_ROLLER + local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, bForceTangentLeadInOut) if not bOk then return false, sErr end end -- se necessario taglio verticale doppio, eseguo l'opposto diff --git a/LuaLibs/ProcessStepJoint.lua b/LuaLibs/ProcessStepJoint.lua index fd267f9..88c0780 100644 --- a/LuaLibs/ProcessStepJoint.lua +++ b/LuaLibs/ProcessStepJoint.lua @@ -212,7 +212,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end end @@ -223,7 +224,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end end @@ -392,7 +394,8 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico lavorazione local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 696be04..3ea367e 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -200,7 +200,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) else local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bFromBottom = ( bShortPart and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) if not bOk then diff --git a/LuaLibs/ProcessTyroleanDovetail.lua b/LuaLibs/ProcessTyroleanDovetail.lua index b8d00ce..03f2917 100644 --- a/LuaLibs/ProcessTyroleanDovetail.lua +++ b/LuaLibs/ProcessTyroleanDovetail.lua @@ -232,7 +232,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then @@ -330,7 +331,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, -- se va fatto, inserisco la lavorazione if bCut then local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, - Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} + Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} + CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then diff --git a/UpdateLog.txt b/UpdateLog.txt index b8842c2..269b197 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,6 +1,12 @@ ==== Beam Update Log ==== -Versione 2.6g4 (2024/07/19) +Versione 2.6h1 (20/08/2024) +- Modif : in SimpleScarf, se assimilabile a un taglio, si considera area non pinzabile +- Modif : in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4 +- Modif : varie modifiche ai tagli di lama per evitare chiusura rulli pneumatici e finecorsa +- Modif : in BatchProcessNew, se presente flag apposito in EgtCam5, si evita la generazione + +Versione 2.6g4 (19/07/2024) - Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE Versione 2.6g3 (07/07/2024) diff --git a/Version.lua b/Version.lua index 83e67a1..0772dd6 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.6g4' +VERSION = '2.6h1' MIN_EXE = '2.6e2'