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
+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