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:
+20
-1
@@ -1,4 +1,4 @@
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2020/11/06
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2020/12/296
|
||||
-- Libreria esecuzione lavorazioni per Travi
|
||||
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
||||
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
||||
@@ -19,6 +19,7 @@
|
||||
-- 2020/10/07 Aggiunta distanza libera dietro il pezzo (BDST) scritta nel suo grezzo.
|
||||
-- 2020/10/15 Per foro sdoppiato ricalcolo anche flag Head oltre a Tail .
|
||||
-- 2020/10/23 Corretto spostamento foro per tenone quando tenone nullo.
|
||||
-- 2020/12/29 Aggiunta gestione fori in doppio.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -533,6 +534,24 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- riunisco fori da fare in doppio
|
||||
local i = 1
|
||||
while i < #vProc do
|
||||
local ProcI = vProc[i]
|
||||
if ProcI.Prc == 40 then
|
||||
local DouId = EgtGetInfo( ProcI.Id, 'DOU', 'i')
|
||||
if DouId then
|
||||
for j = i + 1, #vProc do
|
||||
if vProc[j].Id == DouId then
|
||||
table.insert( vProc, i, table.remove( vProc, j))
|
||||
i = i + 1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
-- riunisco marcature, testi e decori non troppo lontani
|
||||
local dMarkRange = 300
|
||||
for i = 1, #vProc do
|
||||
|
||||
+7
-3
@@ -180,7 +180,7 @@ function BeamLib.PutStartOnLonger( nCrvId)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw)
|
||||
function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw, bDown)
|
||||
-- verifico che la curva sia chiusa
|
||||
if not EgtCurveIsClosed( nCrvId) then return false end
|
||||
-- recupero il versore normale al piano di lavoro o estrusione
|
||||
@@ -189,7 +189,7 @@ function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw)
|
||||
local dCoeffX = 1 / ( sqrt( 1 - vtN:getX() * vtN:getX()))
|
||||
local dCoeffY = 1 / ( sqrt( 1 - vtN:getY() * vtN:getY()))
|
||||
local dCoeffZ = 1 / ( sqrt( 1 - vtN:getZ() * vtN:getZ()))
|
||||
-- cerco l'estremo più vicino al box e lo imposto come inizio (escluso Zmin)
|
||||
-- cerco l'estremo più vicino al box e lo imposto come inizio (se da sotto escludo Zmax e viceversa)
|
||||
local dUopt = 0
|
||||
local dDopt = GEO.INFINITO
|
||||
local dUi, dUf = EgtCurveDomain( nCrvId)
|
||||
@@ -202,7 +202,11 @@ function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw)
|
||||
dD = min( abs( vtMax:getX()) * dCoeffX, dD)
|
||||
dD = min( abs( vtMin:getY()) * dCoeffY, dD)
|
||||
dD = min( abs( vtMax:getY()) * dCoeffY, dD)
|
||||
dD = min( abs( vtMax:getZ()) * dCoeffZ, dD)
|
||||
if bDown then
|
||||
dD = min( abs( vtMin:getZ()) * dCoeffZ, dD)
|
||||
else
|
||||
dD = min( abs( vtMax:getZ()) * dCoeffZ, dD)
|
||||
end
|
||||
if dD < dDopt + GEO.EPS_SMALL then
|
||||
dDopt = dD
|
||||
dUopt = dU
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2020/12/17
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2020/12/29
|
||||
-- Gestione calcolo forature per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -109,8 +109,10 @@ function ProcessDrill.Split( Proc, b3Raw)
|
||||
if not bTrySplit then
|
||||
return false
|
||||
end
|
||||
-- abilitazione foratura da sotto
|
||||
local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < 0.1 or EgtExistsInfo( Proc.Id, 'MAIN')) and not EgtExistsInfo( Proc.Id, 'DOU'))
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam, nil, BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < 0.1))
|
||||
local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
if not sDrilling then dMaxMat = 0 end
|
||||
-- restituisco se va fatto in doppio (solo fori orizzontali)
|
||||
local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
|
||||
@@ -203,7 +205,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
dCheckDepth2 = nil
|
||||
end
|
||||
-- abilitazione foratura da sotto
|
||||
local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < 0.1))
|
||||
local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < 0.1 or EgtExistsInfo( Proc.Id, 'MAIN')) and not EgtExistsInfo( Proc.Id, 'DOU'))
|
||||
-- primo gruppo di controlli con lunghezza utensile calcolata
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillDown)
|
||||
@@ -211,7 +213,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile
|
||||
if dCheckDepth then
|
||||
dCheckDepth = nil
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, nil, bDrillDown)
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
end
|
||||
if not sDrilling then
|
||||
nErrorCode = 1
|
||||
@@ -225,7 +227,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
nErrorCode = 2
|
||||
-- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto)
|
||||
else
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, nil, bDrillDown)
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
if not sDrilling then
|
||||
nErrorCode = 1
|
||||
end
|
||||
@@ -244,7 +246,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile
|
||||
if dCheckDepth2 then
|
||||
dCheckDepth2 = nil
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, nil, bDrillDown)
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
end
|
||||
if not sDrilling2 then
|
||||
nErrorCode = 1
|
||||
@@ -258,7 +260,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
nErrorCode = 2
|
||||
-- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto)
|
||||
else
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, nil, bDrillDown)
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
if not sDrilling2 then
|
||||
nErrorCode = 1
|
||||
end
|
||||
@@ -396,6 +398,12 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
sUserNotes = sUserNotes .. 'Open=1;'
|
||||
end
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
if EgtExistsInfo( Proc.Id, 'MAIN') then
|
||||
sUserNotes = sUserNotes .. 'Double;'
|
||||
elseif EgtExistsInfo( Proc.Id, 'DOU') then
|
||||
sUserNotes = sUserNotes .. 'Main;'
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
local bOk = EgtApplyMachining( true, false)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2020/11/19
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2020/12/30
|
||||
-- Gestione calcolo profilo concavo per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -75,8 +75,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
|
||||
@@ -94,44 +94,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
|
||||
|
||||
@@ -328,7 +311,7 @@ function ProcessProfConcave.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, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -367,7 +350,7 @@ function ProcessProfConcave.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, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -465,7 +448,7 @@ function ProcessProfConcave.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, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -527,7 +510,7 @@ function ProcessProfConcave.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, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
|
||||
@@ -75,8 +75,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
|
||||
@@ -94,44 +94,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
|
||||
|
||||
@@ -328,7 +311,7 @@ function ProcessProfConvex.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, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -367,7 +350,7 @@ function ProcessProfConvex.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, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -465,7 +448,7 @@ function ProcessProfConvex.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, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -527,7 +510,7 @@ function ProcessProfConvex.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, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfFront.lua by Egaltech s.r.l. 2020/10/14
|
||||
-- ProcessProfFront.lua by Egaltech s.r.l. 2020/12/30
|
||||
-- Gestione calcolo profilo frontale per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -66,7 +66,7 @@ local function GetSawCutData( AuxId, vtN)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideAndInvertAndLead( Proc, bHead, dToolDiam, bNotModifLeadPar)
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -84,25 +84,8 @@ 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))
|
||||
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)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -289,7 +272,7 @@ function ProcessProfFront.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, dMillDiam, true)
|
||||
ModifySideInvertLead( Proc, bHead, dMillDiam)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -326,7 +309,7 @@ function ProcessProfFront.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, dMillDiam, true)
|
||||
ModifySideInvertLead( Proc, bHead, dMillDiam)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -418,7 +401,7 @@ function ProcessProfFront.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)
|
||||
ModifySideInvertdLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -477,7 +460,7 @@ function ProcessProfFront.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)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
|
||||
+31
-48
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2020/12/17
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2020/12/30
|
||||
-- Gestione calcolo tenone per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -150,8 +150,10 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dPockX = max( b3Ten:getMax():getX() - b3Aux:getMax():getX(), b3Aux:getMin():getX() - b3Ten:getMin():getX())
|
||||
local dPockY = max( b3Ten:getMax():getY() - b3Aux:getMax():getY(), b3Aux:getMin():getY() - b3Ten:getMin():getY())
|
||||
local dPockL = sqrt( dPockX * dPockX + dPockY * dPockY)
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||
-- porto inizio curva il più possibile sul bordo
|
||||
BL.PutStartNearestToEdge( AuxId, b3Solid)
|
||||
BL.PutStartNearestToEdge( AuxId, b3Solid, bMillDown)
|
||||
-- se vero tenone inclinato o non esattamente alle estremità, necessario taglio di lama sulla testa
|
||||
if Proc.Prc ~= 52 and
|
||||
( not AreSameOrOppositeVectorApprox( vtN, X_AX()) or
|
||||
@@ -171,7 +173,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se pezzo piccolo, in coda e piano inclinato attorno a Z applico svuotatura
|
||||
if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getX()) < 0.985 then
|
||||
local sPockType = EgtIf( vtExtr:getZ() < 0.1 and BD.DOWN_HEAD, 'OpenPocket_H2', 'OpenPocket')
|
||||
local sPockType = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket')
|
||||
local sPocketing = ML.FindPocketing( sPockType)
|
||||
local dMaxDepth = 100
|
||||
local dStep = 30
|
||||
@@ -223,7 +225,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMillType = EgtIf( vtExtr:getZ() < 0.1 and BD.DOWN_HEAD, 'Tenon_H2', 'Tenon')
|
||||
local sMillType = EgtIf( bMillDown, 'Tenon_H2', 'Tenon')
|
||||
local sMilling = ML.FindMilling( sMillType, dTenH) or ML.FindMilling( sMillType)
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
|
||||
Reference in New Issue
Block a user