diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 4d0a920..465daa6 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -4754,8 +4754,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa while not bDeleteFace and nInt < nFaces do nInt = nInt + 1 local b3Facet = EgtSurfTmGetFacetBBoxGlob( nTestId, nInt-1, GDB_BB.STANDARD) + local vtN = EgtSurfTmFacetNormVersor( nTestId, nInt-1, GDB_ID.ROOT) -- se dimensione faccia sulla X - if b3Facet:getDimX() < 1 then + if b3Facet:getDimX() < 1 or abs( vtN:getX()) > 0.1 then EgtSurfTmRemoveFacet( nTestId, nInt-1) bDeleteFace = true end @@ -4768,43 +4769,43 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa bExit = true end end - + -- verifico che la componente x delle faccia o deve essere nulla + local vtN1 = EgtSurfTmFacetNormVersor( nTestId, 0, GDB_ID.ROOT) + if bNewIsU and abs( vtN1:getX()) > 0.01 then + bNewIsU = false + end -- cancello la copia del percorso EgtErase( nTestId) if bNewIsU then -- recupero la lavorazione --- if vtN:getZ() < BD.NZ_MINA and BD.DOWN_HEAD and nFacInd2 then if vtN:getZ() < BD.NZ_MINA and BD.DOWN_HEAD then sMillingOnSide = ML.FindMilling( 'SideMillAsBlade_H2') else sMillingOnSide = ML.FindMilling( 'SideMillAsBlade') end - if not sMillingOnSide then - local sErr = 'Error : MillOnSideAsBlade (cutting) not found in library' - EgtOutLog( sErr) - return false, sErr - end - -- recupero i dati dell'utensile - local dToolLength = 0 - local sUserNote - if EgtMdbSetCurrMachining( sMillingOnSide) then - local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) - if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then - dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength - dToolDiamOnSide = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiamOnSide - dThickMillOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dThickMillOnSide - dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide + if sMillingOnSide then + -- recupero i dati dell'utensile + local dToolLength = 0 + local sUserNote + if EgtMdbSetCurrMachining( sMillingOnSide) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength + dToolDiamOnSide = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiamOnSide + dThickMillOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dThickMillOnSide + dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide + end + end + -- 2021.09.17 Su conferma di Fabio Squaratti, se la gola è più streta dell'utensile o la profondità della gole è maggiore + -- del valore parametro SIDEDEPTH (preso dalle note utente dell'utensile) allora si prosegue come se non fosse abilitata + -- questo tipo di lavorazione SideMillAsBlade + if dDiam >= dThickMillOnSide and dFacElev < dMaxDepthOnSide + 10 * GEO.EPS_SMALL then + bSpecialMillOnSide = true + -- disabilito eventulae svuotatura + sPocketing = nil end - end - -- 2021.09.17 Su conferma di Fabio Squaratti, se la gola è più streta dell'utensile o la profondità della gole è maggiore - -- del valore parametro SIDEDEPTH (preso dalle note utente dell'utensile) allora si prosegue come se non fosse abilitata - -- questo tipo di lavorazione SideMillAsBlade - if dDiam >= dThickMillOnSide and dFacElev < dMaxDepthOnSide + 10 * GEO.EPS_SMALL then - bSpecialMillOnSide = true - -- disabilito eventulae svuotatura - sPocketing = nil end end end diff --git a/LuaLibs/ProcessStepJointNotch.lua b/LuaLibs/ProcessStepJointNotch.lua index 7a4ce7e..23a2296 100644 --- a/LuaLibs/ProcessStepJointNotch.lua +++ b/LuaLibs/ProcessStepJointNotch.lua @@ -1,4 +1,4 @@ --- ProcessStepJointNotch.lua by Egaltech s.r.l. 2021/03/21 +-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2021/09/22 -- Gestione calcolo tacca a gradino per Travi -- Tabella per definizione modulo @@ -39,7 +39,6 @@ function ProcessStepJointNotch.Classify( Proc) -- se faccia limite la salto if AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then -- attualmente non gestita --- return false, false -- altrimenti faccia principale elseif vtN:getZ() < -0.1 then bDown = true @@ -53,8 +52,15 @@ local function MachineByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Solid, -- delta negativo affondamento lama local dExtraUp = -0.3 + -- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -30deg) + local bTopHead = ( BD.DOWN_HEAD and vtN[nBigInd]:getZ() > -0.1) + local bDownHead = ( BD.DOWN_HEAD and vtN[nBigInd]:getZ() < 0.1) -- recupero la lavorazione - local sCutting = ML.FindCutting( 'HeadSide') + local sCutting = ML.FindCutting( 'HeadSide' .. EgtIf( bDownHead, '_H2', '')) + if not sCutting and bTopHead then + sCutting = ML.FindCutting( sCutType) + bDownHead = false + end if not sCutting then local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) @@ -108,13 +114,13 @@ local function MachineByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Solid, local bFront = ( ptC[k]:getY() < ptPs:getY()) nOrthoOpposite = EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT) else - local bOver = true + local bOver = ( vtN[nBigInd]:getZ() > -0.1) nOrthoOpposite = EgtIf( bOver, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_TOP) end -- lavoro la faccia for j = 1, #vCuts[i] do local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra) - local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, EgtIf( bDownHead, -2, nil), dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) if not bOk then return bOk, sErr end @@ -151,7 +157,15 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF -- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]) end - local sPocketing = ML.FindPocketing( sMchFind, dDiamTool, dElev + dCollSic) + -- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -30deg) + local bTopHead = ( BD.DOWN_HEAD and vtN[nFaceRef]:getZ() > -0.1) + local bDownHead = ( BD.DOWN_HEAD and vtN[nFaceRef]:getZ() < 0.1) + -- recupero la lavorazione + local sPocketing = ML.FindPocketing( sMchFind.. EgtIf( bDownHead, '_H2', ''), dDiamTool, dElev + dCollSic) + if not sPocketing and bTopHead then + sPocketing = ML.FindPocketing( sMchFind, dDiamTool, dElev + dCollSic) + bDownHead = false + end if not sPocketing then local sErr = 'Error : pocketing not found in library' EgtOutLog( sErr) @@ -250,13 +264,16 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, end end end + -- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -30deg) + local bTopHead = ( BD.DOWN_HEAD and vtN[nBigInd]:getZ() > -0.1) + local bDownHead = ( BD.DOWN_HEAD and vtN[nBigInd]:getZ() < 0.1) + -- scelta lavorazione local sMilling - if nUseRoughTool > 0 then - sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidMstr) - else - sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidMstr) + local sTypeMill = EgtIf( nUseRoughTool > 0, 'Long2Cut', 'LongSmallCut') + sMilling = ML.FindMilling( sTypeMill .. EgtIf( bDownHead, '_H2', ''), nil, sTuuidMstr) + if not sMilling and bTopHead then + sMilling = ML.FindMilling( sTypeMill, nil, sTuuidMstr) end - if not sMilling then local sErr = 'Error : milling not found in library' EgtOutLog( sErr) @@ -295,6 +312,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, -- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2, - dTDiam / 2)) EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2, - dTDiam / 2)) + -- attacchi e uscite lineari con parte tg nulla + EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR) + EgtSetMachiningParam( MCH_MP.LITANG, 0) + EgtSetMachiningParam( MCH_MP.LIPERP, 20) + EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI) -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError()