DataBeam :

- altre correzioni per fori inclinati (fronte/sopra)
- corretta gestione ingombro ghiera portautensili su fori inclinati con punte
- gestione distanza da pezzo successivo per  ribassi con sega a catena.
This commit is contained in:
Dario Sassi
2020-10-15 18:52:24 +00:00
parent 0a5c8a146b
commit a43e323df8
4 changed files with 79 additions and 24 deletions
+10 -9
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2020/09/24
-- ProcessDrill.lua by Egaltech s.r.l. 2020/10/14
-- Gestione calcolo forature per Travi
-- Tabella per definizione modulo
@@ -133,7 +133,7 @@ function ProcessDrill.Classify( Proc, b3Raw)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
-- se lavorato in doppio, devo considerare il lato più sfavorevole
if Proc.Flg == 2 or Proc.Flg == -2 then
if Proc.Flg == -2 or ( BD.ROT90 and Proc.Flg == 2) then
if vtExtr:getZ() > 0 then
vtExtr = - vtExtr
ptCen = ptCen + vtExtr * dLen
@@ -144,7 +144,7 @@ function ProcessDrill.Classify( Proc, b3Raw)
return false, false, false
end
local bOpen = ( Proc.Fce ~= 0)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and not Proc.Head and not Proc.Tail)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or ( BD.ROT90 and ( Proc.Flg == 2 or Proc.Flg == -2))))
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
if not bOpen then
@@ -196,7 +196,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
dCheckDepth = nil
end
-- recupero la lavorazione
local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam, dCheckDepth)
local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth)
if not sDrilling then
-- se non ho passato altezza di taglio utensile allora non è stato trovato utensile
if not dCheckDepth then
@@ -206,7 +206,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
-- altrimenti rifaccio la ricerca foratura senza passare altezza utensile
else
dCheckDepth = nil
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam)
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam)
if not sDrilling then
local sErr = 'Error : drilling not found in library'
EgtOutLog( sErr)
@@ -215,7 +215,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
end
-- se la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi
-- allore ricerco un utensile senza lunghezza massima
-- allora ricerco un utensile senza lunghezza massima
if dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
-- se non ho passato altezza di taglio utensile allora la lunghezza utensile non è idonea per il taglio
if not dCheckDepth then
@@ -224,7 +224,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
return false, sErr
-- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto)
else
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam)
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam)
if not sDrilling then
local sErr = 'Error : drilling not found in library'
EgtOutLog( sErr)
@@ -243,7 +243,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local dSubL2 = 0
local dSubL3 = 0
-- se foro non su testa o coda e inclinato, limito il massimo affondamento
if not ( ( Proc.Fcs == 5 or Proc.Fcs == 6) or ( bToInvert and ( Proc.Fce == 5 or Proc.Fce == 6))) then
local bInvertFcse = ( bToInvert and Proc.Flg ~= -2)
if ( not bInvertFcse and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) or ( bInvertFcse and Proc.Fce ~= 5 and Proc.Fce ~= 6) then
local CosB = abs( vtExtr:getX())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
@@ -274,7 +275,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
local dSubL = max( dSubL1, dSubL2, dSubL3)
if dMaxDepth > 0 then
dMaxDepth = dMaxDepth - dSubL
dMaxDepth = min( dMaxDepth, dToolFreeLen - dSubL)
end
-- inserisco la lavorazione
local sName = 'Drill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))