DataBeam :

- correzione a GetFaceElevation
- modifiche a lavorazione LapJoint per passare i parametri Q quando si fa LongDoubleCut
- modifiche a LongDoubleCut per poter ricevere parametri Q invece di leggerli più alcune migliorie
- aggiunto antischggia in testa a profilo arcuato ma poi disabilitato.
This commit is contained in:
Dario Sassi
2020-11-18 16:14:23 +00:00
parent 4c79eb18c2
commit 7c6961985c
4 changed files with 140 additions and 27 deletions
+54 -12
View File
@@ -1,4 +1,4 @@
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/11/08
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/11/16
-- Gestione calcolo doppio taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -203,7 +203,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- carico i dati delle face già inserite nelle opportune tabelle
@@ -268,8 +268,20 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del raggio utensile).
-- Questo viene fatto se Q03=1 o fresa da sotto
----------------------------------------------------------------------------------------------------------------------------------------
local bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1
local nUseMillOnSide = EgtGetInfo( Proc.Id, 'Q03', 'i') or 0
local bUseBlade
local nUseMillOnSide
-- se presenti utilizzo i parametri dell'eventuale lua "padre"
if bForcedBladeMaster ~= nil then
bUseBlade = bForcedBladeMaster
else
bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1
end
if nUseSideToolMaster ~= nil then
nUseMillOnSide = nUseSideToolMaster
else
nUseMillOnSide = EgtGetInfo( Proc.Id, 'Q03', 'i') or 0
end
-- se entrambe i Q sono attivi, disabilito lama
if nUseMillOnSide > 0 then bUseBlade = false end
@@ -404,8 +416,13 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- ciclo sulle passate
local dOffset
local dLioPerp
if j == 1 then -- il primo taglio lo faccio completo
dOffset = 0
if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90
-- se angolo interno inferiore di 90° calcolo l'arretramento della lama + un piccolo delta di 0.3
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
dOffset = 0.3 + ((dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
else
dOffset = 0
end
dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC
else -- il secondo ridotto della distanza minima e della componente spessore della lama
dOffset = BD.DIM_STRIP_SMALL + ((dToolThick* vtN[vOrd[1]]) - (dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
@@ -464,6 +481,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- se angolo compreso è inferiore ai 90 gradi do errore
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Impossible use a mill with angle less than 90'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dToolDiam = 0
local dMaxDepth = 0
@@ -620,6 +643,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso faccia
EgtOutLog( 'FaceUse='..tostring( vFaceUse[vOrd[i]]))
--EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, BL.GetParallelOpposite( vFaceUse[vOrd[i]]), vFaceUse[vOrd[i]]))
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, MCH_MILL_FU.PARAL_DOWN, vFaceUse[vOrd[i]]))
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
@@ -691,6 +716,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- se angolo compreso è inferiore ai 90 gradi do errore
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Impossible use a mill with angle less than 90'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dToolDiam = 0
local dMaxDepth = 0
@@ -782,8 +813,15 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- ciclo sulle parti
local nM = 0
for j = 1, nC do
local nFin = 2
-- se concavo e facce ortogonali controllo se con la lavorazione della prima faccia il diametro copre la seconda (e non la eseguo)
if not bConvex and bOrtho then
if dToolDiam > vWidth[vOrd[2]] then
nFin = 1
end
end
-- su entrambe le facce
for i = 1, 2 do
for i = 1, nFin do
-- Limitazioni della lavorazione
local nPos = EgtIf( i == 1, j, nC - j + 1)
local dSal = EgtIf( nPos == 1, - EgtIf( i == 1, dStartDist, dEndDist), - EgtIf( i == 1, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC)
@@ -817,8 +855,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
end
-- se concavo
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
end
@@ -831,7 +871,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
else
-- lascio lo stesso le lavorazioni anche se viene intercettato l'errore
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
if vtN[vOrd[i]]:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
@@ -844,17 +885,18 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
local dNz = vtN[vOrd[i]]:getZ()
-- nel caso concavo, devo impostare la lunghezza di attacco ortogonale
if not bConvex then
local dNz = vtN[vOrd[i]]:getZ()
local dLioPerp = vWidth[vOrd[i]] * sqrt( 1 - dNz * dNz) / abs( dNz) + BD.COLL_SIC
-- local dLioPerp = vWidth[vOrd[i]] * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, sqrt( 1 - dNz * dNz) / abs( dNz)) + BD.COLL_SIC
local dLioPerp = vWidth[ EgtIf( vOrd[i] == 1, 2,1)] + BD.COLL_SIC
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
end
-- verifico massimo affondamento (tengo conto dell'inclinazione utensile e della pinza con estremità conica)
-- 08/09/2020 tolti i 3mm ( per la ghiera smussata) perchè nella verifica collisione vine creato un cilindro non smussato che rileva la collisione
-- local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( vtN[vOrd[i]]:getY() / vtN[vOrd[i]]:getZ()) - 3)
local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( vtN[vOrd[i]]:getY() / vtN[vOrd[i]]:getZ()))
local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( vtN[vOrd[i]]:getY() / dNz)))
if vWidth[vOrd[i]] + dAgg > dMaxDepth - dCollSic then
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
end