DataBeam :

- correzioni varie.
This commit is contained in:
Dario Sassi
2021-01-25 08:18:54 +00:00
parent ffc30b27dc
commit 786b1224a2
7 changed files with 80 additions and 54 deletions
+14 -14
View File
@@ -1,4 +1,4 @@
-- ProcessStepJoint.lua by Egaltech s.r.l. 2020/12/02
-- ProcessStepJoint.lua by Egaltech s.r.l. 2021/01/23
-- Gestione calcolo giunto a gradino per Travi
-- Tabella per definizione modulo
@@ -157,7 +157,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- normale media per capire se taglio di testa o di coda
local vtNm = ( vtN[1] + vtN[2]) ; vtNm:normalize()
local bHead = ( vtNm:getX() > 0)
-- angolo diedro per stabilire se taglio convesso
-- angolo diedro per stabilire se taglio convesso (due facce separate sono sicuramente convesse)
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local bConvex = true
local bOnY = true
@@ -168,18 +168,6 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
ptPs = ( ptP1 + ptP2) / 2
bConvex = ( dAng > 0)
end
-- calcolo direzione di lavoro
local vtRef = {}
local vtTg = ptP2 - ptP1 ;
vtRef[1] = vtN[1] ^ vtTg
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
vtRef[2] = vtN[2] ^ vtTg
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
-- determino quale faccia è più grande
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'))
if not sCutting then
@@ -235,6 +223,18 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- altrimenti concavo
else
-- calcolo direzione di lavoro
local vtRef = {}
local vtTg = ptP2 - ptP1 ;
vtRef[1] = vtN[1] ^ vtTg
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
vtRef[2] = vtN[2] ^ vtTg
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
-- determino quale faccia è più grande
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
-- calcolo extra taglio
local dCutExtra = dExtraUp
if dAng < -90.5 and dAng > -179.5 then