DataBeam :

- modifiche per fori orizzontali passanti in Y (limite lunghezza punta per foro da dietro)
- correzione lavorazione L080.
This commit is contained in:
Dario Sassi
2020-12-02 16:16:16 +00:00
parent e0698bb00d
commit 8513022761
3 changed files with 64 additions and 44 deletions
+38 -37
View File
@@ -1,4 +1,4 @@
-- ProcessStepJoint.lua by Egaltech s.r.l. 2020/06/04
-- ProcessStepJoint.lua by Egaltech s.r.l. 2020/12/02
-- Gestione calcolo giunto a gradino per Travi
-- Tabella per definizione modulo
@@ -137,6 +137,8 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione al caso due facce
local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- delta negativo affondamento lama per facce concave
local dExtraUp = -0.3
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -166,6 +168,13 @@ 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)
@@ -224,8 +233,13 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
end
-- altrimenti
-- altrimenti concavo
else
-- calcolo extra taglio
local dCutExtra = dExtraUp
if dAng < -90.5 and dAng > -179.5 then
dCutExtra = - dSawThick / tan( 180 + dAng) + dExtraUp
end
-- verifico se necessari tagli supplementari
local vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
--DC.PrintOrderCut( vCuts)
@@ -247,22 +261,12 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- 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
-- assegno il modo di tagliare
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd])
-- 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)
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -300,6 +304,8 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione al caso tre facce
local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- delta negativo affondamento lama per facce concave
local dExtraUp = -0.3
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -342,6 +348,13 @@ local function MakeThreeFaces( 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)
@@ -384,17 +397,15 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
end
-- Taglio le facce 0 e 1 concave
-- calcolo extra taglio
local dCutExtra = dExtraUp
if dAng < -90.5 and dAng > -179.5 then
dCutExtra = - dSawThick / tan( 180 + dAng) + dExtraUp
end
-- verifico se necessari tagli supplementari
local vCuts = DC.GetDice( EgtGetParent( Proc.Id), 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
for i = 1, #vCuts do
for j = 1, #vCuts[i] do
@@ -405,22 +416,12 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- 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
-- assegno il modo di tagliare
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd])
-- 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)
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end