From 2c5529b87bd2dece2d1eeed5f546a785389e24c3 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 21 Apr 2020 10:34:04 +0000 Subject: [PATCH] DataBeam : - revisione generale e migliorie nei tagli. --- LuaLibs/DiceCut.lua | 9 ++- LuaLibs/FacesBySaw.lua | 8 ++- LuaLibs/ProcessBlockHausFront.lua | 8 ++- LuaLibs/ProcessCut.lua | 10 +++- LuaLibs/ProcessDoubleCut.lua | 8 ++- LuaLibs/ProcessDtMortise.lua | 24 ++++---- LuaLibs/ProcessDtTenon.lua | 5 +- LuaLibs/ProcessLapJoint.lua | 90 +++++++++-------------------- LuaLibs/ProcessProfCamb.lua | 5 +- LuaLibs/ProcessProfConcave.lua | 5 +- LuaLibs/ProcessProfConvex.lua | 5 +- LuaLibs/ProcessProfFront.lua | 5 +- LuaLibs/ProcessProfHead.lua | 5 +- LuaLibs/ProcessStepJoint.lua | 11 ++-- LuaLibs/ProcessTenon.lua | 5 +- LuaLibs/ProcessTyroleanDovetail.lua | 8 ++- 16 files changed, 97 insertions(+), 114 deletions(-) diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index 1f75292..c04da1b 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -1,4 +1,4 @@ --- DiceCut.lua by Egaltech s.r.l. 2020/02/26 +-- DiceCut.lua by Egaltech s.r.l. 2020/04/21 -- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli -- Tabella per definizione modulo @@ -395,7 +395,6 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl -- se normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda if abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then - --OffsetP = BD.MAX_DIM_HTCUT OffsetO = BD.MAX_DIM_HTCUT end @@ -461,10 +460,10 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl end -- calcolo la direzione dei piani ortogonali local vtO = VectorFromUprightOrtho( vtNInner) - if vtNInner:getZ() > 0.05 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.5 then + if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then vtO:rotate( vtNInner, 90) -- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente - if abs( vtO:getY()) > abs( vtO:getX()) and vtNInner:getZ() > dNzLimDwnUp then + if abs( vtO:getY()) > 2 * abs( vtO:getX()) and vtNInner:getZ() > dNzLimDwnUp then vtO:rotate( vtNInner, 90) -- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra if vtNInner:getZ() < -0.05 then @@ -478,7 +477,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl end end end - -- calcolo le dimensioni dell'offset e se dove posizionare la prima faccia: + -- calcolo le dimensioni dell'offset e dove posizionare la prima faccia: -- CopyPlane: 0 => crea la prima faccia direttamente sul punto passato -- CopyPlane: 1 => crea la prima faccia e tutte le altre con l'offset passato -- CopyPlane: 0.5 => crea la prima faccia a metà offset e tutte le altre con l'offest intero diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index c19efbf..02571a8 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -1,4 +1,4 @@ --- FacesBySaw.lua by Egaltech s.r.l. 2020/02/12 +-- FacesBySaw.lua by Egaltech s.r.l. 2020/04/20 -- Gestione taglio con lama di feature con una, due o tre facce -- Tabella per definizione modulo @@ -67,6 +67,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutName) local dSqDim2 = ( ptC[2] - ptPs):sqlen() local nBigInd = EgtIf( dSqDim1 >= dSqDim2, 1, 2) local nSmaInd = 3 - nBigInd + local nUpInd = EgtIf( vtN[1]:getZ() >= vtN[2]:getZ(), 1, 2) + local nOtInd = 3 - nUpInd -- recupero la lavorazione local sCutting = ML.FindCutting( sCutName) if not sCutting then @@ -90,7 +92,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutName) dCutExtra = - dSawThick / tan( 180 + dAngT) end -- verifico se necessari tagli supplementari - local vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd]) + local vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC[nUpInd], vtN[nUpInd], false, ptC[nOtInd], vtN[nOtInd]) --DC.PrintOrderCut( vCuts) if #vCuts > 0 then -- recupero gruppo per geometria addizionale @@ -111,7 +113,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutName) -- eseguo for i = 1, #vCuts do -- assegno il modo di tagliare - local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd]) + local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd]) -- lavoro la faccia for j = 1, #vCuts[i] do local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dCutExtra, BD.CUT_SIC, 0, 0, nil, b3Raw) diff --git a/LuaLibs/ProcessBlockHausFront.lua b/LuaLibs/ProcessBlockHausFront.lua index 3b9c067..e7420db 100644 --- a/LuaLibs/ProcessBlockHausFront.lua +++ b/LuaLibs/ProcessBlockHausFront.lua @@ -1,4 +1,4 @@ --- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/03/30 +-- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo giunzione block house in testa -- Tabella per definizione modulo @@ -144,7 +144,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then @@ -235,7 +236,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) -- 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 b9b440a..9162825 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2020/03/19 +-- ProcessCut.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo singoli tagli di lama per Travi -- Tabella per definizione modulo @@ -179,9 +179,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) vtOrthoO = -Z_AX() elseif bHorizCut then vtOrthoO = Z_AX() - elseif Proc.Head and b3Solid:getDimX() < BD.LEN_SHORT_PART and abs( vtN:getY()) > 0.02 and dCutV < dMaxDepth + 10 * GEO.EPS_SMALL then + elseif Proc.Head and abs( vtN:getY()) > 0.02 and vtN:getZ() > -0.174 and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then vtOrthoO = X_AX() - elseif Proc.Tail and b3Solid:getDimX() < BD.LEN_SHORT_PART and abs( vtN:getY()) > 0.02 and dCutV < dMaxDepth + 10 * GEO.EPS_SMALL then + elseif Proc.Tail and abs( vtN:getY()) > 0.02 and vtN:getZ() > -0.174 and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then vtOrthoO = -X_AX() elseif vtN:getY() > -0.02 then vtOrthoO = Y_AX() @@ -202,12 +202,16 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() if abs( vtN:getZ()) > 0.5 then dOffs = dOffs - 0.6 * Proc.Box:getDimX() + elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then + dOffs = dOffs - 0.3 * Proc.Box:getDimX() end BL.UpdateHCING( nRawId, dOffs) elseif Proc.Tail then local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() if abs( vtN:getZ()) > 0.5 then dOffs = dOffs - 0.6 * Proc.Box:getDimX() + elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then + dOffs = dOffs - 0.3 * Proc.Box:getDimX() end BL.UpdateTCING( nRawId, dOffs) end diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index b84632d..d64a567 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/02/18 +-- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo doppi tagli di lama per Travi -- Tabella per definizione modulo @@ -118,7 +118,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) 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, CutId = Proc.CutId, TaskId = Proc.TaskId} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end @@ -128,7 +129,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) 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, CutId = Proc.CutId, TaskId = Proc.TaskId} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 390ae2c..3f8426d 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,4 +1,4 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2020/04/11 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo mortase a coda di rondice per Travi -- Tabella per definizione modulo @@ -123,10 +123,21 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam + dToolDiam = max( dToolDiam, 10) dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng end end + -- verifico se raggio troppo piccolo per l'utensile + local nSt, nEnd = EgtCurveDomain( AuxId) + for i = nSt, nEnd - 1 do + local dRad = EgtCurveCompoRadius( AuxId, i) + if dRad > 0 and dRad < dToolDiam / 2 then + local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id) + EgtOutLog( sErr) + return false, sErr + end + end -- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then -- recupero il riferimento della faccia di fondo @@ -222,17 +233,6 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId) return false, sErr end end - dToolDiam = max( dToolDiam, 10) - -- verifico se raggio troppo piccolo per l'utensile - local nSt, nEnd = EgtCurveDomain( AuxId) - for i = nSt, nEnd - 1 do - local dRad = EgtCurveCompoRadius( AuxId, i) - if dRad > 0 and dRad < dToolDiam / 2 then - local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id) - EgtOutLog( sErr) - return false, sErr - end - end -- verifico se necessarie più passate (distanza all'imbocco ortogonale all'asse) local vtDiff = EgtEP( AuxId, GDB_RT.GLOB) - EgtSP( AuxId, GDB_RT.GLOB) local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB) diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index d04dc30..c96a650 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2020/02/07 +-- ProcessTenon.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo tenone a coda di rondine per Travi -- Tabella per definizione modulo @@ -153,7 +153,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- 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} + 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} local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index acf2a16..6abe0e9 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/09 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -742,7 +742,8 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, b3Raw, nChamfer) if AddId then 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} + 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} local nCutFacet = EgtSurfTmFacetCount( AddId) if nCutFacet == 1 then return Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) @@ -1857,26 +1858,22 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas b3Raw, nDiffWidth, nUseRoughTool, dAng, sPocketing, sTuuidPk, dPrevFaceElev) local sMchFind = 'Pocket' - local dAngLimit = 30 + local dAngLimit = 40 -- se feature é larga come trave imposto openpocket if nDiffWidth == 0 then sMchFind = 'OpenPocket' - -- altrimenti non è passante disabilito il truciolatore e amplio il limite angolare - -- per la differenza di lunghezza tra il truciolatore e la fresa più lunga + -- altrimenti non è passante disabilito il truciolatore else nUseRoughTool = 0 - dAngLimit = 40 end -- se angolo tra le facce maggiore di 90, inserisco la contornatura o svuotatura del lato più corto if ( 180 + dAng) > 90.1 then -- calcolo l'angolo dalla verticale dall'angolo tra le due facce, perchè la feature potrebbe essere ruotata sulla Z locale della -- faccia principale e quindi la componente X del versore della faccia potrebbe dare un valore non coerente - local dDiffFromSqAng = 180 + dAng - 90 - -- se la normale della faccia corta si discosta dalla trave di più dell'angolo selezionato utilizzo la svutatura altrimenti la contornatura --- if abs( tvtN[2]:getX()) < cos(dAngLimit) then -- se si discosta di più del valore impostato applico svuotatura + local dDiffFromSqAng = dAng + 90 -- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura - if cos( dDiffFromSqAng) < cos(dAngLimit) then -- se si discosta di più del valore impostato applico svuotatura + if cos( dDiffFromSqAng) < cos( dAngLimit) then -- applico la svuotatura local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng) if not bOk then @@ -2368,7 +2365,6 @@ end --------------------------------------------------------------------- local function CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, dElev) - local bUSAngle local dDiam = min( dH, dV) local dMaxLenFace = max( dH, dV) -- verifico che diametro utensile prende con la openpocket con la massima dimensione faccia @@ -2723,7 +2719,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha end --------------------------------------------------------------------- -local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part) +local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) local sWarn -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) @@ -2838,15 +2834,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part) -- Questa feature non è applicata su facce di testa e quindi non controllo l'entrata in X 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 EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) - --elseif abs(vtOrtho:getZ()) <= 0.707 and vtOrtho:getY() < -0.707 then - -- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_FRONT) - --elseif abs(vtOrtho:getZ()) < 0.707 and vtOrtho:getX() > 0.707 then - -- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_LEFT) - --else - -- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_RIGHT) end -- imposto offset radiale local dOffs = ( i - 1) * dStep @@ -2921,7 +2910,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part) local bSpecial3faces = false -- verifico se sono nel caso in cui la faccia esclusa ha elevazione più alta if not bIsU and bIsL and Proc.Fct <= 3 and nFacInd ~= 0 and nFacInd2 ~= 0 then --- if not bIsU and bIsL and Proc.Fct <= 3 then -- verifico se l'elevazione della faccia esclusa è maggiore dell'elevazione delle altre due facce local nFaceMaxElev = 0 if Proc.Fct == 3 then @@ -3074,52 +3062,26 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part) -- recupero la lavorazione local dCollSic = 2 * BD.COLL_SIC if abs( vtN:getX()) > 0.996 or abs( vtN:getY()) > 0.996 or abs( vtN:getZ()) > 0.996 then dCollSic = 0 end - local nUseRoughTool = 0 local sMchFind = 'Pocket' - local dDiam - -- se processo 20 vedo se ho truciolatore abilitato - if Proc.Prc == 20 then - -- se forzato uso truciolatore altrimenti prosegue con fresa più piccola - if EgtGetInfo( Proc.Id, sUseRoughTool, 'i') ~= 0 then - sMchFind = 'OpenPocket' - nUseRoughTool = 1 - end - dDiam = min( dH, dV) - else - -- Da disposizini di Alessandro, se feature lavorata in singolo passo uso fresa - if bSingle_part then - -- disabilito il truciolatore + local nUseRoughTool = 0 + local dDiam = min( dH, dV) + -- verifico dalla forma se non posso prendere utensile grande + if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then + --verifico dimensioni con facce adiacenti + dDiam, sMchFind, nUseRoughTool = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic)) + if not dDiam then sMchFind = 'Pocket' nUseRoughTool = 0 - -- verifico dalla forma se posso prendere utensile più grande - if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) then - --verifico dimensioni facce adiacenti - dDiam, sMchFind, nUseRoughTool = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic)) - if not dDiam then - dDiam = min( dH, dV) - sMchFind = 'Pocket' - nUseRoughTool = 0 - end - else - dDiam = min( dH, dV) - end - -- altrimenti le lavorata in passo multiplo - else - -- abilito il truciolatore - sMchFind = 'OpenPocket' + dDiam = min( dH, dV) + end + end + -- se processo 20 e non sto usando il truciolatore + if Proc.Prc == 20 and nUseRoughTool == 0 then + -- verifico se forzato uso truciolatore + local nUseRT = EgtGetInfo( Proc.Id, sUseRoughTool, 'i') + if nUseRT and nUseRT ~= 0 then + sMchFind = 'OpenPocket' nUseRoughTool = 1 - -- verifico dalla forma se posso prendere utensile più grande - if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) or ( Proc.Fct == 1 and not bIsU and not bIsL) then - --verifico dimensioni facce adiacenti - dDiam, sMchFind, nUseRoughTool = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic)) - if not dDiam then - dDiam = min( dH, dV) - sMchFind = 'Pocket' - nUseRoughTool = 0 - end - else - dDiam = min( dH, dV) - end end end --EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam)) @@ -3284,7 +3246,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId) local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD) local nFct = EgtSurfTmFacetCount( vAddId[i]) local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, Fct = nFct, Flg = Proc.Flg} - local bOk, sMyWarn = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, false) + local bOk, sMyWarn = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId) if not sWarn then sWarn = sMyWarn end if not bOk then return bOk, sWarn end end @@ -3354,7 +3316,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- tre o più facce else - return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, true) + return MakeMoreFaces( Proc, nPhase, nRawId, nPartId) end end end diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index 63f2c18..606c065 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -1,4 +1,4 @@ --- ProcessProfCamb.lua by Egaltech s.r.l. 2020/03/04 +-- ProcessProfCamb.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo profilo caudato per Travi -- Tabella per definizione modulo @@ -212,7 +212,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico la lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index a12393d..b9e9be3 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -1,4 +1,4 @@ --- ProcessProfConcave.lua by Egaltech s.r.l. 2020/03/18 +-- ProcessProfConcave.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo profilo caudato per Travi -- Tabella per definizione modulo @@ -211,7 +211,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico la lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index f8991d1..f6cd3c6 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -1,4 +1,4 @@ --- ProcessProfConvex.lua by Egaltech s.r.l. 2020/03/18 +-- ProcessProfConvex.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo profilo caudato per Travi -- Tabella per definizione modulo @@ -211,7 +211,8 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico la lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessProfFront.lua b/LuaLibs/ProcessProfFront.lua index 3cedf7d..acada3b 100644 --- a/LuaLibs/ProcessProfFront.lua +++ b/LuaLibs/ProcessProfFront.lua @@ -1,4 +1,4 @@ --- ProcessProfFront.lua by Egaltech s.r.l. 2020/03/04 +-- ProcessProfFront.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo profilo caudato per Travi -- Tabella per definizione modulo @@ -206,7 +206,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico la lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index 9a6a426..3aff907 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -1,4 +1,4 @@ --- ProcessProfHead.lua by Egaltech s.r.l. 2020/03/18 +-- ProcessProfHead.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo profilo caudato per Travi -- Tabella per definizione modulo @@ -208,7 +208,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- applico la lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessStepJoint.lua b/LuaLibs/ProcessStepJoint.lua index e39641d..8440e62 100644 --- a/LuaLibs/ProcessStepJoint.lua +++ b/LuaLibs/ProcessStepJoint.lua @@ -1,4 +1,4 @@ --- ProcessStepJoint.lua by Egaltech s.r.l. 2020/02/07 +-- ProcessStepJoint.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo giunto a gradino per Travi -- Tabella per definizione modulo @@ -122,7 +122,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end @@ -132,7 +133,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end @@ -290,7 +292,8 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end end diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index a314e1b..71383ef 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2020/02/26 +-- ProcessTenon.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo tenone per Travi -- Tabella per definizione modulo @@ -160,7 +160,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- 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} + 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} local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0, bFromBottom) if not bOk then return bOk, sErr end diff --git a/LuaLibs/ProcessTyroleanDovetail.lua b/LuaLibs/ProcessTyroleanDovetail.lua index 9ae7f2a..c9b94b3 100644 --- a/LuaLibs/ProcessTyroleanDovetail.lua +++ b/LuaLibs/ProcessTyroleanDovetail.lua @@ -1,4 +1,4 @@ --- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2020/04/14 +-- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2020/04/20 -- Gestione calcolo giunzione tirolese -- Tabella per definizione modulo @@ -243,7 +243,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, end -- 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then @@ -341,7 +342,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, end -- 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} + 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} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta if bOk then