DataBeam :

- correzioni per tagli su pezzi grossi
- correzioni varie.
This commit is contained in:
Dario Sassi
2019-09-04 18:31:10 +00:00
parent fcdc31ae09
commit 4d26232057
9 changed files with 140 additions and 114 deletions
+30 -17
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2019/07/08
-- ProcessCut.lua by Egaltech s.r.l. 2019/09/04
-- Gestione calcolo singoli tagli di lama per Travi
-- Tabella per definizione modulo
@@ -21,6 +21,19 @@ function ProcessCut.Identify( Proc)
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
end
---------------------------------------------------------------------
-- Classificazione della feature
function ProcessCut.Classify( Proc, b3Raw)
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
if vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1 then
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
if DimH > BD.MAX_DIM_DICE then
return true, true
end
end
return true, false
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
@@ -101,24 +114,24 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo
for i = 1, #vCuts do
-- determino il modo di tagliare
local nOrthoOpposite
local vtOrthoO
if vtO then
if i % 2 == 1 then
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtN)
vtOrthoO = vtN
else
if #vCuts[i-1] > 0 then
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtO)
vtOrthoO = vtO
else
nOrthoOpposite = MCH_MILL_FU.ORTHO_DOWN
vtOrthoO = Z_AX()
end
end
else
if bHorizCut then
nOrthoOpposite = MCH_MILL_FU.ORTHO_DOWN
vtOrthoO = Z_AX()
elseif vtN:getY() > -0.02 then
nOrthoOpposite = MCH_MILL_FU.ORTHO_FRONT
vtOrthoO = Y_AX()
else
nOrthoOpposite = MCH_MILL_FU.ORTHO_BACK
vtOrthoO = -Y_AX()
end
end
-- lavoro la faccia
@@ -128,11 +141,11 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se strato pari composto da 1 o 2 elementi
if i % 2 == 0 and #vCuts[i] <= 2 then
-- il primo elemento prende la direzione prevista, il secondo quella opposta
local nNewOrthoOpposite = nOrthoOpposite
local vtNewOrthoO = vtOrthoO
if j ~= 1 then
nNewOrthoOpposite = EgtIf( nOrthoOpposite == MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT)
vtNewOrthoO = -vtOrthoO
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nNewOrthoOpposite, nil, 0.1, BD.CUT_SIC, 0, 0, nil, b3Raw)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, nil, 0.1, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -140,7 +153,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- tutti gli altri casi vengono saltati
-- caso generale
else
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, nil, -0.5, BD.CUT_SIC, 0, 0, nil, b3Raw)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -0.5, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -150,15 +163,15 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- altrimenti tagli diretti della faccia
else
-- lavoro la faccia
local nOrthoOpposite
local vtOrthoO
if bHorizCut then
nOrthoOpposite = MCH_MILL_FU.ORTHO_DOWN
vtOrthoO = Z_AX()
elseif vtN:getY() > -0.02 then
nOrthoOpposite = MCH_MILL_FU.ORTHO_FRONT
vtOrthoO = Y_AX()
else
nOrthoOpposite = MCH_MILL_FU.ORTHO_BACK
vtOrthoO = -Y_AX()
end
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, nil, b3Raw)
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end