DataBeam :

- corretta lunghezza libera frese per forature con interpolazione
- in tagli di testa aggiunta gestione come tagli longitudinali se vanno da inizio a fine trave
- in forature inclinate corretto calcolo ingombro portautensile
- in LapJoint corretta verifica dimensioni sega a catena rispetto alla geometria
- in LongCut aggiunta gestione tagli da Cut.
This commit is contained in:
Dario Sassi
2021-01-14 06:44:23 +00:00
parent 1ef2c29bdb
commit b9973271a3
6 changed files with 65 additions and 30 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
-- BeamExec.lua by Egaltech s.r.l. 2020/12/296
-- BeamExec.lua by Egaltech s.r.l. 2020/12/29
-- 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.
+2 -2
View File
@@ -1,4 +1,4 @@
-- MachiningLib.lua by Egaltech s.r.l. 2020/11/06
-- MachiningLib.lua by Egaltech s.r.l. 2020/11/13
-- Libreria ricerca lavorazioni per Travi
-- Tabella per definizione modulo
@@ -112,7 +112,7 @@ function MachiningLib.FindDrilling( dDiam, dDepth, bDown)
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dDiamTh = EgtTdbGetCurrToolThDiam()
local dFreeLen = dMaxToolLength
local dFreeLen = dTMaxDepth
if dTDiam < dDiam - 10 * GEO.EPS_SMALL then
if not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL then
return Drilling.Name, Drilling.Type, dTMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dFreeLen
+51 -18
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2020/12/09
-- ProcessCut.lua by Egaltech s.r.l. 2021/01/13
-- Gestione calcolo singoli tagli di lama per Travi
-- Tabella per definizione modulo
@@ -8,6 +8,7 @@ local ProcessCut = {}
require( 'EgtBase')
local BL = require( 'BeamLib')
local DC = require( 'DiceCut')
local LongCut = require( 'ProcessLongCut')
EgtOutLog( ' ProcessCut started', 1)
@@ -195,21 +196,42 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
local bFillTail
-- se pezzo ancora attaccato alla trave, per non rovinare quello successivo
if not BL.IsSplittedPartPhase( nPhase) then
-- se non da sotto e praticamente orizzontale ( inclinazione inferiore a 11.5deg)
if not bDownCut and vtN:getZ() > 0.98 then
-- se la faccia occupa tutta la trave in X e Y e non interessa la faccia inferiore, si fanno partire i tagli a cubetti dalla testa
if abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL and abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL and
abs( Proc.Box:getMin():getY() - b3Solid:getMin():getY()) < 10*GEO.EPS_SMALL and abs( Proc.Box:getMax():getY() - b3Solid:getMax():getY()) < 10*GEO.EPS_SMALL and
b3Solid:getMin():getZ() < Proc.Box:getMin():getZ() - 100 * GEO.EPS_SMALL then
bFillAreaPiece = true
-- se non da sotto
if not bDownCut then
-- se praticamente orizzontale ( inclinazione inferiore a 11.5deg)
if vtN:getZ() > 0.98 then
-- se la faccia occupa tutta la trave in X e Y e non interessa la faccia inferiore, si fanno partire i tagli a cubetti dalla testa
if abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL and abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL and
abs( Proc.Box:getMin():getY() - b3Solid:getMin():getY()) < 10*GEO.EPS_SMALL and abs( Proc.Box:getMax():getY() - b3Solid:getMax():getY()) < 10*GEO.EPS_SMALL and
b3Solid:getMin():getZ() < Proc.Box:getMin():getZ() - 100 * GEO.EPS_SMALL then
bFillAreaPiece = true
end
-- se praticamente verticale di fianco ( inclinazione inferiore a 11.5deg)
elseif abs( vtN:getY()) > 0.98 then
-- se la faccia occupa tutta la trave in X e Z e non interessa la faccia inferiore, do errore
if abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL and abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL and
abs( Proc.Box:getMin():getZ() - b3Solid:getMin():getZ()) < 10*GEO.EPS_SMALL and abs( Proc.Box:getMax():getZ() - b3Solid:getMax():getZ()) < 10*GEO.EPS_SMALL then
local sErr = 'Error : Impossible to machine by orientation (on side)'
EgtOutLog( sErr)
return false, sErr
end
end
end
-- se non da sotto e quasi orizzontale ( inclinazione inferiore a 30)
if not bDownCut and vtN:getZ() > 0.866 then
-- se la faccia termina davanti o dietro la trave e arriva in coda e non interessa la faccia inferiore, forzo il taglio a cubetti a partire dal davanti
if ( abs( Proc.Box:getMin():getY() - b3Solid:getMin():getY()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getY() - b3Solid:getMax():getY()) < 10*GEO.EPS_SMALL) and
abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL and b3Solid:getMin():getZ() < Proc.Box:getMin():getZ() - 100 * GEO.EPS_SMALL then
bFillTail = true
-- se quasi orizzontale ( inclinazione inferiore a 30)
if vtN:getZ() > 0.866 then
-- se la faccia termina davanti o dietro la trave e arriva in coda e non interessa la faccia inferiore, forzo il taglio a cubetti a partire dal davanti
if ( abs( Proc.Box:getMin():getY() - b3Solid:getMin():getY()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getY() - b3Solid:getMax():getY()) < 10*GEO.EPS_SMALL) and
abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL and b3Solid:getMin():getZ() < Proc.Box:getMin():getZ() - 100 * GEO.EPS_SMALL then
bFillTail = true
end
-- se verticale quasi completamente di fianco ( inclinazione inferiore a 30)
elseif abs( vtN:getY()) > 0.866 then
-- se la faccia termina davanti o dietro la trave e arriva in coda e non interessa la faccia inferiore, forzo il taglio a cubetti a partire dal davanti
if ( abs( Proc.Box:getMin():getZ() - b3Solid:getMin():getZ()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getZ() - b3Solid:getMax():getZ()) < 10*GEO.EPS_SMALL) and
abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL then
local sErr = 'Error : Impossible to machine by orientation (on side)'
EgtOutLog( sErr)
return false, sErr
end
end
end
end
@@ -231,6 +253,11 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if Proc.CutFront then
return true
end
-- se ho il parametro Q04 = 1 e il taglio copre la lunghezza della trave allora lancio il processo dell'L10
local nAsLongCut = EgtGetInfo( Proc.Id, 'Q04', 'd') or 0
if nAsLongCut == 1 and bFillAreaPiece then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, true)
end
-- se vero taglio, eventuale inserimento smussi
if Proc.Prc == 10 then
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
@@ -381,7 +408,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
dExtraCut = BD.CUT_EXTRA
end
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dNzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, nil, b3Raw)
local dVzLimDwnUp = dNzLimDwnUp
if not BD.C_SIMM and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -434,16 +463,20 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
if abs( vtN:getZ()) > 0.5 then
if vtN:getZ() > 0.5 then
dOffs = dOffs - 0.6 * Proc.Box:getDimX()
elseif vtN:getZ() < -0.5 then
dOffs = dOffs - 0.2 * Proc.Box:getDimX()
elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then
dOffs = dOffs - 0.3 * Proc.Box:getDimX()
end
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
if abs( vtN:getZ()) > 0.5 then
if vtN:getZ() > 0.5 then
dOffs = dOffs - 0.6 * Proc.Box:getDimX()
elseif vtN:getZ() < -0.5 then
dOffs = dOffs - 0.2 * Proc.Box:getDimX()
elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then
dOffs = dOffs - 0.3 * Proc.Box:getDimX()
end
+6 -4
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2020/12/29
-- ProcessDrill.lua by Egaltech s.r.l. 2021/01/13
-- Gestione calcolo forature per Travi
-- Tabella per definizione modulo
@@ -290,6 +290,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
sDrilling = sDrilling2
nType = nType2
dMaxDepth = dMaxDepth2
dToolDiam = dToolDiam2
dDiamTh = dDiamTh2
dToolFreeLen = dToolFreeLen2
dDepth = dDepth2
@@ -313,13 +314,14 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local dSubL1 = 0
local dSubL2 = 0
local dSubL3 = 0
local dDeltaRad = ( Proc.Diam - dToolDiam) / 2
-- se foro non su testa o coda e inclinato, limito il massimo affondamento
local bInvertFcse = ( bToInvert and Proc.Flg ~= -2)
if ( not bInvertFcse and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) or ( bInvertFcse and Proc.Fce ~= 5 and Proc.Fce ~= 6) then
local CosB = abs( vtExtr:getX())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL1 = ( dDiamTh / 2 + 2) * TgA
dSubL1 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA
else
dMaxDepth = 0
end
@@ -329,7 +331,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local CosB = abs( vtExtr:getZ())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL2 = ( dDiamTh / 2 + 2) * TgA
dSubL2 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA
else
dMaxDepth = 0
end
@@ -339,7 +341,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local CosB = abs( vtExtr:getY())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL3 = ( dDiamTh / 2 + 2) * TgA
dSubL3 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA
else
dMaxDepth = 0
end
+2 -2
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/12/10
-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/01/13
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
@@ -185,7 +185,7 @@ local function VerifySawChain( Proc, dMinDim, dMaxDim, vtOrtho)
dSawCornerRad = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or dSawCornerRad
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
if dSawThick <= dMinDim and dSawWidth <= dMaxDim then
if dSawThick < dMinDim + 10 * GEO.EPS_SMALL and dSawWidth < dMaxDim + 10 * GEO.EPS_SMALL then
bUseSawChain = true
end
end
+3 -3
View File
@@ -1,4 +1,4 @@
-- ProcessLongCut.lua by Egaltech s.r.l. 2020/10/09
-- ProcessLongCut.lua by Egaltech s.r.l. 2021/01/11
-- Gestione calcolo taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -143,7 +143,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
@@ -187,7 +187,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
-- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del rggio utensile).
-- Questo viene fatto se Q07=1 o fresa da sotto
----------------------------------------------------------------------------------------------------------------------------------------
local bUseBlade = ( EgtGetInfo( Proc.Id, 'Q05', 'i') == 1)
local bUseBlade = ( EgtGetInfo( Proc.Id, 'Q05', 'i') == 1) or bCustUseBlade
local nUseMillOnSide = EgtGetInfo( Proc.Id, 'Q07', 'i') or 0
-- se entrambe i Q sono attivi, disabilito lama
if nUseMillOnSide > 0 then bUseBlade = false end