DataBeam :
- piccola modifica per lavorazione forature su PF1250 con testa 2 e 1 - modifiche per lavorare su PF1250 tagli di testa e coda pezzi grossi con le due lame.
This commit is contained in:
+88
-27
@@ -1,4 +1,4 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2021/01/02
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2021/02/17
|
||||
-- Gestione calcolo tagli di separazione per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -167,9 +167,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
-- caratteristiche taglio
|
||||
local bHorizCut = ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL and b3Raw:getDimZ() < dMaxDepth - BD.CUT_EXTRA)
|
||||
local bHorizCut = ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth - BD.CUT_EXTRA, BD.MAX_DIM_HTCUT_HBEAM)
|
||||
local bDoubleHorizCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bHorizCut and b3Raw:getDimY() > dDimYRef + 10 * GEO.EPS_SMALL)
|
||||
-- dati geometrici del taglio
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
@@ -192,38 +194,97 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
|
||||
b3Raw:Add( b3NextRaw)
|
||||
end
|
||||
end
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||
dAccStart = 0
|
||||
-- se tagli standard
|
||||
if not bDoubleHorizCut then
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||
dAccStart = 0
|
||||
else
|
||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth - BD.CUT_EXTRA)
|
||||
local dSawRad = dSawDiam / 2
|
||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||
end
|
||||
-- se necessari tagli in doppio, eseguo gli opposti
|
||||
if bDoubleCut then
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
if not bOk then return false, true, sErr end
|
||||
end
|
||||
end
|
||||
-- eseguo i tagli necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes
|
||||
if bSplit then
|
||||
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
end
|
||||
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
if not bOk then return false, true, sErr end
|
||||
end
|
||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||
else
|
||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth - BD.CUT_EXTRA)
|
||||
local dSawRad = dSawDiam / 2
|
||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||
end
|
||||
-- se necessari tagli in doppio, eseguo gli opposti
|
||||
if bDoubleCut then
|
||||
-- verifico di avere la testa da sotto
|
||||
if not BD.DOWN_HEAD then
|
||||
local sErr = 'Error : section too big for head cut'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero la lavorazione con lama da sotto
|
||||
local sCutting2 = ML.FindCutting( 'TailSide_H2')
|
||||
if not sCutting2 then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati della seconda lama
|
||||
local dSawDiam2 = 400
|
||||
local dMaxDepth2 = 50
|
||||
if EgtMdbSetCurrMachining( sCutting2) then
|
||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||
end
|
||||
end
|
||||
-- verifico che le due lame riescano a lavorare la sezione
|
||||
local dDimZ = b3Raw:getDimZ()
|
||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL
|
||||
if dExtra < 0 then
|
||||
local sErr = 'Error : section too height for head cut'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = - dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dCutExtra2 = - dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dAccStart = 0
|
||||
-- eseguo i tagli da sotto necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
if not bOk then return false, true, sErr end
|
||||
end
|
||||
end
|
||||
-- eseguo i tagli necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes
|
||||
if bSplit then
|
||||
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
-- eseguo i tagli necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes
|
||||
if bSplit then
|
||||
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
end
|
||||
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
if not bOk then return false, true, sErr end
|
||||
end
|
||||
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
if not bOk then return false, true, sErr end
|
||||
end
|
||||
-- ritorno anche flag di passaggio a fase successiva
|
||||
return true, true
|
||||
|
||||
Reference in New Issue
Block a user