From d88dea71d8a8f98519a1c1def63582e45db72f1f Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 11 Apr 2023 09:41:01 +0200 Subject: [PATCH 1/5] Commit modifiche parziali, in LongCut: - funzione GetSCC per trovare la direzione SCC ottimale in tutti i casi - da aggiungere casi per Turn in GetSCC - da aggiungere gestione Invert e WS in tutti i casi, per poter usare la funzione GetSCC --- LuaLibs/ProcessLongCut.lua | 143 ++++++++++++++++++++++++++++++++----- 1 file changed, 125 insertions(+), 18 deletions(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 3f79280..8de28bc 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -62,6 +62,117 @@ function ProcessLongCut.Classify( Proc) return true, false end +--------------------------------------------------------------------- +-- Scelta posizione braccio +function ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowardsHead, bIsTopBlade, nFaceUse, sMachining, bInvert) + + -- funzione per recuperare l'UUID utensile dalla lavorazione + local function GetToolUUID( sMachining) + if EgtMdbSetCurrMachining( sMachining) then + local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + end + end + + -- funzione per calcolare i versori caratteristici di una feature + local function GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert) + local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT) + if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then + local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small' + EgtOutLog( sWarn, 1) + return true, '' + end + local vtTg = ptP2 - ptP1 ; vtTg:normalize() + local dAllStart = 0 + local dAllEnd = 0 + -- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo + if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then + local vtTg1 = ptPm - ptP1 ; vtTg1:normalize() + local vtTg2 = ptP2 - ptPm ; vtTg2:normalize() + local dDist1 = dist( ptP1, ptPm) + local dDist2 = dist( ptP2, ptPm) + local dCosMax = 0.951 -- cos( 18°) + local dLenMin = 30 + local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin) + --if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then + if vtTg1 * vtTg2 < dCosMax then + local dOrtho1 = abs( vtTg1 * vtOrthO) + local dOrtho2 = abs( vtTg2 * vtOrthO) + if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then + if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then + ptP2 = Point3d( ptPm) + dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL + end + else + if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then + ptP1 = Point3d( ptPm) + dAllStart = - dDist1 - 10 * GEO.EPS_SMALL + end + end + vtTg = ptP2 - ptP1 ; vtTg:normalize() + end + end + local bWsRight = ( not bInvert) + local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT) + -- Versore di riferimento + local vtRef = Vector3d( vtTg) + vtRef:rotate( vtN, EgtIf( bInvert, -90, 90)) + -- Versore esterno + local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize() + -- Versore ausiliario (direzione braccio) + local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize() + vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90)) + if vtAux:isSmall() then + vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize() + else + if abs( vtAux * vtOut) < GEO.EPS_SMALL then + if abs( vtTg:getZ()) > 0.5 then + if vtAux * vtRef < 0 then + vtAux = - vtAux + end + elseif vtAux * vtTg > 0 then + vtAux = - vtAux + end + elseif vtAux * vtOut < 0 then + vtAux = - vtAux + end + end + EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3) + return vtAux, vtRef, vtOut, vtTg + end + + local nSCC + local sToolUUID = GetToolUUID( sMachining) + local bIsBlade + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sToolUUID) or '') then + bIsBlade = ( ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0) + end + + -- calcolo posizione braccio + -- se Fast e asse utensile diretto come Z posiziono l'aggregato in Y per avere il minore ingombro possibile + if not BD.C_SIMM and not BD.TURN and BL.AreSameVectorsApprox( vtN, Z_AX()) then + nSCC = MCH_SCC.ADIR_YM + -- se Fast o Turn posiziono l'aggregato in X per ottimizzare il pinzaggio + elseif not BD.C_SIMM then + if bAreCuttingStepsTowardsHead then + nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + else + nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + end + -- per PF o simili e lama senza aggregato o fresa non do alcuna preferenza + elseif ( bIsBlade and not bIsTopBlade) or not bIsBlade then + nSCC = MCH_SCC.NONE + -- per PF o simili e lama con aggregato lo posiziono in Y per stare il più lontano possibile dalla trave + else + local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert) + if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then + nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + else + nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + end + + end + +end ----------------------------------------------------------------------------------------------- local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, bForcedLim, dDistToMachine, bUnderDir) if ( not BD.DOWN_HEAD or not BD.TURN) and nSide == -1 then @@ -869,7 +980,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- inserisco tagli di lama for i = 1, nC do -- Posizione braccio portatesta - local nSCC = EgtIf( ( BD.C_SIMM or not ( i == 1 or i == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + --local nSCC = EgtIf( ( BD.C_SIMM or not ( i == 1 or i == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) -- ciclo sulle passate local dLioTang = 0 for k = 1, 2 do @@ -1022,6 +1133,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp) + + --- TEST + local bAreCuttingStepsTowardsHead = true + --- TEST + local nSCC = ProcessLongCut.GetSCC( Proc, 0, i, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent, nFaceUse, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), bInvert) + -- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) -- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then @@ -1184,17 +1301,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus local nM = 0 local nCountMilHead = 0 for i = 1, nC do - -- Posizione braccio portatesta - local nSCC - if not BD.TURN then - if bFront then - nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) - else - nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - end - else - nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)) - end -- ciclo sulle passate local nO = 1 local dStep = 0 @@ -1239,6 +1345,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- imposto offset radiale EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA) + -- Posizione braccio portatesta + local nSCC = ProcessLongCut.GetSCC( Proc, 0, i, bAreCuttingStepsTowardsHead, nil, nFaceUse, sMilling, bInvert) + if BD.TURN then + nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)) + end -- imposto posizione braccio porta testa per non ingombrare agli estremi EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- imposto uso della faccia @@ -1605,13 +1716,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus local dSal = EgtIf( nPos == 1, -dEndDist, -dEndAccDist - ( nPos - 2) * dC + dOverLapExtend) local dEal = EgtIf( nPos == nC, -dStartDist, -dStartAccDist - ( nC - nPos - 1) * dC + dOverLapExtend) -- Posizione braccio portatesta - local nSCC + --local nSCC for k = 1, nPass do - if bFront then - nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) - else - nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - end + local nSCC = ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowardsHead, bIsTopBlade, nFaceUse, sMachining, bInvert) -- inserisco le parti di lavorazione nM = nM + 1 local sNameF = EgtIf( vnHead[k] ~= 2, sPrefix, sPrefixDn) .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM) From e3a42ec170cdb0f18b11c0c0d21822ab30b66cb4 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 11 Apr 2023 15:24:20 +0200 Subject: [PATCH 2/5] - alcune correzioni - gestiti casi inversione e workside per fresa - rimane ancora da gestire la direzione di lavoro con bAreCuttingStepsTowardsHead --- LuaLibs/ProcessLongCut.lua | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 8de28bc..4d407d0 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -70,6 +70,7 @@ function ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowa local function GetToolUUID( sMachining) if EgtMdbSetCurrMachining( sMachining) then local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + return sToolUUID end end @@ -169,9 +170,9 @@ function ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowa else nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) end - end - + + return nSCC end ----------------------------------------------------------------------------------------------- local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, bForcedLim, dDistToMachine, bUnderDir) @@ -1338,14 +1339,35 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, 0}}) + + EgtMdbSetCurrMachining( sMilling) + local bIsCurrentMillCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 + local bInvert = not bIsCurrentMillCCW + + -- setto workside e eventuale inversione + if bInvert then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, false) + end -- limito opportunamente la lavorazione local dSal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC) - EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) + if bInvert then + dSal, dEal = dEal, dSal + end + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- imposto offset radiale EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA) -- Posizione braccio portatesta + + -- TEST -- + local bAreCuttingStepsTowardsHead = true + -- TEST -- + local nSCC = ProcessLongCut.GetSCC( Proc, 0, i, bAreCuttingStepsTowardsHead, nil, nFaceUse, sMilling, bInvert) if BD.TURN then nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)) From 3376f50024aa9ee86fe2be75d453da25382273f6 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 12 Apr 2023 18:17:46 +0200 Subject: [PATCH 3/5] - LongCut completa, manca solamente integrazione Turn nella funzione GetSCC - varie migliorie --- .gitignore | 1 + LuaLibs/ProcessLongCut.lua | 222 ++++++++++++++++++------------------- 2 files changed, 111 insertions(+), 112 deletions(-) diff --git a/.gitignore b/.gitignore index aece050..4789404 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /bin/*.ini /bin/LuaLibs/*.lua /bin/Images/*.png +.vscode/settings.json diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 4d407d0..95695fc 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -63,94 +63,98 @@ function ProcessLongCut.Classify( Proc) end --------------------------------------------------------------------- --- Scelta posizione braccio -function ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowardsHead, bIsTopBlade, nFaceUse, sMachining, bInvert) - - -- funzione per recuperare l'UUID utensile dalla lavorazione - local function GetToolUUID( sMachining) - if EgtMdbSetCurrMachining( sMachining) then - local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) - return sToolUUID - end +-- Estrazione dell'UUID utensile di una lavorazione +function GetToolUUID( sMachining) + if EgtMdbSetCurrMachining( sMachining) then + local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + return sToolUUID end - - -- funzione per calcolare i versori caratteristici di una feature - local function GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert) - local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT) - if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then - local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small' - EgtOutLog( sWarn, 1) - return true, '' - end - local vtTg = ptP2 - ptP1 ; vtTg:normalize() - local dAllStart = 0 - local dAllEnd = 0 - -- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo - if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then - local vtTg1 = ptPm - ptP1 ; vtTg1:normalize() - local vtTg2 = ptP2 - ptPm ; vtTg2:normalize() - local dDist1 = dist( ptP1, ptPm) - local dDist2 = dist( ptP2, ptPm) - local dCosMax = 0.951 -- cos( 18°) - local dLenMin = 30 - local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin) - --if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then - if vtTg1 * vtTg2 < dCosMax then - local dOrtho1 = abs( vtTg1 * vtOrthO) - local dOrtho2 = abs( vtTg2 * vtOrthO) - if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then - if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then - ptP2 = Point3d( ptPm) - dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL - end - else - if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then - ptP1 = Point3d( ptPm) - dAllStart = - dDist1 - 10 * GEO.EPS_SMALL - end - end - vtTg = ptP2 - ptP1 ; vtTg:normalize() +end + +--------------------------------------------------------------------- +-- Calcolo dei versori caratteristici della feature +function GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining) + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT) + local vtOrthO = BL.GetVersRef( nFaceUse) + local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( Proc.Id, nFacet, vtOrthO, GDB_ID.ROOT) + local vtTg = ptP2 - ptP1 ; vtTg:normalize() + local dAllStart = 0 + local dAllEnd = 0 + -- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo + if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then + local vtTg1 = ptPm - ptP1 ; vtTg1:normalize() + local vtTg2 = ptP2 - ptPm ; vtTg2:normalize() + local dDist1 = dist( ptP1, ptPm) + local dDist2 = dist( ptP2, ptPm) + local dCosMax = 0.951 -- cos( 18°) + local dLenMin = 30 + local dToolDiam = 400 + if EgtMdbSetCurrMachining( sMachining) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam end end - local bWsRight = ( not bInvert) - local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT) - -- Versore di riferimento - local vtRef = Vector3d( vtTg) - vtRef:rotate( vtN, EgtIf( bInvert, -90, 90)) - -- Versore esterno - local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize() - -- Versore ausiliario (direzione braccio) - local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize() - vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90)) - if vtAux:isSmall() then - vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize() - else - if abs( vtAux * vtOut) < GEO.EPS_SMALL then - if abs( vtTg:getZ()) > 0.5 then - if vtAux * vtRef < 0 then - vtAux = - vtAux - end - elseif vtAux * vtTg > 0 then + local dLenMax = max( 0.5 * dToolDiam * 0.17365 + 1, 2 * dLenMin) + --if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then + if vtTg1 * vtTg2 < dCosMax then + local dOrtho1 = abs( vtTg1 * vtOrthO) + local dOrtho2 = abs( vtTg2 * vtOrthO) + if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then + if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then + ptP2 = Point3d( ptPm) + dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL + end + else + if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then + ptP1 = Point3d( ptPm) + dAllStart = - dDist1 - 10 * GEO.EPS_SMALL + end + end + vtTg = ptP2 - ptP1 ; vtTg:normalize() + end + end + local bWsRight = ( not bInvert) + -- Versore di riferimento + local vtRef = Vector3d( vtTg) + vtRef:rotate( vtN, EgtIf( bInvert, -90, 90)) + -- Versore esterno + local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize() + -- Versore ausiliario (direzione braccio) + local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize() + vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90)) + if vtAux:isSmall() then + vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize() + else + if abs( vtAux * vtOut) < GEO.EPS_SMALL then + if abs( vtTg:getZ()) > 0.5 then + if vtAux * vtRef < 0 then vtAux = - vtAux end - elseif vtAux * vtOut < 0 then + elseif vtAux * vtTg > 0 then vtAux = - vtAux end + elseif vtAux * vtOut < 0 then + vtAux = - vtAux end - EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3) - return vtAux, vtRef, vtOut, vtTg end - - local nSCC + EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3) + return vtAux, vtRef, vtOut, vtTg +end + +--------------------------------------------------------------------- +-- Calcolo posizione braccio +function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCuttingStep, nC, bAreCuttingStepsTowardsHead, bIsTopBlade) + local nSCC = MCH_SCC.NONE + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT) local sToolUUID = GetToolUUID( sMachining) local bIsBlade if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sToolUUID) or '') then bIsBlade = ( ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0) end - -- calcolo posizione braccio -- se Fast e asse utensile diretto come Z posiziono l'aggregato in Y per avere il minore ingombro possibile - if not BD.C_SIMM and not BD.TURN and BL.AreSameVectorsApprox( vtN, Z_AX()) then + if not BD.C_SIMM and not BD.TURN and AreSameVectorApprox( vtN, Z_AX()) then nSCC = MCH_SCC.ADIR_YM -- se Fast o Turn posiziono l'aggregato in X per ottimizzare il pinzaggio elseif not BD.C_SIMM then @@ -875,7 +879,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus bFinishWithChainSaw = EgtIf ( ( EgtGetInfo( Proc.Id, 'Q05', 'i') or 0) == 1, true, false) end - local nFaceUse + local nFaceUse local nFaceUse2 -- se ho solo lama da sotto if bCanUseUnderBlade and not bCanUseBlade then @@ -947,7 +951,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- eventuale lavorazione della faccia limitante l'inizio if not bStartFixed then - local vtIni = -X_AX() + local vtIni = -X_AX() for j = 1, Proc.Fct - 1 do local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT) if vtIni * vtN > 0 and nCountMilHead < 2 then @@ -963,7 +967,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- eventuale lavorazione della faccia limitante la fine if not bEndFixed then - local vtFin = X_AX() + local vtFin = X_AX() for j = 1, Proc.Fct - 1 do local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT) if vtFin * vtN > 0 and nCountMilHead < 2 then @@ -980,8 +984,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- inserisco tagli di lama for i = 1, nC do - -- Posizione braccio portatesta - --local nSCC = EgtIf( ( BD.C_SIMM or not ( i == 1 or i == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) -- ciclo sulle passate local dLioTang = 0 for k = 1, 2 do @@ -997,7 +999,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus bAddOpposite = false end -- faccio in modo di calcolare il valore perpendicolare solo sulla faccia da sotto nel secondo passo o sulla faccia di fianco nel primo passo - if nSide == 1 or ( nSide == -1 and k == 1) or ( abs(nSide) == 2 and k == 2) then + if nSide == 1 or ( nSide == -1 and k == 1) or ( abs(nSide) == 2 and k == 2) then bAddOpposite = false end if bAddOpposite then @@ -1118,6 +1120,15 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dSal, dEal = dEal, dSal end end + -- step sempre positivi + local bAreCuttingStepsTowardsHead = true + -- calcolo SCC + local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), nFaceUseCurrent, bInvert, i, nC, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent) + -- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) + -- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella + if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then + nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + end -- setto la lavorazione con i valori calcolati EgtSetMachiningParam( MCH_MP.INVERT, bInvert) @@ -1134,18 +1145,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp) - - --- TEST - local bAreCuttingStepsTowardsHead = true - --- TEST - local nSCC = ProcessLongCut.GetSCC( Proc, 0, i, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent, nFaceUse, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), bInvert) - - -- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) - -- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella - if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then - nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) - end - -- imposto posizione braccio porta testa per non ingombrare agli estremi + -- imposto posizione braccio porta testa EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo if not ML.ApplyMachining( true, false) then @@ -1327,24 +1327,21 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus EgtSetMachiningParam( MCH_MP.LIELEV, 0) EgtSetMachiningParam( MCH_MP.LITANG, 0) EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR) - EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20) + EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + ( BD.CUT_SIC or 20)) end elseif i == nC and not bEndFixed then if nO == 1 or EgtGetMachiningParam( MCH_MP.LOTANG) ~= 0 then EgtSetMachiningParam( MCH_MP.LOELEV, 0) EgtSetMachiningParam( MCH_MP.LOTANG, 0) EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR) - EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20) + EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + ( BD.CUT_SIC or 20)) end end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, 0}}) - EgtMdbSetCurrMachining( sMilling) - local bIsCurrentMillCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 - local bInvert = not bIsCurrentMillCCW - -- setto workside e eventuale inversione + local bInvert if bInvert then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) EgtSetMachiningParam( MCH_MP.INVERT, true) @@ -1363,12 +1360,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- imposto offset radiale EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA) -- Posizione braccio portatesta - - -- TEST -- - local bAreCuttingStepsTowardsHead = true - -- TEST -- - - local nSCC = ProcessLongCut.GetSCC( Proc, 0, i, bAreCuttingStepsTowardsHead, nil, nFaceUse, sMilling, bInvert) + local bAreCuttingStepsTowardsHead = ( nStartSide == 0) + local nSCC = ProcessLongCut.GetSCC( Proc, 0, sMilling, nFaceUse, bInvert, i, nC, bAreCuttingStepsTowardsHead, nil) if BD.TURN then nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)) end @@ -1452,8 +1445,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus sMilling = ML.FindMilling( sMchType) sPrefix = 'L2CS_' nExtendMach = nUseMillOnSide - if nUseMillOnSide == 2 then - bRemoveToolRadius = true + if nUseMillOnSide == 2 then + bRemoveToolRadius = true end -- se testa da sotto if nSide ~= 1 and BD.DOWN_HEAD then @@ -1740,7 +1733,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- Posizione braccio portatesta --local nSCC for k = 1, nPass do - local nSCC = ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowardsHead, bIsTopBlade, nFaceUse, sMachining, bInvert) -- inserisco le parti di lavorazione nM = nM + 1 local sNameF = EgtIf( vnHead[k] ~= 2, sPrefix, sPrefixDn) .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM) @@ -1752,22 +1744,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, 0}}) - -- imposto posizione braccio porta testa per non ingombrare agli estremi - EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- imposto uso faccia - local nUseFace = EgtIf( vnHead[k] ~= 2, MCH_MILL_FU.PARAL_DOWN, MCH_MILL_FU.PARAL_TOP) - if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nUseFace = MCH_MILL_FU.PARAL_BACK end - EgtSetMachiningParam( MCH_MP.FACEUSE, nUseFace) + local nFaceUse = EgtIf( vnHead[k] ~= 2, MCH_MILL_FU.PARAL_DOWN, MCH_MILL_FU.PARAL_TOP) + if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nFaceUse = MCH_MILL_FU.PARAL_BACK end + EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) -- imposto lato di lavoro e inversione + local bInvert if k == 1 then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - EgtSetMachiningParam( MCH_MP.INVERT, true) + bInvert = true else EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + bInvert = false dSal, dEal = dEal, dSal end + EgtSetMachiningParam( MCH_MP.INVERT, bInvert) -- limito opportunamente la lavorazione EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) @@ -1776,6 +1768,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- assegno attacco perpendicolare EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp1) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp1) + -- step sempre negativi + local bAreCuttingStepsTowardsHead = false + -- calcolo SCC + local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( vnHead[k] ~= 2, sMilling, sMillingDn), nFaceUse, bInvert, j, nC, bAreCuttingStepsTowardsHead, nil) + -- imposto posizione braccio porta testa + EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo if not ML.ApplyMachining( true, false) then -- se feature orientata su faccia da sotto provo a cambiare l'attacco From 81a12d2e988bab8d6b9a123c5d1312c9ed00d354 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 14 Apr 2023 18:48:37 +0200 Subject: [PATCH 4/5] - in LongCut aggiunta gestione Turn e tagli provenienti da ProcessCut --- LuaLibs/ProcessLongCut.lua | 51 +++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 95695fc..18437bb 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -144,7 +144,7 @@ end --------------------------------------------------------------------- -- Calcolo posizione braccio -function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCuttingStep, nC, bAreCuttingStepsTowardsHead, bIsTopBlade) +function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCuttingStep, nC, bAreCuttingStepsTowardsHead, bIsTopBlade, bCustUseBlade) local nSCC = MCH_SCC.NONE local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT) local sToolUUID = GetToolUUID( sMachining) @@ -152,28 +152,41 @@ function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCu if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sToolUUID) or '') then bIsBlade = ( ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0) end - + + -- se Turn posiziono la testa per creare il minor ingombro possibile + if BD.TURN then + if nFaceUse == MCH_MILL_FU.ORTHO_DOWN or ( ( nFaceUse == MCH_MILL_FU.PARAL_FRONT or nFaceUse == MCH_MILL_FU.PARAL_BACK) and vtN:getZ() > -GEO.EPS_SMALL) then + nSCC = MCH_SCC.ADIR_ZP + elseif nFaceUse == MCH_MILL_FU.ORTHO_TOP or ( nFaceUse == MCH_MILL_FU.PARAL_FRONT or nFaceUse == MCH_MILL_FU.PARAL_BACK) then + nSCC = MCH_SCC.ADIR_ZM + elseif nFaceUse == MCH_MILL_FU.ORTHO_FRONT or ( ( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP) and vtN:getY() > -GEO.EPS_SMALL) then + nSCC = MCH_SCC.ADIR_YP + elseif nFaceUse == MCH_MILL_FU.ORTHO_BACK or ( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP) then + nSCC = MCH_SCC.ADIR_YM + end -- se Fast e asse utensile diretto come Z posiziono l'aggregato in Y per avere il minore ingombro possibile - if not BD.C_SIMM and not BD.TURN and AreSameVectorApprox( vtN, Z_AX()) then + elseif not BD.C_SIMM and AreSameVectorApprox( vtN, Z_AX()) then nSCC = MCH_SCC.ADIR_YM - -- se Fast o Turn posiziono l'aggregato in X per ottimizzare il pinzaggio - elseif not BD.C_SIMM then + -- se Fast ( escluso caso speciale con taglio non passante e inclinato in X) posiziono l'aggregato in X per ottimizzare il pinzaggio + elseif not BD.C_SIMM and ( not ( bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL) or not bIsBlade) then if bAreCuttingStepsTowardsHead then nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) else nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) end - -- per PF o simili e lama senza aggregato o fresa non do alcuna preferenza - elseif ( bIsBlade and not bIsTopBlade) or not bIsBlade then - nSCC = MCH_SCC.NONE - -- per PF o simili e lama con aggregato lo posiziono in Y per stare il più lontano possibile dalla trave - else - local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert) - if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then + -- per PF o simili oppure se Fast ( caso speciale con taglio non passante e inclinato in X) e lama con aggregato lo posiziono per stare il più lontano possibile dalla trave + elseif ( bIsBlade and bIsTopBlade) or not BD.C_SIMM then + local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining) + if bCustUseBlade then + nSCC = EgtIf( ( nFaceUse == MCH_MILL_FU.ORTHO_TOP or nFaceUse == MCH_MILL_FU.ORTHO_FRONT) and vtN:getY() > -GEO.EPS_SMALL, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + elseif ( abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL) then nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) else nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) end + -- per PF o simili e lama senza aggregato o fresa non do alcuna preferenza + else + nSCC = MCH_SCC.NONE end return nSCC @@ -1123,12 +1136,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- step sempre positivi local bAreCuttingStepsTowardsHead = true -- calcolo SCC - local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), nFaceUseCurrent, bInvert, i, nC, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent) - -- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) - -- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella - if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then - nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) - end + local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), nFaceUseCurrent, bInvert, i, nC, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent, bCustUseBlade) -- setto la lavorazione con i valori calcolati EgtSetMachiningParam( MCH_MP.INVERT, bInvert) @@ -1361,10 +1369,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA) -- Posizione braccio portatesta local bAreCuttingStepsTowardsHead = ( nStartSide == 0) - local nSCC = ProcessLongCut.GetSCC( Proc, 0, sMilling, nFaceUse, bInvert, i, nC, bAreCuttingStepsTowardsHead, nil) - if BD.TURN then - nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)) - end + local nSCC = ProcessLongCut.GetSCC( Proc, 0, sMilling, nFaceUse, bInvert, i, nC, bAreCuttingStepsTowardsHead, nil, nil) -- imposto posizione braccio porta testa per non ingombrare agli estremi EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- imposto uso della faccia @@ -1771,7 +1776,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- step sempre negativi local bAreCuttingStepsTowardsHead = false -- calcolo SCC - local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( vnHead[k] ~= 2, sMilling, sMillingDn), nFaceUse, bInvert, j, nC, bAreCuttingStepsTowardsHead, nil) + local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( vnHead[k] ~= 2, sMilling, sMillingDn), nFaceUse, bInvert, j, nC, bAreCuttingStepsTowardsHead, nil, nil) -- imposto posizione braccio porta testa EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo From 47f716b3c13faf6fd4d3865a74b2e3e04f756448 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 17 Apr 2023 17:45:12 +0200 Subject: [PATCH 5/5] - commenti e piccole correzioni --- LuaLibs/ProcessLongCut.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 18437bb..bf8ea81 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -25,6 +25,7 @@ -- 2023/03/06 Correzione per i casi con lavorazione limitata. -- 2023/03/15 Modifica alla lavorazione ulteriore con sega a catena per togliere il codolo e lasciare solo dei punti di supporto. -- 2023/03/22 Correzione a SCC lama a seguito di modifiche alle direzioni dei tagli. +-- 2023/04/17 Gestione unificata SCC tramite funzione apposita GetSCC -- Tabella per definizione modulo local ProcessLongCut = {} @@ -145,7 +146,7 @@ end --------------------------------------------------------------------- -- Calcolo posizione braccio function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCuttingStep, nC, bAreCuttingStepsTowardsHead, bIsTopBlade, bCustUseBlade) - local nSCC = MCH_SCC.NONE + local nSCC local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT) local sToolUUID = GetToolUUID( sMachining) local bIsBlade