DataBeam :

- varie correzioni e migliorie.
This commit is contained in:
Dario Sassi
2020-03-20 08:06:13 +00:00
parent c14b77c9cd
commit 3dd65a606d
6 changed files with 213 additions and 162 deletions
+19 -7
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2020/03/16
-- ProcessCut.lua by Egaltech s.r.l. 2020/03/19
-- Gestione calcolo singoli tagli di lama per Travi
-- Tabella per definizione modulo
@@ -73,11 +73,13 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
end
-- recupero i dati dell'utensile
local dSawDiam = 400
local dSawThick = 2
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
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
@@ -100,11 +102,20 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
return false, sErr
end
-- sistemo posizione nel DB e nome
local bOrthInv = false
for i = 1, #vCuts do
for j = 1, #vCuts[i] do
EgtRelocateGlob( vCuts[i][j], nAddGrpId)
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
if ( i % 2) == 1 then
local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
if ( vtN:getY() > 0.707 and vtO:getY() < -0.05) or
( vtN:getY() < -0.707 and vtO:getY() > 0.05) then
EgtInvertSurf( vCuts[i][j])
bOrthInv = true
end
end
end
end
-- eseguo
@@ -115,12 +126,11 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
vtOrthoO = Vector3d( vtN)
else
local vtO
for j = 1, #vCuts[i-1] do
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
break
if #vCuts[i-1] > 0 then
vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT)
end
if vtO then
vtOrthoO = Vector3d( vtO)
vtOrthoO = Vector3d( vtO) * EgtIf( bOrthInv, -1, 1)
else
if bHorizCut then
vtOrthoO = Z_AX()
@@ -136,7 +146,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
-- se taglio dal basso
if bDownCut then
-- se strato pari composto da 1 o 2 elementi
if i % 2 == 0 and #vCuts[i] <= 2 then
if ( i % 2) == 0 and #vCuts[i] <= 2 then
-- il primo elemento prende la direzione prevista, il secondo quella opposta
local vtNewOrthoO = Vector3d( vtOrthoO)
local dVzLimDwnUp = dNzLimDwnUp
@@ -152,7 +162,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
-- tutti gli altri casi vengono saltati
-- caso generale
else
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dNzLimDwnUp, -0.1, BD.CUT_SIC, 0, 0, nil, b3Raw)
-- se invertiti tagli ortogonali devo approfondire tagli paralleli dello spessore lama
local dExtraCut = EgtIf( ( i % 2) == 0 and bOrthInv, dSawThick, -0.1)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dNzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end