DataBeam :

- aggiunta gestione tagli in FrontMortise e FrontDtMortise
- completata gestione tagli lunghi per non rovinare i pezzi successivi
- aggiunte a tutte le chiamate di Cut.Make e DoubleCut.Make il passaggio del sovramateriale di testa.
This commit is contained in:
Dario Sassi
2020-10-14 09:44:57 +00:00
parent 8d59402134
commit 0a5c8a146b
19 changed files with 241 additions and 66 deletions
+46 -3
View File
@@ -1,4 +1,4 @@
-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/08/26
-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/10/09
-- Gestione calcolo mortase a coda di rondine per Travi
-- Tabella per definizione modulo
@@ -6,11 +6,12 @@ local ProcessDtMortise = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Cut = require( 'ProcessCut')
EgtOutLog( ' ProcessDtMortise started', 1)
-- Dati
local BL = require( 'BeamLib')
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
@@ -25,6 +26,12 @@ function ProcessDtMortise.Identify( Proc)
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56))
end
---------------------------------------------------------------------
-- Riconoscimento della sola feature frontale
function ProcessDtMortise.FrontIdentify( Proc)
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56)
end
---------------------------------------------------------------------
-- Verifica se feature di coda
function ProcessDtMortise.IsTailFeature( Proc, b3Raw)
@@ -56,6 +63,16 @@ function ProcessDtMortise.Classify( Proc)
return true, bDown
end
---------------------------------------------------------------------
-- Piano di taglio della feature
function ProcessDtMortise.GetCutPlane( Proc)
if ProcessDtMortise.FrontIdentify( Proc) then
return EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
else
return nil, nil
end
end
---------------------------------------------------------------------
local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
-- copio la curva di base
@@ -91,7 +108,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- ingombro del pezzo
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
if not b3Solid then
@@ -116,6 +133,32 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- verifico se di tipo pocket
local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1)
if bPocket then bMakeAntiSplitPath = false end
-- verifico se frontale
local bFront = ( Proc.Prc == 56)
-- se mortasa di fronte, eseguo il taglio della faccia
if bFront then
-- verifico esista la faccia di taglio
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
if not bOk then return bOk, sErr end
end
end
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'DtMortise')
if not sMilling then