- Merge branch 'master' into lapjoint

This commit is contained in:
luca.bacis
2022-01-20 16:36:00 +01:00
+15 -28
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/12/01
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/01/19
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
@@ -1499,7 +1499,6 @@ end
---------------------------------------------------------------------
local function MakeRoundCleanCorner( Proc, nFacInd, dDiam, bMillDown, bDoubleSide)
-- recupero la lavorazione senza considerare l'elevazione
local sMilling = ML.FindMilling( 'SmallToolContour' .. EgtIf( bMillDown and not bDoubleSide, '_H2', ''))
if not sMilling then
@@ -1769,7 +1768,6 @@ local function MakeRoundCleanContour( Proc, nFacInd, dDiam, bMillDown,
EgtModifyCurveExtrusion( nFirstId + i - 1, vtN1, GDB_RT.GLOB)
end
end
-- alrimenti ho la faccia aggiunta
else
-- assegno il percorso
@@ -1970,7 +1968,6 @@ end
local function MakeRoundCleanCornerOrContour( Proc, nFacInd, dDiam, nFunction, bMillDown,
bDoubleSide, vtOrtho, nPathInt, nSurfInt,
dDepth, bOneShot)
-- se modalitá pulitura spigoli e lavorazione di lato forzo a fare il contorno
if nFunction == 2 and nPathInt then
nFunction = 1
@@ -1991,7 +1988,6 @@ end
---------------------------------------------------------------------
local function MakeSharpCleanCorner( Proc, nFacInd, dDiam)
local sMyWarn = ''
local pAuxId = {}
local nAuxId
@@ -2276,10 +2272,8 @@ local function MakeDrillOnCorner( Proc, nFacInd, dDiam, bSpecialMach)
end
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;'
-- aggiungo alle note massima elevazione (coincide con affondamento)
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione (coincide con affondamento)
local sUserNotes = 'VMRS=0;MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -2690,7 +2684,7 @@ local function MakeByMillAsSaw( Proc, tFData, nBottomFace, sMillingOnSide, dSawD
end
end
-- in base all'elevazione calcolo l'impronta della lama
local dUsedBladeLen = sqrt( ((dSawDiam / 2) * (dSawDiam / 2)) - ( ( (dSawDiam / 2) - tFData.dFacElev) * ( (dSawDiam / 2) - tFData.dFacElev)))
local dUsedBladeLen = sqrt( ((dSawDiam / 2) * (dSawDiam / 2)) - ( ((dSawDiam / 2) - tFData.dFacElev) * ((dSawDiam / 2) - tFData.dFacElev)))
-- controllo direzione taglio e se il minimo della feature sborda in coda
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( _b3Solid:getMin():getX() - Proc.Box:getMin():getX()) < 100 * GEO.EPS_SMALL and dDistToNextPiece < dUsedBladeLen then
-- do avviso che la lama può sbordare nel pezzo successivo
@@ -3249,8 +3243,7 @@ local function MakePocket( Proc, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool,
EgtOutLog( sWarn)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
if not EgtApplyMachining( true, false) then
-- provo ad allargare leggermente la tasca
@@ -3304,15 +3297,13 @@ local function DoHeadCut( Proc, nMchFId, sTuuidPk, dDiamTool, dElev, nSideFace,
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
return true
end
@@ -3517,7 +3508,6 @@ local function DoPocket( sName, sPocketing, sMchFind, vtN, nPathInt, nFaceIdx, d
return false, sErr
end
end
return true, '', nMchFId
end
@@ -3546,7 +3536,6 @@ local function MakeByPockets( Proc, bOrthoFacesMaster, bMillDown)
else
bOrthoFaces = bOrthoFacesMaster
end
-- se è un tunnel verifico se è possibile usare la svuotatura
if bOrthoFaces then
-- ottengo le dimensioni del tunnel
@@ -3973,10 +3962,8 @@ local function MakeAntiSplintByMill( Proc, pPaths, nPathInt, vtN1,
EgtSetMachiningParam( MCH_MP.DEPTH, (dMachDepth + dExtraDepth))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bInvertMach, not bInvert, bInvert))
end
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;'
-- aggiungo alle note massima elevazione
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( ( dMaxElev + dMachDepth), 1) .. ';'
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
local sUserNotes = 'VMRS=0;MaxElev=' .. EgtNumToString( ( dMaxElev + dMachDepth), 1) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if EgtApplyMachining( true, false) then
@@ -4555,8 +4542,8 @@ local function MakeSidePocketings( Proc, tFData, dCollSic, bSpecialMillOnSide,
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
local bPassThrou = ( Proc.Box:getDimY() > _b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > _b3Raw:getDimZ() - 1)
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * _b3Raw:getDimX())
if _nChamfer < 2 and Q_ANTISPLINT_TYPE == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
local bPassEdge = ( ( ( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * _b3Raw:getDimX())
if _nChamfer < 2 and Q_ANTISPLINT_TYPE == 1 and ( ( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
local bOk
local bSawDown = ( bMillDown and not bMillUp)
_, bOk, sWarn = ManageAntiSplintBySaw( Proc, bIsU, tFData.vtN, tFData.nFacInd, sWarn, bSawDown, true)
@@ -4704,7 +4691,7 @@ local function MakePocketingOrMilling( Proc, tFData, bSinglePart)
local sMchFind = 'Pocket'
local dDiam = min( tFData.dH, tFData.dV)
local bTailOnSide = ( Proc.Box:getMin():getX() - _b3Solid:getMin():getX() < 0.1 and not Proc.Tail)
if ( Proc.Fct == 1) or (( Proc.Fct == 2 or Proc.Fct == 3) and bIsL) or ((( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 4 and not bTailOnSide)) and bSinglePart) then
if ( Proc.Fct == 1) or ( ( Proc.Fct == 2 or Proc.Fct == 3) and bIsL) or ( ( ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 4 and not bTailOnSide)) and bSinglePart) then
sMchFind = 'OpenPocket'
if bIsU then
dDiam = GetUShapeWidth( Proc, tFData.nFacInd) or dDiam
@@ -4878,7 +4865,7 @@ local function MakePocketingOrMilling( Proc, tFData, bSinglePart)
end
else
-- se devo inserire il chamfer
if (( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and _nChamfer > 0 then
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and _nChamfer > 0 then
-- ottengo le dimensioni dello pseudotunnel
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc)
local nOk, sErr = MakeChamfer( Proc, vtOrtho, nSurfInt)
@@ -4893,8 +4880,8 @@ local function MakePocketingOrMilling( Proc, tFData, bSinglePart)
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a forma U e con 3 facce oppore a forma a L e con 2 facce
local bMadeASbyBld = false
local bPassThrou = ( Proc.Box:getDimY() > _b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > _b3Raw:getDimZ() - 1)
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * _b3Raw:getDimX())
if _nChamfer < 2 and Q_ANTISPLINT_TYPE == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
local bPassEdge = ( ( ( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * _b3Raw:getDimX())
if _nChamfer < 2 and Q_ANTISPLINT_TYPE == 1 and ( ( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
local bOk
local bSawDown = ( bMillDown and not bMillUp)
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, bIsU, tFData.vtN, tFData.nFacInd, sWarn, bSawDown)
@@ -4917,7 +4904,7 @@ local function MakePocketingOrMilling( Proc, tFData, bSinglePart)
-- se ho più di 3 facce e non di forma ad U oppure ho 3 facce e di forma ad U
-- e non sono stati inseriti antischeggia di lama
-- controllo se c'è una faccia non ortogonale alla principale e la lavoro con una contornatura o svuotatura
if (( Proc.Fct > 3 and not bIsU) or ( Proc.Fct == 3 and bIsU)) and not bMadeASbyBld then
if ( ( Proc.Fct > 3 and not bIsU) or ( Proc.Fct == 3 and bIsU)) and not bMadeASbyBld then
-- Recupero le facce adiacenti alla principale (solo quelle esistenti)
local vAdj = GetValidFacetAdjacencies( Proc.Id, tFData.nFacInd)
if not vAdj or #vAdj == 0 then