DataBeam :

- modifiche per doppia passata su profili Concave e Convex
- tagli doppi di testa e split con controllo sezioni migliorate
- corretto controllo fori sdoppiati.
This commit is contained in:
Dario Sassi
2019-04-08 11:41:58 +00:00
parent 6eaba8a577
commit 04059c20ac
7 changed files with 189 additions and 58 deletions
+40 -20
View File
@@ -49,7 +49,8 @@ end
function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
local dLen = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD):getDimX()
local dLen = Proc.Box:getDimX()
local dWidth = sqrt( Proc.Box:getDimY() * Proc.Box:getDimY() + Proc.Box:getDimZ() * Proc.Box:getDimZ())
-- limitazioni su inizio e fine derivanti da altre facce
local bLimXmin = false
local bLimXmax = false
@@ -99,27 +100,46 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
local dC = ( dLen - 2 * BD.LONGCUT_ENDLEN) / nC
nC = nC + 2
-- si percorre il lato basso della faccia
local nM = 0
for i = 1, nC do
-- inserisco le parti di lavorazione
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
-- ciclo sulle passate
local nO = 1
local dStep = 0
if dWidth + 2 * BD.CUT_EXTRA > dToolDiam then
nO = ceil(( dWidth + 2 * BD.CUT_EXTRA) / dToolDiam)
if nO > 1 then
dStep = ( dWidth + 2 * BD.CUT_EXTRA - dToolDiam) / ( nO - 1)
end
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- limito opportunamente la lavorazione
local dSal = EgtIf( i == 1, -dStartDist, - BD.LONGCUT_ENDLEN - ( i - 2) * dC)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
local dEal = EgtIf( i == nC, -dEndDist, - BD.LONGCUT_ENDLEN - ( nC - i - 1) * dC)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
for k = nO, 1, -1 do
-- 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
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- limito opportunamente la lavorazione
local dSal = EgtIf( i == 1, -dStartDist, - BD.LONGCUT_ENDLEN - ( i - 2) * dC)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
local dEal = EgtIf( i == nC, -dEndDist, - BD.LONGCUT_ENDLEN - ( nC - i - 1) * dC)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- imposto offset radiale (nullo se concavo)
if k >1 then
EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep)
else
EgtSetMachiningParam( MCH_MP.OFFSR, - BD.CUT_EXTRA)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
end
-- altrimenti una o due parti