DataBeam :
- nei LongCut lavorati con fresa di fianco corretto calcolo sicurezza aggiuntiva per inclinazione fresa rispetto alla trave - nei LapJoint corretta gestione inversione direzione utensile con Tunnel - nei LapJoint ora OpenPocket anche se diviso in parti ma con 1 o 2 facce - nei LapJoint nel caso Lamello (SideMillAsBlade) introdotta lunghezza minima.
This commit is contained in:
+38
-22
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2021/09/08
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2021/10/19
|
||||
-- Gestione calcolo taglio longitudinale per Travi
|
||||
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
@@ -276,7 +276,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||
-- cerco la svuotatura opportuna
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
|
||||
if not sPocketing then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library'
|
||||
local sErr = 'Error : OpenPocket not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -307,7 +307,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||
if dFacElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dFacElev)
|
||||
dFacElev = dMaxDepth
|
||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth'
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
@@ -460,7 +460,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if bCanUseUnderBlade then
|
||||
sCuttingDn = ML.FindCutting( 'HeadSide_H2')
|
||||
if not sCuttingDn then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawing underneath not found in library'
|
||||
local sErr = 'Error : sawing HeadSide_H2 not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -477,7 +477,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if bCanUseBlade then
|
||||
sCutting = ML.FindCutting( 'HeadSide')
|
||||
if not sCutting then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawing not found in library'
|
||||
local sErr = 'Error : sawing HeadSide not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -498,7 +498,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
bLimXmin = true
|
||||
else
|
||||
sWarn = 'Warning on saw cut : Cut machining can damage next piece'
|
||||
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
-- disabilitato la selezione del codolo, prende sempre quello più piccolo. Non cancellare quello disabiliato in caso di ripristino
|
||||
@@ -639,7 +639,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama
|
||||
if ( nSide == -1 or abs(nSide) == 2) and bCanUseUnderBlade then
|
||||
if (( dWidth - dDimStrip) / 2) > dMaxDepthDn then
|
||||
local sErr = 'Error, side depth is bigger than underneath blade cut depth'
|
||||
local sErr = 'Error : side depth is bigger than underneath blade cut depth'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -659,7 +659,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
sMilling = ML.FindMilling( 'Long2Cut', dElev)
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
local sErr = 'Error : milling Long2Cut (_H2) not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -869,7 +869,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Long2Cut', dElev)
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
local sErr = 'Error : milling Long2Cut not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -1100,12 +1100,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling Long2CutDown not found in library'
|
||||
local sErr = 'Error : milling Long2CutSide or Long2CutDown not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if nSide ~= 1 and BD.DOWN_HEAD and not sMillingDn then
|
||||
local sErr = 'Error : milling Long2CutDown_H2 not found in library'
|
||||
local sErr = 'Error : milling Long2CutSide_H2 or Long2CutDown_H2 not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -1256,8 +1256,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dSicOnRad = ( dThDiam - dToolDiam) / 2
|
||||
dSicOnLegth = dExtraForSafety / 2
|
||||
end
|
||||
dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNzMin) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)))
|
||||
dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegth)
|
||||
dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin))
|
||||
-- dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegth)
|
||||
dCollSic = max( BD.COLL_SIC, dSicOnRad * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegth)
|
||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||
local dSicOnRadDn
|
||||
local dSicOnLegthDn
|
||||
@@ -1268,8 +1269,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dSicOnRadDn = ( dThDiamDn - dToolDiamDn) / 2
|
||||
dSicOnLegthDn = dExtraForSafety / 2
|
||||
end
|
||||
dCollSicMinDn = max( BD.COLL_SIC, ( dThDiamDn - dToolDiamDn) / 2 * EgtIf( abs(dNzMin) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)))
|
||||
dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegthDn)
|
||||
dCollSicMinDn = max( BD.COLL_SIC, ( dThDiamDn - dToolDiamDn) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin))
|
||||
-- dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegthDn)
|
||||
dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegthDn)
|
||||
|
||||
if dWidth + dAgg > dMaxDepth - dCollSic then
|
||||
nPass = 2
|
||||
@@ -1306,8 +1308,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dSicOnRad = ( dThDiam - dToolDiam) / 2
|
||||
dSicOnLegth = dExtraForSafety / 2
|
||||
end
|
||||
dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNzMin) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)))
|
||||
dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getY(), vtN:getZ()) / dNz)) + dSicOnLegth)
|
||||
dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin))
|
||||
-- dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getY(), vtN:getZ()) / dNz)) + dSicOnLegth)
|
||||
dCollSic = max( BD.COLL_SIC, dSicOnRad * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegth)
|
||||
if dWidth + dAgg > dMaxDepth - dCollSic then
|
||||
sWarn = 'Warning in LongCut : depth is bigger than max tool depth'
|
||||
end
|
||||
@@ -1316,11 +1319,20 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dDepth = min( dMaxDepth - dCollSicMin, dWidth + dAgg)
|
||||
-- profondità seconda passata
|
||||
dDepth2 = dWidth + dAgg - dDepth
|
||||
if not BD.DOWN_HEAD then
|
||||
if nPass == 2 and dDepth2 < dAgg then
|
||||
dDepth = min( dMaxDepth - dCollSicMin, dWidth + dAgg) / 2
|
||||
dDepth2 = dWidth + dAgg - dDepth
|
||||
end
|
||||
end
|
||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||
dDepthDn = min( dMaxDepthDn - dCollSicMinDn, dWidth + dAgg)
|
||||
dDepth2Dn = dWidth + dAgg - EgtIf( abs(nSide) == 2, dDepth, dDepthDn)
|
||||
if nPass == 2 and dDepth2Dn < dAgg then
|
||||
dDepthDn = min( dMaxDepthDn - dCollSicMinDn, dWidth + dAgg) / 2
|
||||
dDepth2Dn = dWidth + dAgg - EgtIf( abs(nSide) == 2, dDepth, dDepthDn)
|
||||
end
|
||||
end
|
||||
|
||||
-- ciclo sulle parti
|
||||
local nM = 0
|
||||
local bMakeMillHeadEnd
|
||||
@@ -1337,6 +1349,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
local dEal = EgtIf( nPos == nC, -dStartDist, -dStartAccDist - ( nC - nPos - 1) * dC + dOverLapExtend)
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC
|
||||
local dExtraElev_1st = 0
|
||||
local dExtraElevDn_1st = 0
|
||||
for k = 1, nPass do
|
||||
|
||||
-- if EgtIf( k == 1, bFront, not bFront) then
|
||||
@@ -1395,7 +1409,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- se prima lavorazione non da sotto o seconda lavorazione da sotto e componente Y <= 60° e > 0
|
||||
if ( ( k == 1 and nSide ~= -1) or ( k == 2 and nSide == -1)) and abs(vtN:getY()) <= 0.866 and abs(vtN:getY()) > GEO.EPS_SMALL then
|
||||
-- verifico se può collidere in base alle dimensione del portapezzo
|
||||
local dDistToolTh = (dToolLength - EgtIf( k == 1, dDepth, dDepth2) - dThLen) / abs(vtN:getZ())
|
||||
local dDistToolTh = (dToolLength - EgtIf( k == 1, dDepth, ( dDepth2 + dExtraElev_1st)) - dThLen) / abs(vtN:getZ())
|
||||
local dDistRadTh = dDistToolTh * abs(vtN:getY())
|
||||
local dDistSurf = EgtIf( bFront, b3Solid:getMax():getY() - Proc.Box:getMax():getY(), Proc.Box:getMin():getY() - b3Solid:getMin():getY())
|
||||
-- raggio portautensile e raggio utensile allora calcolo un arretramento profondità
|
||||
@@ -1468,7 +1482,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- se seconda lavorazione sopra e componente Z > 0
|
||||
elseif k == 2 and nSide == 1 and vtN:getZ() > GEO.EPS_SMALL then
|
||||
local dDistToolTh = (dToolLength - dDepth2 - dThLen) / abs(vtN:getY())
|
||||
local dDistToolTh = (dToolLength - ( dDepth2 + dExtraElev_1st) - dThLen) / abs(vtN:getY())
|
||||
local dDistRadTh = dDistToolTh * abs(vtN:getZ())
|
||||
local dDistSurf = Proc.Box:getMin():getZ() - b3Solid:getMin():getZ()
|
||||
-- raggio portautensile e raggio utensile allora calcolo un arretramento profondità
|
||||
@@ -1507,7 +1521,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- se seconda lavorazione di fianco e componente Z > 0
|
||||
elseif k == 2 and abs(nSide) == 2 and vtN:getZ() > GEO.EPS_SMALL then
|
||||
local dDistToolThDn = (dToolLengthDn - dDepth2Dn - dThLenDn) / abs(vtN:getY())
|
||||
local dDistToolThDn = (dToolLengthDn - ( dDepth2Dn + dExtraElevDn_1st) - dThLenDn) / abs(vtN:getY())
|
||||
local dDistRadThDn = dDistToolThDn * abs(vtN:getZ())
|
||||
local dDistSurfDn = Proc.Box:getMin():getZ() - b3Solid:getMin():getZ()
|
||||
-- raggio portautensile e raggio utensile allora calcolo un arretramento profondità
|
||||
@@ -1532,7 +1546,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- se seconda lavorazione da sotto a componente Y < 60° e Y > 0
|
||||
elseif ( k == 2 and nSide == -1) and abs(vtN:getY()) <= 0.866 and abs(vtN:getY()) > GEO.EPS_SMALL then
|
||||
-- verifico se può collidere in base alle dimensione del portapezzo
|
||||
local dDistToolThDn = (dToolLengthDn - dDepth2Dn - dThLenDn) / abs(vtN:getY())
|
||||
local dDistToolThDn = (dToolLengthDn - ( dDepth2Dn + dExtraElevDn_1st) - dThLenDn) / abs(vtN:getY())
|
||||
local dDistRadThDn = dDistToolThDn * abs(vtN:getZ())
|
||||
local dDistSurfDn = EgtIf( bFront, b3Solid:getMax():getY() - Proc.Box:getMax():getY(), Proc.Box:getMin():getY() - b3Solid:getMin():getY())
|
||||
-- raggio portautensile e raggio utensile allora calcolo un arretramento profondità
|
||||
@@ -1555,11 +1569,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
|
||||
if BD.DOWN_HEAD and k == 2 and nSide ~= 1 then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth2Dn - dExtraElevDn)
|
||||
dExtraElevDn_1st = dExtraElevDn
|
||||
if dExtraElevDn > 0 and sWarn and #sWarn < 1 then
|
||||
sWarn = 'Warning in LongCut_2 : depth is bigger than max tool depth'
|
||||
end
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, EgtIf( k == 1, dDepth, dDepth2) - dExtraElev)
|
||||
dExtraElev_1st = dExtraElev
|
||||
if dExtraElev > 0 and sWarn and #sWarn < 1 then
|
||||
sWarn = 'Warning in LongCut : depth is bigger than max tool depth'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user