DataBeam :

- aggiunta gestione di SteoJoint e StepJointNotch
- modifiche varie.
This commit is contained in:
Dario Sassi
2019-09-25 18:33:48 +00:00
parent c8a4a2bb6e
commit e42f60cebe
13 changed files with 452 additions and 58 deletions
+19 -25
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2019/09/17
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2019/09/25
-- Gestione calcolo doppi tagli di lama per Travi
-- Tabella per definizione modulo
@@ -31,8 +31,8 @@ function ProcessDoubleCut.Classify( Proc)
-- se due facce, verifico se convesso
local bConvex = true
if nFacetCnt == 2 then
local _, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
bConvex = ( dAng > 0)
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
bConvex = not bAdj or ( dAng > 0)
end
-- verifico le normali delle facce
for i = 1, nFacetCnt do
@@ -66,16 +66,20 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local vtNm = ( vtN[1] + vtN[2]) ; vtNm:normalize()
local bHead = ( vtNm:getX() > 0)
-- angolo diedro per stabilire se taglio convesso
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local vtDir = ptP1 - ptP2 ; vtDir:normalize()
local bOnY = abs( vtDir:getZ()) > 0.5 and ( abs( vtDir:getZ()) + abs( vtDir:getX()) > abs( vtDir:getY()))
local bConvex = ( dAng > 0)
local dLen = dist( ptP1, ptP2)
local ptPs = ( ptP1 + ptP2) / 2
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local bConvex = true
local bOnY = true
local ptPs = ( ptC[1] + ptC[2]) / 2
if bAdj then
local vtDir = ptP1 - ptP2 ; vtDir:normalize()
bOnY = abs( vtDir:getZ()) > 0.5 and ( abs( vtDir:getZ()) + abs( vtDir:getX()) > abs( vtDir:getY()))
ptPs = ( ptP1 + ptP2) / 2
bConvex = ( dAng > 0)
end
-- determino quale faccia è più grande
local dSqDim1 = ( ptC[1] - ptPs):sqlen()
local dSqDim2 = ( ptC[2] - ptPs):sqlen()
local nBigInd = EgtIf( dSqDim1 >= dSqDim2, 1, 2)
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0)
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1)
local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2)
local nSmaInd = 3 - nBigInd
-- recupero la lavorazione
local sCutting = ML.FindCutting( EgtIf( bHead, 'HeadSide', 'TailSide'))
@@ -153,7 +157,7 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
for i = 1, #vCuts do
-- determino il modo di tagliare
local k, l = nBigInd, nSmaInd
if ( i % 2 == 1) == ( not bConvex) then
if ( i % 2) == 1 then
k, l = l, k
end
local nOrthoOpposite
@@ -161,18 +165,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local bFront = ( ptC[k]:getY() < ptPs:getY())
nOrthoOpposite = EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT)
else
if bConvex then
if dLen < dMaxDepth then
local bFront = ( vtN[k]:getY() < 0.02)
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
else
local bOver = ( ptC[k]:getZ() > ptC[l]:getZ())
nOrthoOpposite = EgtIf( bOver, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_TOP)
end
local bOver = ( ptC[k]:getZ() > ptC[l]:getZ())
nOrthoOpposite = EgtIf( bOver, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_TOP)
end
-- lavoro la faccia
for j = 1, #vCuts[i] do