DataBeam :
- revisione generale e migliorie nei tagli.
This commit is contained in:
+26
-64
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/09
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/20
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||
|
||||
@@ -742,7 +742,8 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, b3Raw, nChamfer)
|
||||
if AddId then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
local nCutFacet = EgtSurfTmFacetCount( AddId)
|
||||
if nCutFacet == 1 then
|
||||
return Cut.Make( CutProc, nPhase, nRawId, nPartId, 0)
|
||||
@@ -1857,26 +1858,22 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
b3Raw, nDiffWidth, nUseRoughTool, dAng, sPocketing, sTuuidPk, dPrevFaceElev)
|
||||
|
||||
local sMchFind = 'Pocket'
|
||||
local dAngLimit = 30
|
||||
local dAngLimit = 40
|
||||
|
||||
-- se feature é larga come trave imposto openpocket
|
||||
if nDiffWidth == 0 then
|
||||
sMchFind = 'OpenPocket'
|
||||
-- altrimenti non è passante disabilito il truciolatore e amplio il limite angolare
|
||||
-- per la differenza di lunghezza tra il truciolatore e la fresa più lunga
|
||||
-- altrimenti non è passante disabilito il truciolatore
|
||||
else
|
||||
nUseRoughTool = 0
|
||||
dAngLimit = 40
|
||||
end
|
||||
-- se angolo tra le facce maggiore di 90, inserisco la contornatura o svuotatura del lato più corto
|
||||
if ( 180 + dAng) > 90.1 then
|
||||
-- calcolo l'angolo dalla verticale dall'angolo tra le due facce, perchè la feature potrebbe essere ruotata sulla Z locale della
|
||||
-- faccia principale e quindi la componente X del versore della faccia potrebbe dare un valore non coerente
|
||||
local dDiffFromSqAng = 180 + dAng - 90
|
||||
-- se la normale della faccia corta si discosta dalla trave di più dell'angolo selezionato utilizzo la svutatura altrimenti la contornatura
|
||||
-- if abs( tvtN[2]:getX()) < cos(dAngLimit) then -- se si discosta di più del valore impostato applico svuotatura
|
||||
local dDiffFromSqAng = dAng + 90
|
||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||
if cos( dDiffFromSqAng) < cos(dAngLimit) then -- se si discosta di più del valore impostato applico svuotatura
|
||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||
-- applico la svuotatura
|
||||
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng)
|
||||
if not bOk then
|
||||
@@ -2368,7 +2365,6 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, dElev)
|
||||
local bUSAngle
|
||||
local dDiam = min( dH, dV)
|
||||
local dMaxLenFace = max( dH, dV)
|
||||
-- verifico che diametro utensile prende con la openpocket con la massima dimensione faccia
|
||||
@@ -2723,7 +2719,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
||||
local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
local sWarn
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
@@ -2838,15 +2834,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
||||
-- Questa feature non è applicata su facce di testa e quindi non controllo l'entrata in X
|
||||
if abs(vtOrtho:getZ()) >= 0.707 then
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
|
||||
--elseif abs(vtOrtho:getZ()) < 0.707 and abs(vtOrtho:getY()) > 0.707 then
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
||||
--elseif abs(vtOrtho:getZ()) <= 0.707 and vtOrtho:getY() < -0.707 then
|
||||
-- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_FRONT)
|
||||
--elseif abs(vtOrtho:getZ()) < 0.707 and vtOrtho:getX() > 0.707 then
|
||||
-- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_LEFT)
|
||||
--else
|
||||
-- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_RIGHT)
|
||||
end
|
||||
-- imposto offset radiale
|
||||
local dOffs = ( i - 1) * dStep
|
||||
@@ -2921,7 +2910,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
||||
local bSpecial3faces = false
|
||||
-- verifico se sono nel caso in cui la faccia esclusa ha elevazione più alta
|
||||
if not bIsU and bIsL and Proc.Fct <= 3 and nFacInd ~= 0 and nFacInd2 ~= 0 then
|
||||
-- if not bIsU and bIsL and Proc.Fct <= 3 then
|
||||
-- verifico se l'elevazione della faccia esclusa è maggiore dell'elevazione delle altre due facce
|
||||
local nFaceMaxElev = 0
|
||||
if Proc.Fct == 3 then
|
||||
@@ -3074,52 +3062,26 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
||||
-- recupero la lavorazione
|
||||
local dCollSic = 2 * BD.COLL_SIC
|
||||
if abs( vtN:getX()) > 0.996 or abs( vtN:getY()) > 0.996 or abs( vtN:getZ()) > 0.996 then dCollSic = 0 end
|
||||
local nUseRoughTool = 0
|
||||
local sMchFind = 'Pocket'
|
||||
local dDiam
|
||||
-- se processo 20 vedo se ho truciolatore abilitato
|
||||
if Proc.Prc == 20 then
|
||||
-- se forzato uso truciolatore altrimenti prosegue con fresa più piccola
|
||||
if EgtGetInfo( Proc.Id, sUseRoughTool, 'i') ~= 0 then
|
||||
sMchFind = 'OpenPocket'
|
||||
nUseRoughTool = 1
|
||||
end
|
||||
dDiam = min( dH, dV)
|
||||
else
|
||||
-- Da disposizini di Alessandro, se feature lavorata in singolo passo uso fresa
|
||||
if bSingle_part then
|
||||
-- disabilito il truciolatore
|
||||
local nUseRoughTool = 0
|
||||
local dDiam = min( dH, dV)
|
||||
-- verifico dalla forma se non posso prendere utensile grande
|
||||
if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then
|
||||
--verifico dimensioni con facce adiacenti
|
||||
dDiam, sMchFind, nUseRoughTool = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic))
|
||||
if not dDiam then
|
||||
sMchFind = 'Pocket'
|
||||
nUseRoughTool = 0
|
||||
-- verifico dalla forma se posso prendere utensile più grande
|
||||
if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) then
|
||||
--verifico dimensioni facce adiacenti
|
||||
dDiam, sMchFind, nUseRoughTool = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic))
|
||||
if not dDiam then
|
||||
dDiam = min( dH, dV)
|
||||
sMchFind = 'Pocket'
|
||||
nUseRoughTool = 0
|
||||
end
|
||||
else
|
||||
dDiam = min( dH, dV)
|
||||
end
|
||||
-- altrimenti le lavorata in passo multiplo
|
||||
else
|
||||
-- abilito il truciolatore
|
||||
sMchFind = 'OpenPocket'
|
||||
dDiam = min( dH, dV)
|
||||
end
|
||||
end
|
||||
-- se processo 20 e non sto usando il truciolatore
|
||||
if Proc.Prc == 20 and nUseRoughTool == 0 then
|
||||
-- verifico se forzato uso truciolatore
|
||||
local nUseRT = EgtGetInfo( Proc.Id, sUseRoughTool, 'i')
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
sMchFind = 'OpenPocket'
|
||||
nUseRoughTool = 1
|
||||
-- verifico dalla forma se posso prendere utensile più grande
|
||||
if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) or ( Proc.Fct == 1 and not bIsU and not bIsL) then
|
||||
--verifico dimensioni facce adiacenti
|
||||
dDiam, sMchFind, nUseRoughTool = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic))
|
||||
if not dDiam then
|
||||
dDiam = min( dH, dV)
|
||||
sMchFind = 'Pocket'
|
||||
nUseRoughTool = 0
|
||||
end
|
||||
else
|
||||
dDiam = min( dH, dV)
|
||||
end
|
||||
end
|
||||
end
|
||||
--EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam))
|
||||
@@ -3284,7 +3246,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
|
||||
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
||||
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, Fct = nFct, Flg = Proc.Flg}
|
||||
local bOk, sMyWarn = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, false)
|
||||
local bOk, sMyWarn = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId)
|
||||
if not sWarn then sWarn = sMyWarn end
|
||||
if not bOk then return bOk, sWarn end
|
||||
end
|
||||
@@ -3354,7 +3316,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- tre o più facce
|
||||
else
|
||||
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, true)
|
||||
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user