DataBeam :

- prime modifiche per lavorazione fori in Doppio
- correzione a attacchi/uscite dei profili di Testa
- modifiche a punto di attacco tenone se lavorato con testa da sotto.
This commit is contained in:
Dario Sassi
2020-12-31 11:31:27 +00:00
parent b7133b5ffd
commit a8a97eae97
8 changed files with 138 additions and 173 deletions
+31 -48
View File
@@ -1,4 +1,4 @@
-- ProcessProfHead.lua by Egaltech s.r.l. 2020/11/19
-- ProcessProfHead.lua by Egaltech s.r.l. 2020/12/30
-- Gestione calcolo profilo di testa per Travi
-- Tabella per definizione modulo
@@ -67,8 +67,8 @@ local function GetSawCutData( AuxId, vtN)
end
---------------------------------------------------------------------
local function ModifySideAndInvertAndLead( Proc, bHead, dToolDiam, bNotModifLeadPar, dLenIni,
dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
-- confronto il punto iniziale e finale della lavorazione con il box della feature
-- e se è vicino alla parte esterna della trave inverto la lavorazione
@@ -86,44 +86,27 @@ local function ModifySideAndInvertAndLead( Proc, bHead, dToolDiam, bNotModifLead
-- ottengo l'inversione e setto il contrario
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
-- modifico attacco e uscita
if not bNotModifLeadPar then
EgtSetMachiningParam( MCH_MP.LIPERP, -(dToolDiam/2))
EgtSetMachiningParam( MCH_MP.LITANG, (dToolDiam/2)+0.5)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 0)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, (dToolDiam/3*2))
elseif dLenIni and dLenLst then
-- se entità agi estremi sono inferiori del raggio utensile ed è abilitata la ripresa della faccia,
-- allungo attacco e/o uscita
if dLenIni < ( dToolDiam / 2) + ( 20 * GEO.EPS_SMALL) and bFirstTrim then
EgtSetMachiningParam( EgtIf( bFlagInvert, MCH_MP.STARTADDLEN, MCH_MP.ENDADDLEN), (dToolDiam/2)-dLenIni+dOffsetPar+1)
end
if dLenLst < ( dToolDiam / 2) + ( 20 * GEO.EPS_SMALL) and bLastTrim then
EgtSetMachiningParam( EgtIf( bFlagInvert, MCH_MP.ENDADDLEN, MCH_MP.STARTADDLEN), (dToolDiam/2)-dLenLst+dOffsetPar+1)
end
end
-- riapplico la lavorazione
EgtApplyMachining( true, false)
else
-- modifico attacco e uscita
if not bNotModifLeadPar then
EgtSetMachiningParam( MCH_MP.LIPERP, -(dToolDiam/2))
EgtSetMachiningParam( MCH_MP.LITANG, (dToolDiam/2)+0.5)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 0)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, (dToolDiam/3*2))
-- riapplico la lavorazione
EgtApplyMachining( true, false)
elseif dLenIni and dLenLst then
-- se entità agi estremi sono inferiori del raggio utensile ed è abilitata la ripresa della faccia,
-- allungo attacco e/o uscita
if dLenIni < ( dToolDiam / 2) + ( 20 * GEO.EPS_SMALL) and bFirstTrim then
EgtSetMachiningParam( EgtIf( bFlagInvert, MCH_MP.ENDADDLEN, MCH_MP.STARTADDLEN), (dToolDiam/2)-dLenIni+dOffsetPar+1)
end
if dLenLst < ( dToolDiam / 2) + ( 20 * GEO.EPS_SMALL) and bLastTrim then
EgtSetMachiningParam( EgtIf( bFlagInvert, MCH_MP.STARTADDLEN, MCH_MP.ENDADDLEN), (dToolDiam/2)-dLenLst+dOffsetPar+1)
end
end
end
-- modifico attacco e uscita
if dLenIni and dLenLst then
-- se entità agli estremi sono inferiori del raggio utensile ed è abilitata la ripresa della faccia,
-- allungo attacco e/o uscita
local dStartAddLen = 0
if bFirstTrim and dLenIni < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
dStartAddLen = dToolDiam / 2 - dLenIni + dOffsetPar + 1
end
local dEndAddLen = 0
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
end
if bFlagInvert then
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end
-- riapplico la lavorazione
EgtApplyMachining( true, false)
end
end
@@ -332,8 +315,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione
ModifySideAndInvertAndLead( Proc, bHead, dToolDiam + ( 2 * dExtra), true, dLenIni,
dLenLst, EgtIf( #vAngs > 0 and vAngs[1] == 0, true, false), EgtIf( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2), true, false), bFlagInvert, dExtra)
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
dLenLst, E( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra)
end
-- se lavorazione da due parti, aggiungo la seconda
if bDoubleCham then
@@ -372,8 +355,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione
ModifySideAndInvertAndLead( Proc, bHead, dToolDiam + ( 2 * dExtra), true, dLenIni,
dLenLst, EgtIf( #vAngs > 0 and vAngs[1] == 0, true, false), EgtIf( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2), true, false), bFlagInvert, dExtra)
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra)
end
end
end
@@ -471,8 +454,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita
ModifySideAndInvertAndLead( Proc, bHead, dToolDiam, true, dLenIni,
dLenLst, EgtIf( #vAngs > 0 and vAngs[1] == 0, true, false), EgtIf( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2), true, false), bFlagInvert, dOffsetPar)
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar)
end
-- se abilitata, aggiungo lavorazione di finitura
if bFinish then
@@ -534,8 +517,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita
ModifySideAndInvertAndLead( Proc, bHead, dToolDiam, true, dLenIni,
dLenLst, EgtIf( #vAngs > 0 and vAngs[1] == 0, true, false), EgtIf( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2), true, false), bFlagInvert, dOffsetPar)
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar)
end
-- se abilitata, aggiungo lavorazione di finitura
if bFinish then