diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index e94b7ed..4a5ef2c 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -302,9 +302,9 @@ end ------------------------------------------------------------------------------------------------------------- local function IsTailFeature( Proc, b3Raw, dCurrOvmH) - -- feature sempre di testa o coda per il gruppo + -- feature sempre di testa o coda per il gruppo (se non troppo lunga) if Proc.Grp == 1 or Proc.Grp == 2 then - return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) + return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH and Proc.Box:getDimX() < BD.MAX_LEN_HTFEA) end -- feature sempre di testa o coda nonostante il gruppo if ( Proc.Grp == 3 or Proc.Grp == 4) and diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 22ae9fa..7d65707 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,8 +1,9 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2021/02/03 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/02/04 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. -- 2021/02/03 Corretto riconoscimento feature di coda. +-- 2021/02/04 Razionalizzata gestione forzatura lama. Corretta gestione diametro minimo utensile per svuotatura. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -23,18 +24,18 @@ local BD = require( 'BeamData') local ML = require( 'MachiningLib') -- variabili assegnazione parametri Q -local sForceUseBlade = '' -- i -local sDepthChamferMill = '' -- d -local sPreemptiveChamfer = '' -- i -local sUseMill = '' -- i -local sUseRoughTool = '' -- i -local sUseRoughToolWithBAxis90 = '' -- i -local sUseRoughToolWithBAxis0 = '' -- i -local sInsertBoreOnCorner = '' -- 1 -local sMakeContourWithSmallTool = '' -- i -local sMakeOnlyContourOrFullPocket = '' -- i -local sMakeBySideRoughTool = '' -- i -local sAntisplintMode = '' -- i +local Q_FORCE_BLADE = '' -- i +local Q_DEPTH_CHAMFER = '' -- d +local Q_ONLY_CHAMFER = '' -- i +local Q_USE_MILL = '' -- i +local Q_USE_ROUGH_TOOL = '' -- i +local Q_USE_ROUGH_TOOL_B90 = '' -- i +local Q_USE_ROUGH_TOOL_B0 = '' -- i +local Q_BORE_ON_CORNER = '' -- 1 +local Q_CONTOUR_SMALL_TOOL = '' -- i +local Q_ONLY_CONTOUR = '' -- i +local Q_SIDE_ROUGH_TOOL = '' -- i +local Q_ANTISPLINT_TYPE = '' -- i -- variabile smussi local bMadeChamfer @@ -59,48 +60,76 @@ function ProcessLapJoint.Identify( Proc) end --------------------------------------------------------------------- -local function AssignQValues( Proc) +local function AssignQIdent( Proc) - -- reset delle variabili assegnazione parametri Q - sForceUseBlade = '' - sDepthChamferMill = '' - sPreemptiveChamfer = '' - sUseMill = '' - sUseRoughTool = '' - sUseRoughToolWithBAxis90 = '' - sUseRoughToolWithBAxis0 = '' - sInsertBoreOnCorner = '' - sMakeContourWithSmallTool = '' - sMakeOnlyContourOrFullPocket = '' - sMakeBySideRoughTool = '' - sAntisplintMode = '' + -- reset assegnazione parametri Q + Q_FORCE_BLADE = '' + Q_DEPTH_CHAMFER = '' + Q_ONLY_CHAMFER = '' + Q_USE_MILL = '' + Q_USE_ROUGH_TOOL = '' + Q_USE_ROUGH_TOOL_B90 = '' + Q_USE_ROUGH_TOOL_B0 = '' + Q_BORE_ON_CORNER = '' + Q_CONTOUR_SMALL_TOOL = '' + Q_ONLY_CONTOUR = '' + Q_SIDE_ROUGH_TOOL = '' + Q_ANTISPLINT_TYPE = '' if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then - sForceUseBlade = 'Q01' -- i - sDepthChamferMill = 'Q04' -- d - sPreemptiveChamfer = 'Q05' -- i + Q_FORCE_BLADE = 'Q01' -- i + Q_DEPTH_CHAMFER = 'Q04' -- d + Q_ONLY_CHAMFER = 'Q05' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then - sDepthChamferMill = 'Q01' -- d - sPreemptiveChamfer = 'Q02' -- i + Q_DEPTH_CHAMFER = 'Q01' -- d + Q_ONLY_CHAMFER = 'Q02' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20 then - sDepthChamferMill = 'Q01' -- d - sUseMill = 'Q02' -- i - sUseRoughTool = 'Q03' -- i - sUseRoughToolWithBAxis90 = 'Q04' -- i - sUseRoughToolWithBAxis0 = 'Q05' -- i - sInsertBoreOnCorner = 'Q06' -- i + Q_DEPTH_CHAMFER = 'Q01' -- d + Q_USE_MILL = 'Q02' -- i + Q_USE_ROUGH_TOOL = 'Q03' -- i + Q_USE_ROUGH_TOOL_B90 = 'Q04' -- i + Q_USE_ROUGH_TOOL_B0 = 'Q05' -- i + Q_BORE_ON_CORNER = 'Q06' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25 then - sInsertBoreOnCorner = 'Q01' -- i + Q_BORE_ON_CORNER = 'Q01' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then - sMakeContourWithSmallTool = 'Q01' -- i - sMakeOnlyContourOrFullPocket = 'Q02' -- i - sMakeBySideRoughTool = 'Q03' -- i - sAntisplintMode = 'Q06' -- i - sDepthChamferMill = 'Q07' -- d + Q_CONTOUR_SMALL_TOOL = 'Q01' -- i + Q_ONLY_CONTOUR = 'Q02' -- i + Q_SIDE_ROUGH_TOOL = 'Q03' -- i + Q_ANTISPLINT_TYPE = 'Q06' -- i + Q_DEPTH_CHAMFER = 'Q07' -- d elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then - sMakeBySideRoughTool = 'Q01' -- i + Q_SIDE_ROUGH_TOOL = 'Q01' -- i end - -- le altre features gestite non hanno parametri Q nei parametri globali + -- le altre features gestite non hanno parametri Q +end + +--------------------------------------------------------------------- +local function EvaluateQParam( Proc) + -- verifico che lo smusso sia richiesto + local nChamfer = 0 + local dDepth = EgtGetInfo( Proc.Id, Q_DEPTH_CHAMFER, 'd') or 0 + if dDepth > 0 then + nChamfer = 1 + end + -- verifico se posso fare solo lo smusso + if EgtGetInfo( Proc.Id, Q_ONLY_CHAMFER, 'i') == 1 then + if dDepth > 0 then + nChamfer = nChamfer + 1 + -- altrimenti se non ho l'affondamento esco + else + local sErr = 'Error : no chamfer depth' + EgtOutLog( sErr) + return -1, dDepth, sErr + end + end + -- verifico se devo usare lama invece della sega-catena + local bForceUseBlade = false + if #Q_FORCE_BLADE > 0 and EgtGetInfo( Proc.Id, Q_FORCE_BLADE, 'i') == 1 then + bForceUseBlade = true + end + + return nChamfer, dDepth, sErr, bForceUseBlade end --------------------------------------------------------------------- @@ -229,7 +258,7 @@ local function VerifyIfByBHSideMill( Proc) local sMilling local dMaxMat = 10 -- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco esco - local nUseSideTool = EgtGetInfo( Proc.Id, sMakeBySideRoughTool, 'i') or 0 + local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 if Proc.Prc ~= 37 and nUseSideTool == 0 then return false end @@ -431,7 +460,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw) end end -- in base al tipo di feature attribuisco il significato dei parametri Q - AssignQValues( Proc) + AssignQIdent( Proc) -- se può essere fatto con utensile tipo lama local bUseBHSideMill, bHead = VerifyIfByBHSideMill( Proc) if bUseBHSideMill then @@ -693,7 +722,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) -- predispongo lavorazione local sMilling -- verifico il parametro Q per uso fresa - local nUseRM = EgtGetInfo( Proc.Id, sUseMill, 'i') + local nUseRM = EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') if nUseRM and nUseRM == 1 then sMilling = ML.FindMilling( 'LongSmallCut') else @@ -890,7 +919,7 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, nCha end --------------------------------------------------------------------- -local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dElev, bSpecialApp, sMillMaster, nFacInd2, dFacElev2) +local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dElev, dCollSic, bSpecialApp, sMillMaster, nFacInd2, dFacElev2) -- Cerco una faccia adiacente alla principale sul lato lungo local nFacAdj, sErr = GetFaceAdj( Proc, nFacInd, dH, dV, true) if nFacAdj < 0 then @@ -955,7 +984,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV end end -- Se massimo materiale utensile è molto inferiore dell'elevazione non faccio la lavorazione e do un warning - if dMaxMat > 0 and dMaxMat + 15 < dElev then + if dMaxMat > 0 and dMaxMat + 15 < dElev + dCollSic then sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' ,skipped milling; elevation bigger than max tool depth' return true, sWarn, dMaxMat end @@ -2244,36 +2273,6 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw) return bMadeASbyBld, sWarn, nIdMach, dSawThick end ---------------------------------------------------------------------- -local function EvaluateQParam( Proc, bMakeVertCham, sDephtCham, sOnlyCham, sUseBlade) - local nChamfer = 0 - local bForceUseBlade = false - local sErr - -- verifico che lo smusso sia richiesto - local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 - if dDepth > 0 then - nChamfer = 1 - end - -- verifico se posso fare solo lo smusso - if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then - if dDepth > 0 then - nChamfer = nChamfer + 1 - -- altrimenti se non ho l'affondamento esco - else - sErr = 'Error : no chamfer depth' - EgtOutLog( sErr) - return -1, dDepth, sErr - end - end - -- verifico se devo usare lama invece della sega-catena - -- 2020-03-20 forzata abilitazione uso lama se parametro Q non è presente - if #sUseBlade == 0 or EgtGetInfo( Proc.Id, sUseBlade, 'i') == 1 then - bForceUseBlade = true - end - - return nChamfer, dDepth, sErr, bForceUseBlade -end - --------------------------------------------------------------------- local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng) @@ -3032,7 +3031,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end -- verifico se sono presenti i parametri Q per la profondità smusso e -- per eseguire in esclusiva solo lo smusso - local nChamfer, dDepthCham, sErrCham, bForceUseBlade = EvaluateQParam( Proc, false, sDepthChamferMill, sPreemptiveChamfer, sForceUseBlade) + local nChamfer, dDepthCham, sErrCham, bForceUseBlade = EvaluateQParam( Proc) -- se non posso lavorare la feature perché condizionata dall'esecuzione del solo chamfer -- genero errore e non faccio nulla if nChamfer < 0 then @@ -3192,7 +3191,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- Recupero la lavorazione di svuotatura local sMchFind = 'Pocket' -- se forzato uso truciolatore - if EgtGetInfo( Proc.Id, sUseRoughTool, 'i') == 1 then + if EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') == 1 then sMchFind = 'OpenPocket' end local dDiam = min( dH, dV) @@ -3223,7 +3222,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local dDiamTool = 20 if bIsL then local bOk, sErr - bOk, sWarn, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, true, sMilling, nFacInd2, dFacElev2) + bOk, sWarn, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, dCollSic, true, sMilling, nFacInd2, dFacElev2) if not bOk then return bOk, sWarn end else local sErr = 'Error : Impossible mill special LapJoint' @@ -3266,12 +3265,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end end -- se abilitato dal parametro Q inserisco foro sullo spigolo - if EgtGetInfo( Proc.Id, sInsertBoreOnCorner, 'i') == 1 then + if EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 1 then local bOk bOk, sWarn = MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, 0, nAddGrpId, dDiamTool, true) if not bOk then return false, sWarn end -- altrimenti se abilitato dal parametro Q inserisco percorso di pulitura - elseif EgtGetInfo( Proc.Id, sInsertBoreOnCorner, 'i') == 2 then + elseif EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 2 then local bOk bOk, sWarn = MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, 0, nAddGrpId, dDiamTool) if not bOk then return false, sWarn end @@ -3360,7 +3359,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- se processo 20 e non sto usando il truciolatore if bNewCheck and Proc.Prc == 20 and nUseRoughTool == 0 then -- verifico se forzato uso truciolatore - nUseRT = EgtGetInfo( Proc.Id, sUseRoughTool, 'i') + nUseRT = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') if nUseRT and nUseRT ~= 0 then sMchFind = 'OpenPocket' nUseRoughTool = 1 @@ -3370,7 +3369,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- se processo 30 e non sto usando il truciolatore if bNewCheck and Proc.Prc == 30 and nUseRoughTool == 0 then -- verifico se forzato uso truciolatore - nUseRT = EgtGetInfo( Proc.Id, sMakeBySideRoughTool, 'i') + nUseRT = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') if nUseRT and nUseRT ~= 0 then sMchFind = 'OpenPocket' nUseRoughTool = 1 @@ -3381,8 +3380,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa sMchFindBackUp = sMchFind --ottengo un diametro utensile opportuno dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool) - if not dDiam and nUseRoughTool == 0 then - sMchFind = 'OpenPocket' + if not dDiam then + if nUseRoughTool == 0 then + sMchFind = 'OpenPocket' + end dDiam = min( dH, dV) end end @@ -3410,12 +3411,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- se non trovata verifico affondamento if not sPocketing and nUseRoughTool == 0 then local sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind, dDiam) - if sMyPocketing and dMyTMaxDepth > 0.8 * dFacElev + dCollSic then + if sMyPocketing and ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic or bIsL) then sPocketing = sMyPocketing end end - -- se feature 16 e forzata lama e forma ad U, annulla la svuotatura - if Proc.Prc == 16 and bForceUseBlade and Proc.Fct == 3 and bIsU then + -- se forzata lama e forma ad U, annulla la svuotatura + if bForceUseBlade and Proc.Fct == 3 and bIsU then sPocketing = nil end -- se non trova una svuotatura adatta @@ -3424,14 +3425,14 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if bIsL then -- se smusso non è esclusivo if nChamfer < 2 then - return MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev) + return MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, dCollSic) end -- altrimenti, in base alla forma, provo con svuotature di fianco o con la sega a catena o lama else local bTryWithBlades = true local nOk, bOk, sStat, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces - -- se feature 16 e abilitato il parametro Q01 (=1) provo prima con la lama e poi con la fresa - if Proc.Prc == 16 and bForceUseBlade then + -- se forzata lama provo prima con questa e poi con la fresa + if bForceUseBlade then -- Se la svuotatura precedente non è stata fatta e smusso non è esclusivo, provo con le lame if bTryWithBlades and nChamfer < 2 then bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, @@ -3566,7 +3567,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- se richiesti antischeggia con lama su U trasversale e smusso non esclusivo -- rimane da gestire: se da eseguire con fresa o se richiesto lama ma impossibile utilizzarla, si utilizza fresa local bMadeASbyBld = false - if nChamfer < 2 and EgtGetInfo( Proc.Id, sAntisplintMode, 'i') == 1 and ( bIsU or bIsL) and + if nChamfer < 2 and EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1 and ( bIsU or bIsL) and ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1) then local nNumFac = EgtIf( bIsU, 2, 1) local nPrefSide = 1 -- di preferenza il motore è meglio tenerlo sinistra @@ -3697,17 +3698,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end end -- se abilitato dal parametro Q inserisco foro sullo spigolo - if EgtGetInfo( Proc.Id, sInsertBoreOnCorner, 'i') == 1 then + if EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 1 then local bOk bOk, sWarn = MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool) if not bOk then return false, sWarn end -- altrimenti se abilitato dal parametro Q inserisco percorso di pulitura - elseif EgtGetInfo( Proc.Id, sInsertBoreOnCorner, 'i') == 2 then + elseif EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 2 then local bOk bOk, sWarn = MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool) if not bOk then return false, sWarn end -- altrimenti se abilitato dal parametro Q inserisco contorno con fresa più piccola - elseif EgtGetInfo( Proc.Id, sMakeContourWithSmallTool, 'i') == 1 then + elseif EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') == 1 then local bOk bOk, sWarn = MakeContourCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool) if not bOk then return false, sWarn end @@ -3774,16 +3775,16 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) -- in base al tipo di feature attribuisco il significato dei parametri Q - AssignQValues( Proc) - -- verifico forzatura lama - local bForcedBlade = EgtGetInfo( Proc.Id, sUseRoughTool, 'i') ~= 1 and EgtGetInfo( Proc.Id, sUseMill, 'i') ~= 1 + AssignQIdent( Proc) + -- se non forzate frese, uso la lama + local bUseBlade = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1 -- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature - if bForcedBlade and Proc.Prc == 30 then - local nBladeAntisplint = EgtGetInfo( Proc.Id, sAntisplintMode, 'i') or 0 - local nUseRoughToolOnSide = EgtGetInfo( Proc.Id, sMakeBySideRoughTool, 'i') or 0 + if bUseBlade and Proc.Prc == 30 then + local nBladeAntisplint = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0 + local nUseRoughToolOnSide = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 -- se antischeggia di fresa o abilitato sgrossatore di fianco if nBladeAntisplint == 2 or nUseRoughToolOnSide == 1 then - bForcedBlade = false + bUseBlade = false end end -- se lunghezza richiede spezzatura @@ -3798,8 +3799,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD) if abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 50 then -- leggo i parametri Q per utilizzare la fresa di fianco e/o lama - local nUseSideTool = EgtGetInfo( Proc.Id, sMakeBySideRoughTool, 'i') or 0 - local bUseBlade = EgtGetInfo( Proc.Id, sAntisplintMode, 'i') == 1 + local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 + local bUseBlade = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1 return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) elseif b3Fac1:getDimX() < 1 then -- la faccia 0 deve essere quella lunga @@ -3808,7 +3809,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) elseif b3Fac2:getDimX() < 1 then return LongCut.Make( Proc, nPhase, nRawId, nPartId) else - if bForcedBlade then + if bUseBlade then return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide') else return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) @@ -3824,7 +3825,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- una faccia if Proc.Fct == 1 then -- se piccola, con fresa - if not bForcedBlade and ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then + if not bUseBlade and ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId) -- altrimenti, con lama else @@ -3835,7 +3836,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- determino l'angolo tra le facce local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT) -- se ortogonali e non forzata lama, con fresa - if not bForcedBlade and bAdj and abs( dAng + 90) < 1 then + if not bUseBlade and bAdj and abs( dAng + 90) < 1 then -- se piccole if ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) @@ -3863,7 +3864,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2) -- verifico se sono presenti i parametri Q per la profondità smusso e -- per eseguire in esclusiva solo lo smusso - local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc, false, sDepthChamferMill, sPreemptiveChamfer, sForceUseBlade) + local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc) if (Proc.Fct == 2 and bIsL) and nChamfer > 0 then local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId) local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 7265ca9..9e4a704 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1,5 +1,6 @@ --- ProcessLongCut.lua by Egaltech s.r.l. 2021/01/14 +-- ProcessLongCut.lua by Egaltech s.r.l. 2021/02/04 -- Gestione calcolo taglio longitudinale per Travi +-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale. -- Tabella per definizione modulo local ProcessLongCut = {} @@ -653,7 +654,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade) -- imposto posizione braccio porta testa per non ingombrare agli estremi EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- imposto uso faccia - EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN) + local nUseFace = MCH_MILL_FU.PARAL_DOWN + if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nUseFace = MCH_MILL_FU.PARAL_BACK end + EgtSetMachiningParam( MCH_MP.FACEUSE, nUseFace) -- imposto lato di lavoro e inversione EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.INVERT, true)