DataBeam :

- correzione a Taglio Doppio concavo con faccia verso il basso e altra verticale.
This commit is contained in:
Dario Sassi
2020-08-18 10:09:43 +00:00
parent a28fb4c546
commit c1d2881a4d
2 changed files with 48 additions and 55 deletions
+16 -36
View File
@@ -1,4 +1,4 @@
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/06/10
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/08/18
-- Gestione calcolo doppi tagli di lama per Travi
-- Tabella per definizione modulo
@@ -37,7 +37,7 @@ function ProcessDoubleCut.Classify( Proc)
-- verifico le normali delle facce
for i = 1, nFacetCnt do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
if not bConvex and vtN:getZ() < - 0.72 then
if not bConvex and ( vtN:getZ() < - 0.72 or ( vtN:getZ() < - 0.259 and Proc.Box:getDimX() > BD.MAX_DIM_DICE)) then
return true, true
end
end
@@ -188,15 +188,15 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- se convesso, lo tratto come due tagli singoli
if bConvex then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- lavoro per prima la faccia più diretta in alto
local vOrd = { 1, 2}
if vtN[2]:getZ() > vtN[1]:getZ() then
@@ -227,20 +227,12 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- altrimenti
else
-- verifico se necessari tagli supplementari
local vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
local vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
--DC.PrintOrderCut( vCuts)
if #vCuts > 0 then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- sistemo posizione nel DB e nome
-- aggiorno nome e info
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)
end
@@ -248,23 +240,11 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo
for i = 1, #vCuts do
-- determino il modo di tagliare
--local k, l = nBigInd, nSmaInd
--if ( i % 2) == 1 then
-- k, l = l, k
--end
--local nOrthoOpposite
--if bOnY then
-- local bFront = ( ptC[k]:getY() < ptPs:getY())
-- nOrthoOpposite = EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT)
--else
-- local bOver = ( ptC[k]:getZ() > ptC[l]:getZ())
-- nOrthoOpposite = EgtIf( bOver, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_TOP)
--end
local vtOrthOpp = EgtIf( ( i % 2) == 1, vtN[nBigInd], vtN[nSmaInd])
if not bOnY then
vtOrthOpp[2] = 0 ; vtOrthOpp:normalize()
end
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtOrthOpp)
local vtOrthOpp = vtN[nBigInd]
local vtNorm = vtN[nSmaInd]
if ( i % 2) ~= 1 then vtOrthOpp, vtNorm = vtNorm, vtOrthOpp end
if not bOnY then vtOrthOpp[2] = 0 end
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtOrthOpp, vtNorm)
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw)