DataBeam :

- migliorata gestione ingombri testa e coda
- correzioni varie.
This commit is contained in:
Dario Sassi
2019-09-25 06:29:40 +00:00
parent 39be33451a
commit 1eec76b233
17 changed files with 127 additions and 62 deletions
+26 -31
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2019/09/04
-- ProcessCut.lua by Egaltech s.r.l. 2019/09/19
-- Gestione calcolo singoli tagli di lama per Travi
-- Tabella per definizione modulo
@@ -102,36 +102,28 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
end
end
-- recupero la normale dei tagli ortogonali
local vtO
for i = 1, #vCuts, 2 do
for j = 1, #vCuts[i] do
_, vtO = EgtSurfTmFacetCenter( vCuts[i][j], 0, GDB_ID.ROOT)
break
end
if vtO then break end
end
-- eseguo
for i = 1, #vCuts do
-- determino il modo di tagliare
local vtOrthoO
if vtO then
if i % 2 == 1 then
vtOrthoO = vtN
else
if #vCuts[i-1] > 0 then
vtOrthoO = vtO
else
vtOrthoO = Z_AX()
end
end
if i % 2 == 1 then
vtOrthoO = Vector3d( vtN)
else
if bHorizCut then
vtOrthoO = Z_AX()
elseif vtN:getY() > -0.02 then
vtOrthoO = Y_AX()
local vtO
for j = 1, #vCuts[i-1] do
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
break
end
if vtO then
vtOrthoO = Vector3d( vtO)
else
vtOrthoO = -Y_AX()
if bHorizCut then
vtOrthoO = Z_AX()
elseif vtN:getY() > -0.02 then
vtOrthoO = Y_AX()
else
vtOrthoO = -Y_AX()
end
end
end
-- lavoro la faccia
@@ -141,11 +133,13 @@ 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 vtNewOrthoO = vtOrthoO
local vtNewOrthoO = Vector3d( vtOrthoO)
local dVzLimDwnUp = -0.5
if j ~= 1 then
vtNewOrthoO = -vtOrthoO
dVzLimDwnUp = -0.72
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, nil, 0.1, BD.CUT_SIC, 0, 0, nil, b3Raw)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, 0.1, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -177,16 +171,17 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- eventuale segnalazione ingombro di testa o coda
if abs( vtN:getY()) > 0.1 or ( b3Raw:getDimZ() - Proc.Box:getDimZ()) < BD.MIN_HEIGHT then
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
if vtN:getZ() > 0.5 then
if abs( vtN:getZ()) > 0.5 then
dOffs = dOffs / 2
end
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
if vtN:getZ() > 0.5 then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
if abs( vtN:getZ()) > 0.5 then
dOffs = dOffs / 2
end
BL.UpdateTCING( nRawId, dOffs)