DataBeam :

- modifiche per doppia passata su profili Concave e Convex
- tagli doppi di testa e split con controllo sezioni migliorate
- corretto controllo fori sdoppiati.
This commit is contained in:
Dario Sassi
2019-04-08 11:41:58 +00:00
parent 6eaba8a577
commit 04059c20ac
7 changed files with 189 additions and 58 deletions
+65 -12
View File
@@ -1,4 +1,4 @@
-- ProcessProfConcave.lua by Egaltech s.r.l. 2019/04/01
-- ProcessProfConcave.lua by Egaltech s.r.l. 2019/04/08
-- Gestione calcolo profilo caudato per Travi
-- Tabella per definizione modulo
@@ -48,7 +48,7 @@ local function GetSawCutData( AuxId, vtN)
local ptStart = EgtMP( AuxId, GDB_ID.ROOT)
local frOCS = Frame3d( ptStart, vtNP) ;
local b3Box = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frOCS)
ptStart = ptStart + vtNP * ( b3Box:getDimZ() + 10.0)
ptStart = ptStart + vtNP * ( b3Box:getMax():getZ() + 10.0)
-- restituisco i dati del piano
return ptStart, vtNP
end
@@ -67,7 +67,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
-- recupero i dati della curva e del profilo
local dDepth = abs( EgtCurveThickness( AuxId))
local dProfDepth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local nFirstFacet = 0 -- faccia iniziale
local nLastFacet = EgtSurfTmFacetCount( Proc.Id) - 1 -- faccia finale
@@ -113,6 +113,17 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr)
return false, sErr
end
-- Recupero i dati dell'utensile
local dToolMaxDepth = 0
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolMaxDepth = EgtTdbGetCurrToolMaxDepth()
end
end
-- verifico se necessario lavorare in doppio
local bDouble = ( nSide ~= 0 and dProfDepth > dToolMaxDepth)
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP )
-- inserisco la lavorazione
local sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling)
@@ -123,8 +134,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- se lavorazione da sopra
if nSide == 1 then
-- se lavorazione da sopra o da sotto
if nSide ~= 0 then
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
if ( vtN:getX() > 0 and vtExtr:getY() < -0.1) or
( vtN:getX() < 0 and vtExtr:getY() > 0.1) then
@@ -145,22 +156,64 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
end
-- se in doppio, imposto l'affondamento
if bDouble then
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
-- imposto parametri di attacco e uscita
local bInvert = EgtGetMachiningParam( MCH_MP.INVERT)
local dLiPerp = 0
if ( not bInvert and not bFirstTrim) or ( bInvert and not bLastTrim) then dLiPerp = 5 end
local dLoPerp = 0
if ( not bInvert and not bLastTrim) or ( bInvert and not bFirstTrim) then dLoPerp = 5 end
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
EgtSetMachiningParam( MCH_MP.LIPERP, 5)
EgtSetMachiningParam( MCH_MP.LOPERP, 5)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
-- se lavorazione da due parti, aggiungo la seconda
if bDouble then
-- inserisco la lavorazione
local sName = 'ProfB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- se lavorazione da sopra o da sotto
if nSide ~= 0 then
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
if ( vtN:getX() > 0 and vtExtr:getY() > 0.1) or
( vtN:getX() < 0 and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
-- altrimenti lavorazione da sotto
else
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( vtN:getX() > 0 and vtN:getY() > 0.1) or
( vtN:getX() < 0 and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
end
-- imposto l'affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
-- imposto parametri di attacco e uscita
EgtSetMachiningParam( MCH_MP.LIPERP, 5)
EgtSetMachiningParam( MCH_MP.LOPERP, 5)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
-- eventuale finitura faccia finale (ortogonale alla trave)
if nSide ~= -1 and bLastTrim then
sName = 'ProfV_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))