DataBeam :

- modifiche Filippo per pezzi del cliente NL.
This commit is contained in:
Dario Sassi
2021-01-19 18:34:58 +00:00
parent 9350e2b5f4
commit ffc30b27dc
3 changed files with 101 additions and 41 deletions
+50 -38
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2021/01/13
-- ProcessCut.lua by Egaltech s.r.l. 2021/01/15
-- Gestione calcolo singoli tagli di lama per Travi
-- Tabella per definizione modulo
@@ -177,7 +177,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut)
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -194,26 +194,52 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
local bFillAreaPiece
local bFillTail
-- se taglio di testa
if Proc.Head then
-- se coincide con il taglio di separazione precedente, non va fatto
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
return true
end
-- altrimenti taglio di coda
else
-- se coincide con taglio di separazione, non va fatto
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < BD.OVM_MID + 10 * GEO.EPS_SMALL then
return true
end
end
-- se coincide con un taglio frontale non va fatto
if Proc.CutFront then
return true
end
-- se pezzo ancora attaccato alla trave, per non rovinare quello successivo
if not BL.IsSplittedPartPhase( nPhase) then
-- 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
bFillAreaPiece = bCustDiceCut
-- se true il controllo è già stato fatto dal modulo che ha chiamato il ProcessCut
if not bFillAreaPiece then
-- se poco inclinata ( inclinazione inferiore a 21.56 deg)
if vtN:getZ() > 0.93 then
-- se la faccia occupa tutta la trave in X e Y o occupa sicuramente la faccia in Y e almeno 3/4 della lunghezza in X e sborda in X e non interessa la faccia inferiore,
-- si possono far partire i tagli a cubetti dalla testa o lasciare il cordoncino centrale
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) or
( ( abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL) and
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 1500.000))) 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 21.56deg)
elseif abs( vtN:getY()) > 0.93 then
-- se la faccia occupa tutta la trave in X e Z o occupa sicuramente la faccia in Z e almeno 3/4 della faccia in X e sborda in X,
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) or
( ( abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL) and
Proc.Box:getDimX() > 0.75 * b3Solid:getDimX())) 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 quasi orizzontale ( inclinazione inferiore a 30)
@@ -235,26 +261,8 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
end
end
end
-- se taglio di testa
if Proc.Head then
-- se coincide con il taglio di separazione precedente, non va fatto
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
return true
end
-- altrimenti taglio di coda
else
-- se coincide con taglio di separazione, non va fatto
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < BD.OVM_MID + 10 * GEO.EPS_SMALL then
return true
end
end
-- se coincide con un taglio frontale non va fatto
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
local nAsLongCut = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
if nAsLongCut == 1 and bFillAreaPiece then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, true)
end
@@ -300,10 +308,14 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
end
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxDepth - BD.CUT_EXTRA)
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
if bFillTail and #vCuts == 0 then
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
end
end
-- se il ProcessCut viene lanciato dal ProcessSawCut e non ci sono tagli a cubetti, esco
if bCustDiceCut and #vCuts == 0 then
return false, -1
end
--DC.PrintOrderCut( vCuts)
if #vCuts > 0 then
-- recupero gruppo per geometria addizionale
+7 -2
View File
@@ -1,4 +1,4 @@
-- ProcessLongCut.lua by Egaltech s.r.l. 2021/01/11
-- ProcessLongCut.lua by Egaltech s.r.l. 2021/01/14
-- Gestione calcolo taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -247,7 +247,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade)
local nM = 0
for i = 1, nC do
-- Posizione braccio portatesta
local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
-- ciclo sulle passate
local dOffset = ( dWidth + BD.DIM_STRIP_SMALL) / 2 ;
local dLioTang = 0
@@ -279,6 +279,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade)
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut)
-- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella
if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5*GEO.EPS_SMALL then
nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso della faccia
+44 -1
View File
@@ -1,4 +1,4 @@
-- ProcessSawCut.lua by Egaltech s.r.l. 2020/06/04
-- ProcessSawCut.lua by Egaltech s.r.l. 2021/01/15
-- Gestione calcolo taglio di lama per Travi
-- Tabella per definizione modulo
@@ -8,6 +8,8 @@ local ProcessSawCut = {}
require( 'EgtBase')
local BL = require( 'BeamLib')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
local LongCut = require( 'ProcessLongCut')
EgtOutLog( ' ProcessSawCut started', 1)
@@ -97,6 +99,47 @@ function ProcessSawCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- determino se lavorazione da davanti o da dietro e se da sotto
local bFront = ( vtDir ^ vtN):getX() > 0
local bDownUp = ( vtN:getZ() < -0.259)
local bFillAreaPiece
-- se non da sotto
if not bDownUp then
-- se poco inclinata ( inclinazione inferiore a 21.56 deg)
if vtN:getZ() > 0.93 then
-- verifico se la superfice è prevelentemente orizzontale con Z positiva e occupa tutta la trave o occupa sicuramente la faccia in Y
-- e almeno 3/4 della lunghezza in X e sborda in X e non interessa la faccia inferiore,
-- si possono far partire i tagli a cubetti dalla testa o lasciare il cordoncino centrale
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) or
( ( abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL) and
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 1500.000))) 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 21.56deg)
elseif abs( vtN:getY()) > 0.93 then
-- se la faccia occupa tutta la trave in X e Z o occupa sicuramente la faccia in Z e almeno 3/4 della faccia in X e sborda in X,
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) or
( ( abs( Proc.Box:getMin():getX() - b3Solid:getMin():getX()) < 10*GEO.EPS_SMALL or abs( Proc.Box:getMax():getX() - b3Solid:getMax():getX()) < 10*GEO.EPS_SMALL) and
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 1500.000))) 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 ho il parametro Q04 = 1 e il taglio copre la lunghezza della trave allora lancio il processo dell'L10
local nAsLongCut = EgtGetInfo( Proc.Id, 'Q02', 'i') or 0
if nAsLongCut == 1 and bFillAreaPiece then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, true)
-- se non ho taglio lungo passo al Cut per taglio a cubetti
elseif bFillAreaPiece and abs(( vtDir ^ vtN):getY()) > 0.866 then
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, 0, false, true)
-- se è andata a buon fine oppure ha fallito esco
-- nel caso non ha fatto i tagli a cubetti (sErr vale -1) continuo
if bOk or ( not bOk and type(sErr) ~= 'number') then
return bOk, sErr
end
end
-- determino affondamento e distanza interna da inizio e fine
local dDepth = min( dWidth, dMaxDepth - BD.COLL_SIC)
local dInsDist = 0