DataBeam :

- aggiunto controllo file macchina mlde per ricalcolo
- modifiche per PF1250.
This commit is contained in:
Dario Sassi
2021-02-22 10:56:12 +00:00
parent 9c93119f75
commit 031ad00966
6 changed files with 321 additions and 91 deletions
+32 -22
View File
@@ -1,4 +1,4 @@
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/22/02
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/02/22
-- Gestione calcolo doppi tagli di lama per Travi
-- Tabella per definizione modulo
@@ -28,6 +28,10 @@ end
function ProcessDoubleCut.Classify( Proc, b3Raw)
--se una faccia, uso la classificazione dei tagli singoli
if Proc.Fct == 1 then return Cut.Classify( Proc, b3Raw) end
-- se PF con testa da sotto, ammessa qualunque orientazione
if BD.C_SIMM and BD.DOWN_HEAD then
return true
end
-- verifico se convesso
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local bConvex = ( not bAdj or ( dAng > 0))
@@ -180,23 +184,6 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- inserimento smussi
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOkc then return bOkc, sErrC end
-- recupero la lavorazione
local sCutting = ML.FindCutting( EgtIf( bHead, 'HeadSide', 'TailSide'))
if not sCutting then
local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dSawDiam = 400
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
@@ -237,6 +224,31 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- altrimenti concavo
else
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -30deg)
local bTopHead = ( BD.DOWN_HEAD and vtNm:getZ() > -0.5)
local bDownHead = ( BD.DOWN_HEAD and vtNm:getZ() < -0.5)
-- recupero la lavorazione
local sCutType = EgtIf( bHead, 'HeadSide', 'TailSide')
local sCutting = ML.FindCutting( sCutType .. EgtIf( bDownHead, '_H2', ''))
if not sCutting and bTopHead then
sCutting = ML.FindCutting( sCutType)
bDownHead = false
end
if not sCutting then
local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dSawDiam = 400
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- verifico se necessari tagli supplementari
local vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
--DC.PrintOrderCut( vCuts)
@@ -266,14 +278,12 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- altrimenti, tagli diretti delle facce
else
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, EgtIf( bHead, 'HeadSide', 'TailSide'), false)
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType .. EgtIf( bDownHead, '_H2', ''), false, bDownHead)
if not bOk then
return bOk, sErr
end
end
end
-- eventuale segnalazione ingombro di testa o coda (se non convesso, altrimenti già fatto nei tagli singoli)
if not bConvex then
-- segnalazione ingombro di testa o coda
if Proc.Head then
-- intersezioni con linee a metà altezza appena dentro dal davanti e dal dietro
local ptRef = b3Raw:getCenter() - 0.5 * b3Raw:getDimX() * X_AX()