DataBeam :

- modifiche per tagli longitudinali anche limitati con lama.
This commit is contained in:
DarioS
2021-09-09 17:46:53 +02:00
parent 99140a545a
commit 75cafdbc9c
3 changed files with 1279 additions and 244 deletions
+86 -40
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/08/30
-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/09/08
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
@@ -19,7 +19,8 @@
-- 2021/06/21 Nel caso precedente si fa la terza svuotatura anche se è possibile fare una sola delle prime due (altra da sotto).
-- 2021/06/21 Gestione ripresa spigoli o contorno con fresa più piccola ( diametro < 3/4 utensile svuotatura) attivata da parametro Q.
-- 2021/07/02 Migliorie e correzioni su svuotature e pulitura spigoli.
-- 2021/07/15 Aggiunti anctischeggia con fresa.
-- 2021/07/15 Aggiunti antischeggia con fresa.
-- 2021/09/08 Aggiunta gestione parametro Q04 per i tagli di lama lungo facce lunghe (con o senza facce di chiusura)
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -40,18 +41,19 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
-- variabili assegnazione parametri Q
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
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
local Q_BLADE_ON_ALONG_FACE = '' -- i
-- variabile smussi
local bMadeChamfer
@@ -93,34 +95,35 @@ local function AssignQIdent( Proc)
Q_ANTISPLINT_TYPE = ''
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
Q_FORCE_BLADE = 'Q01' -- i
Q_DEPTH_CHAMFER = 'Q04' -- d
Q_ONLY_CHAMFER = '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
Q_DEPTH_CHAMFER = 'Q01' -- d
Q_ONLY_CHAMFER = '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
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
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
Q_BORE_ON_CORNER = 'Q01' -- i
Q_BORE_ON_CORNER = 'Q01' -- i
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
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
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
Q_ONLY_CONTOUR = 'Q02' -- i
Q_SIDE_ROUGH_TOOL = 'Q03' -- i
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
Q_DEPTH_CHAMFER = 'Q07' -- d
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
end
-- le altre features gestite non hanno parametri Q
end
@@ -4967,11 +4970,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
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
local nForceUseBladeOnNotContinueFace
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
if bUseBlade then
if 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
nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, Q_BLADE_ON_ALONG_FACE, 'i') or 0
-- se antischeggia di fresa o abilitato sgrossatore di fianco
if nBladeAntisplint == 2 or nUseRoughToolOnSide == 1 then
bUseBlade = false
@@ -4998,7 +5003,15 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
( Proc.Box:getDimX() > 0.8 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) then
-- una faccia
if Proc.Fct == 1 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
if bUseBlade then
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
else
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
end
else
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
end
-- due facce
elseif Proc.Fct == 2 then
-- determino se due facce lunghe oppure una lunga e l'altra terminale
@@ -5013,13 +5026,21 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
if bUseBlade then
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide')
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
else
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide')
end
else
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
end
elseif b3Fac2:getDimX() < 1 then
if bUseBlade then
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide')
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
else
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide')
end
else
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
end
@@ -5030,7 +5051,32 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- tre o più facce
-- tre facce
elseif Proc.Fct == 3 then
-- determino se due facce lunghe oppure una lunga e l'altra terminale
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD)
local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD)
local b3Fac3 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 2, GDB_BB.STANDARD)
local bApplyBladeOnLongNotContinueFace
if b3Fac1:getDimX() < 1 and b3Fac3:getDimX() < 1 then
-- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
bApplyBladeOnLongNotContinueFace = true
elseif b3Fac1:getDimX() < 1 and b3Fac2:getDimX() < 1 then
-- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
bApplyBladeOnLongNotContinueFace = true
elseif b3Fac2:getDimX() < 1 and b3Fac3:getDimX() < 1 then
bApplyBladeOnLongNotContinueFace = true
end
if bApplyBladeOnLongNotContinueFace and bUseBlade and nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
else
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- più facce
else
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
+908 -130
View File
File diff suppressed because it is too large Load Diff
+285 -74
View File
@@ -1,4 +1,4 @@
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2021/06/29
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2021/09/08
-- Gestione calcolo doppio taglio longitudinale per Travi
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
-- 2021/06/29 Corretta gestione caso equivalente a due smussi.
@@ -74,7 +74,7 @@ function ProcessLong2Cut.Classify( Proc)
local nSide = 0
if vtN[1]:getZ() > -10 * GEO.EPS_SMALL and vtN[2]:getZ() > -10 * GEO.EPS_SMALL then
nSide = 1
elseif vtN[1]:getZ() < -10 * GEO.EPS_SMALL and vtN[2]:getZ() < -10 * GEO.EPS_SMALL then
elseif vtN[1]:getZ() < 10 * GEO.EPS_SMALL and vtN[2]:getZ() < 10 * GEO.EPS_SMALL then
nSide = -1
end
-- angolo diedro per stabilire se taglio convesso
@@ -86,11 +86,11 @@ function ProcessLong2Cut.Classify( Proc)
bConvex = true
end
-- se feature di fianco e facce concave per lavorazione impossibile
if nSide == 0 and not bConvex then
-- do errore perchè su un lato entra nel pezzo (entra nel lato sopra)
Proc.ErrMsg = 'Error : impossible to machinine with tool on side'
return false, false
end
-- if nSide == 0 and not bConvex then
-- -- do errore perchè su un lato entra nel pezzo (entra nel lato sopra)
-- Proc.ErrMsg = 'Error : impossible to machinine with tool on side'
-- return false, false
-- end
end
return true, false
@@ -217,7 +217,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local nSide = 0
if vtN[1]:getZ() > -10 * GEO.EPS_SMALL and vtN[2]:getZ() > -10 * GEO.EPS_SMALL then
nSide = 1
elseif vtN[1]:getZ() < -10 * GEO.EPS_SMALL and vtN[2]:getZ() < -10 * GEO.EPS_SMALL then
elseif vtN[1]:getZ() < 10 * GEO.EPS_SMALL and vtN[2]:getZ() < 10 * GEO.EPS_SMALL then
nSide = -1
end
@@ -288,10 +288,15 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- se entrambe i Q sono attivi, disabilito lama
if nUseMillOnSide > 0 then bUseBlade = false end
-- Se senza facce limitanti, da sopra e richiesto con doppio taglio di lama
if nFaceLimit == 0 and ( nSide == 1 or ( nSide == 0 and BD.DOWN_HEAD)) and bUseBlade and b3Solid:getDimX() > dLimMinPiece - 1 then
-- Se senza facce limitanti, da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima
if nFaceLimit == 0 and ( nSide == 1 or ( abs(nSide) >= 0 and BD.DOWN_HEAD)) and bUseBlade and b3Solid:getDimX() > dLimMinPiece - 1 then
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'HeadSide')
local sCutting
if nSide == -1 and BD.DOWN_HEAD then
sCutting = ML.FindCutting( 'HeadSide_H2')
else
sCutting = ML.FindCutting( 'HeadSide')
end
if not sCutting then
local sErr = 'Error : HeadSide not found in library'
EgtOutLog( sErr)
@@ -379,8 +384,15 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
if ( not bFront and k == 1) or ( bFront and k == 2) then
dSal, dEal = dEal, dSal
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
if nSide == -1 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
end
-- imposto offset radiale
EgtSetMachiningParam( MCH_MP.OFFSR, dOffset)
-- imposto attacco/uscita
@@ -414,9 +426,16 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
for j = 1, #vOrd do
-- determino se lavorazione da davanti o da dietro
local bFront = ( vtN[vOrd[j]]:getY() < 0)
-- determino l'utilizzo della faccia
local nFaceUse = EgtIf( abs( vtN[vOrd[j]]:getY()) > 0.01, MCH_MILL_FU.ORTHO_TOP, EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT))
local nFaceUse2 = EgtIf( abs( vtN[vOrd[j]]:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK))
local nFaceUse
local nFaceUse2
if abs( nSide) == 1 then
-- determino l'utilizzo della faccia
nFaceUse = EgtIf( abs( vtN[vOrd[j]]:getY()) > 0.01, MCH_MILL_FU.ORTHO_TOP, EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT))
nFaceUse2 = EgtIf( abs( vtN[vOrd[j]]:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK))
else
nFaceUse = EgtIf( abs( vtN[vOrd[j]]:getY()) > 0.01, MCH_MILL_FU.ORTHO_TOP, EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT))
nFaceUse2 = vFaceUse[vOrd[j]]
end
-- ciclo sulle passate
local dOffset
local dLioPerp
@@ -446,11 +465,16 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- limito opportunamente la lavorazione
local dSal = EgtIf( i == nC, 0, - dEndAccDist - ( nC - i - 1) * dC)
local dEal = EgtIf( i == 1, 0, - dStartAccDist - ( i - 2) * dC)
if ( bFront) then
if ( bFront and abs( nSide) == 1) or j == 2 then
dSal, dEal = dEal, dSal
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
if nSide == -1 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
end
-- imposto offset radiale
EgtSetMachiningParam( MCH_MP.OFFSR, dOffset)
-- imposto attacco/uscita
@@ -461,7 +485,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse2)
if nSide == -1 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse2)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -472,7 +500,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
end
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
elseif ( ( nSide ~= -1 or BD.DOWN_HEAD) or ( nSide == -1 and BD.DOWN_HEAD)) and nUseMillOnSide == 0 then
-- determino la massima elevazione
local dElev = 0
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId)
@@ -485,7 +513,13 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
dElev = max( dFacElev1, dFacElev2)
end
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'Long2Cut', dElev)
local sMilling
if nSide == -1 and BD.DOWN_HEAD then
sMilling = ML.FindMilling( 'Long2Cut_H2', dElev)
else
sMilling = ML.FindMilling( 'Long2Cut', dElev)
end
if not sMilling then
local sErr = 'Error : Long2Cut not found in library'
EgtOutLog( sErr)
@@ -636,17 +670,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
for j = 1, nC do
-- su entrambe le facce
for i = nIni, nFin do
-- valore sovrapposizione tra passate con fresa di fianco
local dOverLapExtend = 2
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( nSide == -1 and BD.DOWN_HEAD))
-- Limitazioni della lavorazione
local nPos = EgtIf( i == 1, j, nC - j + 1)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC)
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC + EgtIf( bSide, dOverLapExtend, 0))
-- Posizione braccio portatesta
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not BD.DOWN_HEAD)
if bSide and not bConvex then
dSal, dEal = dEal, dSal
end
-- ciclo sulle passate
local nO = 1
local dStep = 0
@@ -671,8 +710,13 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, tFaceLong[vOrd[i]]}})
-- limito opportunamente la lavorazione
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
if ( nSide == -1 and BD.DOWN_HEAD) then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
end
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso faccia
@@ -686,8 +730,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
if bSide then dOffsR = 0 end
EgtSetMachiningParam( MCH_MP.OFFSR, dOffsR)
-- se di lato, imposto offset longitudinale
if bSide then
-- se di lato e convesso, imposto offset longitudinale
if bSide and bConvex then
EgtSetMachiningParam( MCH_MP.OFFSL, - BD.CUT_EXTRA)
end
-- attacco e uscita
@@ -726,7 +770,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local nExtendMach
-- recupero la lavorazione
local sMilling
local sMillingDn
local sPrefix
local sPrefixDn
if nSide ~= - 1 then
sMilling = ML.FindMilling( 'Long2CutSide')
sPrefix = 'L2CS_'
@@ -735,20 +781,35 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
bRemoveToolRadius = true
-- nExtendMach = 0 -- arretro la lavorazione del raggio utensile (se non ha facce limite)
end
-- se testa da sotto
if nSide ~= 1 and BD.DOWN_HEAD then
sMillingDn = ML.FindMilling( 'Long2CutSide_H2')
sPrefixDn = 'L2CSH2_'
end
-- lavorazione da sotto
else
sMilling = ML.FindMilling( 'Long2CutDown')
sMilling = ML.FindMilling( 'Long2CutDown', nil, nil, EgtIf( nUseMillOnSide > 0, 150, 50))
sPrefix = 'L2CD_'
nExtendMach = 1
if nUseMillOnSide ~= 1 then
nExtendMach = 2 -- arretro il minimo indispensabile per non segnare il pezzo successivo (se non ha facce limite)
end
-- se testa da sotto
if BD.DOWN_HEAD then
sMillingDn = ML.FindMilling( 'Long2CutDown_H2')
sPrefixDn = 'L2CDH2_'
end
end
if not sMilling then
local sErr = 'Error : Long2CutSide or Long2CutDown not found in library'
EgtOutLog( sErr)
return false, sErr
end
if nSide ~= 1 and BD.DOWN_HEAD and not sMillingDn then
local sErr = 'Error : Long2CutSide_H2 or Long2CutDown_H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- se angolo compreso è inferiore ai 90 gradi do errore
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Impossible use a mill with angle less than 90'
@@ -757,32 +818,57 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
-- recupero i dati dell'utensile
local dToolDiam = 0
local dToolLength = 0
local dMaxDepth = 0
local dThDiam = 0
local dThLen = 0
local dExtraForSafety = EgtIf( BD.DOWN_HEAD, 8.5, 6.5) -- corrisponde al doppio valore di sicurezza dell'mlpe + 0.5
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dThDiam = EgtTdbGetCurrToolThDiam() or dThDiam
dThLen = EgtTdbGetCurrToolThLength() or dThLen
end
end
-- recupero i dati dell'utensile da sotto
local dToolDiamDn = 0
local dToolLengthDn = 0
local dMaxDepthDn = 0
local dThDiamDn = 0
local dThLenDn = 0
if nSide ~= 1 and BD.DOWN_HEAD and EgtMdbSetCurrMachining( sMillingDn) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiamDn = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiamDn
dToolLengthDn = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLengthDn
dMaxDepthDn = EgtTdbGetCurrToolMaxDepth() or dMaxDepthDn
dThDiamDn = (EgtTdbGetCurrToolThDiam() or dThDiamDn)
dThLenDn = EgtTdbGetCurrToolThLength() or dThLenDn
end
end
local dDistToEnd = dToolDiam / 2
local dDistToEndDn = dToolDiamDn / 2
-- calcolo l'elevazione della faccia principale
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[1]], nPartId)
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[2]], nPartId)
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino al limite se l'elevazione della faccia è minore del raggio utensile
if nUseMillOnSide <= 1 or nSide == -1 then
-- calcolo l'elevazione della faccia principale
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[1]], nPartId)
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[2]], nPartId)
local dFacElev = max( dFacElev1, dFacElev2)
if dFacElev < dDistToEnd then
dDistToEnd = sqrt( ( ( dToolDiam / 2) * ( dToolDiam / 2)) - ( ( dToolDiam / 2 - dFacElev) * (dToolDiam / 2 - dFacElev)))
end
if dFacElev < dDistToEndDn then
dDistToEndDn = sqrt( ( ( dToolDiamDn / 2) * ( dToolDiamDn / 2)) - ( ( dToolDiamDn / 2 - dFacElev) * (dToolDiamDn / 2 - dFacElev)))
end
end
-- se la fine è già limitata allora setto per arretrare del raggio utensile
if nFaceLimit >= 2 then
nExtendMach = 0
-- se la fine non è limitata e ho un pezzo successivo distante meno di metà raggio. setto la fine come limitata
elseif dDistToNextPiece < dDistToEnd and nExtendMach ~= 1 then
elseif ( dDistToNextPiece < dDistToEnd or dDistToNextPiece < dDistToEndDn) and nExtendMach ~= 1 then
nFaceLimit = nFaceLimit + 2
end
-- aggiuntivo sull'affondamento
@@ -850,7 +936,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local nDir = 1
-- se facce ortogonali (concave) controllo se con la lavorazione della prima faccia il diametro copre la seconda (e non la eseguo)
if bOrtho then
-- se da sotto scelgo la faccia (lavorta col fianco utensile) con direzione più sottosquadra
-- se da sotto scelgo la faccia (lavorata col fianco utensile) con direzione più sottosquadra
if nSide == -1 and vtN[vOrd[1]]:getZ() < -0.001 and vtN[vOrd[2]]:getZ() < -0.001 then
-- se gli angoli delle due facce sono uguali ( sotto il grado di differenza) sgelgo la faccia più vicina a un fianco
if abs(vtN[vOrd[1]]:getZ() - vtN[vOrd[2]]:getZ()) < 0.017 then
@@ -905,22 +991,55 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
end
end
-- su entrambe le facce
-- ciclo sulle facce selezionate
for i = nIni, nFin, nDir do
-- valore sovrapposizione tra passate
local dOverLapExtend = 2
-- Limitazioni della lavorazione
local nPos = EgtIf( i == 1, j, nC - j + 1)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC)
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + dOverLapExtend)
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC + dOverLapExtend)
-- Posizione braccio portatesta
local nSCC = EgtIf( BD.C_SIMM, MCH_SCC.NONE, MCH_SCC.ADIR_XP)
-- inserisco le parti di lavorazione
nM = nM + 1
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
local sNameF
local nMchFId
local bUseDownHead
local bFront = (vtN[vOrd[i]]:getY() < 0)
if BD.DOWN_HEAD and nSide ~= 1 then
local ptC3 = EgtSurfTmFacetCenter( Proc.Id, tFaceLong[vOrd[i]], GDB_ID.ROOT)
local ptDir = ptC3 - ptM ; ptDir:normalize()
-- se concave e dal versore Z della faccia (> -20°) o convesso e versore Z ( > -30°) decido se eseguire la lavoraione con la testa d a sopra o da sotto
if ( not bConvex and vtN[vOrd[i]]:getZ() > -0.9397 and ptDir:getZ() > 0) or
( bConvex and vtN[vOrd[i]]:getZ() > -0.866 and ptDir:getZ() > 0) then
sNameF = sPrefix .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
nMchFId = EgtAddMachining( sNameF, sMilling)
bUseDownHead = false
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
else
sNameF = sPrefixDn .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
nMchFId = EgtAddMachining( sNameF, sMillingDn)
bUseDownHead = true
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMillingDn
EgtOutLog( sErr)
return false, sErr
end
end
else
sNameF = sPrefix .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
nMchFId = EgtAddMachining( sNameF, sMilling)
bUseDownHead = false
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, tFaceLong[vOrd[i]]}})
@@ -929,69 +1048,161 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso faccia
-- se fresa di fianco e non da sotto
if nUseMillOnSide > 0 and nSide ~= -1 then
if nSide == 1 then
-- se faccia da sopra o di fianco
if nSide >= 0 then
if bConvex then
if vtN[vOrd[i]]:getZ() > 0.866 then
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_TOP)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
local vFaceUse2
-- se da sopra
if nSide == 1 then
if vtN[vOrd[i]]:getZ() > 0.866 then
vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 1, 2)], vtN[EgtIf(vOrd[i] == 1, 2, 1)])
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
-- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_TOP)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
end
-- altrimenti è di fianco
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
if vtN[vOrd[i]]:getY() > 0.866 then
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_TOP)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
end
end
-- se concavo
else
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
local vFaceUse2
-- se da sopra
if nSide == 1 then
-- vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)], vtN[EgtIf(vOrd[i] == 1, 1, 2)])
-- altrimenti è di fianco
else
vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
end
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
end
else
-- questa parte non viene mai eseguita
-- se faccia da sotto
-- else
-- if bConvex then
-- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- if vtN[vOrd[i]]:getZ() >= 0 then
-- EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
-- EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
-- end
-- else
-- -- lascio lo stesso le lavorazioni anche se viene intercettato l'errore
-- local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
-- EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
-- if vtN[vOrd[i]]:getZ() < 0 then
-- EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
-- EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
-- end
-- end
end
else
-- se con fresa di fianco
if nUseMillOnSide > 0 then
if bConvex then
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
if vtN[vOrd[i]]:getZ() >= 0 then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
if BD.DOWN_HEAD and nSide ~= 1 then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
end
end
else
-- lascio lo stesso le lavorazioni anche se viene intercettato l'errore
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
-- local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)], vtN[EgtIf(vOrd[i] == 1, 1, 2)])
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
if vtN[vOrd[i]]:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
if BD.DOWN_HEAD and nSide ~= 1 then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
end
end
end
else
-- se faccia da sotto
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[i]])
end
else
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[i]])
end
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
local dNz = vtN[vOrd[i]]:getZ()
-- calcolo la componente dNz non in base alla classificazione della feature (sopra, sotto, fianchi) ma alla componente maggiore
-- local dNz = EgtIf( nSide == 0, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
-- local dNz = EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
local dNz = EgtIf( abs(nSide) == 1, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
local dNzMin = EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
local dLioPerp1, dLioPerp2
-- nel caso concavo, devo impostare la lunghezza di attacco ortogonale
if not bConvex then
-- local dLioPerp = vWidth[vOrd[i]] * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, sqrt( 1 - dNz * dNz) / abs( dNz)) + BD.COLL_SIC
local dLioPerp = vWidth[ EgtIf( vOrd[i] == 1, 2,1)] + BD.COLL_SIC
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
dLioPerp1 = EgtIf( i == 1, dFacElev1, dFacElev2)
-- dLioPerp1 = vWidth[vOrd[i]] * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, sqrt( 1 - dNz * dNz) / abs( dNz)) + BD.COLL_SIC
dLioPerp2 = vWidth[ EgtIf( vOrd[i] == 1, 2,1)] + BD.COLL_SIC
EgtSetMachiningParam( MCH_MP.LIPERP, max( dLioPerp1, dLioPerp2))
EgtSetMachiningParam( MCH_MP.LOPERP, max( dLioPerp1, dLioPerp2))
end
-- verifico massimo affondamento (tengo conto dell'inclinazione utensile e della pinza con estremità conica)
-- 08/09/2020 tolti i 3mm ( per la ghiera smussata) perchè nella verifica collisione vine creato un cilindro non smussato che rileva la collisione
-- local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( vtN[vOrd[i]]:getY() / vtN[vOrd[i]]:getZ()) - 3)
local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( vtN[vOrd[i]]:getY() / dNz)))
if vWidth[vOrd[i]] + dAgg > dMaxDepth - dCollSic then
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
-- local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( vtN[vOrd[i]]:getY() / dNz)))
local dCollSic
local dDepth
-- assegno affondamento
local dExtraElev = 0
-- se uso testa da sotto
if bUseDownHead then
dCollSic = max( BD.COLL_SIC, ( dThDiamDn - dToolDiamDn) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz)))
if vWidth[vOrd[i]] + dAgg > dMaxDepthDn - dCollSic then
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepthDn - dCollSic, 1) .. ')'
end
dDepth = min( dMaxDepthDn - dCollSic, vWidth[vOrd[i]] + dAgg)
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
else
dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz)))
if vWidth[vOrd[i]] + dAgg > dMaxDepth - dCollSic then
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
end
dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg)
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
end
local dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
-- se feature orientata su faccia da sotto e concave provo a cambiare l'attacco
if nSide == -1 and not bConvex then
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp1)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp1)
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
else
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
if bConvex and j == 1 and not bStartFixed and bRemoveToolRadius then