DataBeam :
- correzione a LongCut con limitazione - modifica riconoscimento Tail di LapJoint.
This commit is contained in:
+59
-12
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2019/09/25
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2019/09/30
|
||||
-- Gestione calcolo taglio longitudinale per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -56,9 +56,15 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
bLimXmax = true
|
||||
end
|
||||
end
|
||||
-- Verifico se lavorazione da sotto
|
||||
-- Verifico lato di lavorazione
|
||||
local nSide = 1
|
||||
if vtN:getZ() < - 0.5 then nSide = -1 end
|
||||
if vtN:getZ() < - 0.5 then
|
||||
nSide = -1
|
||||
elseif vtN:getY() < -0.7071 then
|
||||
nSide = -2
|
||||
elseif vtN:getY() > 0.7071 then
|
||||
nSide = 2
|
||||
end
|
||||
|
||||
-- Se non è sotto : lavorazione Long2Cut
|
||||
if nSide ~= - 1 then
|
||||
@@ -78,22 +84,57 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
end
|
||||
local dStartDist = 0
|
||||
local dStartAccDist = BD.LONGCUT_ENDLEN
|
||||
local bStartFixed = true
|
||||
if ( bLimXmin and vtN:getY() < 0) or ( bLimXmax and vtN:getY() > 0) then
|
||||
dStartDist = dToolDiam / 2
|
||||
dStartDist = dToolDiam / 2
|
||||
dStartAccDist = BD.LONGCUT_MAXLEN
|
||||
bStartFixed = false
|
||||
end
|
||||
local dEndDist = 0
|
||||
local dEndAccDist = BD.LONGCUT_ENDLEN
|
||||
local bEndFixed = true
|
||||
if ( bLimXmin and vtN:getY() > 0) or ( bLimXmax and vtN:getY()< 0) then
|
||||
dEndDist = dToolDiam / 2
|
||||
dEndAccDist = BD.LONGCUT_MAXLEN
|
||||
bEndFixed = false
|
||||
end
|
||||
-- determino numero di parti
|
||||
local nC = ceil( ( dLen - 2 * BD.LONGCUT_ENDLEN) / BD.LONGCUT_MAXLEN)
|
||||
local dC = ( dLen - 2 * BD.LONGCUT_ENDLEN) / nC
|
||||
local dAccDist = BD.LONGCUT_ENDLEN
|
||||
local nC = ceil( ( dLen - dStartAccDist - dEndAccDist) / BD.LONGCUT_MAXLEN)
|
||||
local dC = 0
|
||||
if nC > 0 then
|
||||
if bStartFixed and bEndFixed then
|
||||
dC = ( dLen - dStartAccDist - dEndAccDist) / nC
|
||||
elseif bStartFixed then
|
||||
dC = ( dLen - dStartAccDist) / ( nC + 1)
|
||||
dEndAccDist = dC
|
||||
elseif bEndFixed then
|
||||
dC = ( dLen - dEndAccDist) / ( nC + 1)
|
||||
dStartAccDist = dC
|
||||
else
|
||||
dC = dLen / ( nC + 2)
|
||||
dStartAccDist = dC
|
||||
dEndAccDist = dC
|
||||
end
|
||||
nC = nC + 2
|
||||
else
|
||||
nC = EgtIf( dLen > BD.LONGCUT_ENDLEN, 2, 1)
|
||||
dAccDist = EgtIf( nC == 2, dLen / 2, 0)
|
||||
if dLen > min( dStartAccDist, dEndAccDist) then
|
||||
nC = 2
|
||||
if bStartFixed and not bEndFixed then
|
||||
dStartAccDist = min( dStartAccDist, dLen/2)
|
||||
dEndAccDist = dLen - dStartAccDist
|
||||
elseif not bStartFixed and bEndFixed then
|
||||
dEndAccDist = min( dEndAccDist, dLen/2)
|
||||
dStartAccDist = dLen - dEndAccDist
|
||||
else
|
||||
dStartAccDist = dLen/2
|
||||
dEndAccDist = dStartAccDist
|
||||
end
|
||||
else
|
||||
nC = 1
|
||||
dStartAccDist = 0
|
||||
dEndAccDist = 0
|
||||
end
|
||||
end
|
||||
-- si percorre il lato basso della faccia
|
||||
local nM = 0
|
||||
@@ -120,9 +161,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
-- limito opportunamente la lavorazione
|
||||
local dSal = EgtIf( i == 1, -dStartDist, - dAccDist - ( i - 2) * dC)
|
||||
local dSal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
local dEal = EgtIf( i == nC, -dEndDist, - dAccDist - ( nC - i - 1) * dC)
|
||||
local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
-- imposto offset radiale (nullo se concavo)
|
||||
if k >1 then
|
||||
@@ -154,7 +195,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
if nSide == -2 then
|
||||
nFaceUse = MCH_MILL_FU.PARAL_BACK
|
||||
elseif nSide == 2 then
|
||||
nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- attacco e uscita
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
|
||||
|
||||
Reference in New Issue
Block a user