DataBeam :

- migliorie e correzioni.
This commit is contained in:
Dario Sassi
2019-07-15 07:00:32 +00:00
parent 19df7d3338
commit d39116d84f
5 changed files with 164 additions and 82 deletions
+58 -24
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/07/08
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/07/12
-- Gestione calcolo mezzo-legno per Travi
-- Tabella per definizione modulo
@@ -110,10 +110,10 @@ function ProcessLapJoint.Classify( Proc)
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
-- verifico se è lavorabile solo dal basso
local bSmall = ( Proc.Box:getDimX() < BD.MAX_LEN_RIDGELAP_FROM_BOTTOM)
local bSmall = (Proc.Head or Proc.Tail) and ( Proc.Box:getDimX() < BD.MAX_LEN_RIDGELAP_FROM_BOTTOM)
local bDown = ( vtN[1]:getZ() < BD.NZ_MINB and vtN[2]:getZ() < BD.NZ_MINB) or
( vtN[1]:getZ() < BD.NZ_MINA and ( abs( vtN[2]:getZ()) > 0.1 or not bSmall)) or
( vtN[2]:getZ() < BD.NZ_MINA and ( abs( vtN[1]:getZ()) > 0.1 or not bSmall))
( vtN[1]:getZ() < BD.NZ_MINA and ( vtN[2]:getZ() < -0.1 or not bSmall)) or
( vtN[2]:getZ() < BD.NZ_MINA and ( vtN[1]:getZ() < -0.1 or not bSmall))
return true, bDown
-- se più di 2 facce
else
@@ -499,12 +499,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
if dH < dMillDiam or dV < dMillDiam then
return MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev)
end
-- se troppo lunga, per il momento la salto, andrà spezzata n parti
if dH > 3400 or dV > 3400 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' feature too long'
EgtOutLog( sErr)
return false, sErr
end
-- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing)
@@ -541,6 +535,14 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
return true
end
---------------------------------------------------------------------
local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
-- troppo lunga, per il momento la salto, andrà spezzata in parti
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' feature too long'
EgtOutLog( sErr)
return false, sErr
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
---------------------------------------------------------------------
@@ -550,12 +552,49 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId)
local MAX_MILL_VOL = ( 80 * 240 * 20) / 2
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- una faccia
if Proc.Fct == 1 then
-- se lunghezza richiede spezzatura
if Proc.Box:getDimX() > min( BD.LONGCUT_MAXLEN, 0.5 * b3Raw:getDimX()) then
-- se lunghezza richiede spezzatura
if Proc.Box:getDimX() > min( BD.LONGCUT_MAXLEN, 0.5 * b3Raw:getDimX()) then
-- una faccia
if Proc.Fct == 1 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
-- due facce
elseif Proc.Fct == 2 then
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- tre facce
elseif Proc.Fct == 3 then
-- determino se L con una faccia terminale o U con tre facce
local bIsL = true
for i = 1, 3 do
local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, i - 1)[1]
-- le conto
local nCount = 0
for j = 1, #vFacAdj do
if vFacAdj[j] >= 0 then
nCount = nCount + 1
end
end
if nCount == 1 then
bIsL = false
break
end
end
-- se una faccia terminale e due lunghe
if bIsL then
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- altrimenti U lunga
else
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
end
-- più facce
else
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
end
-- altrimenti lavorazione unica
else
-- una faccia
if Proc.Fct == 1 then
-- se piccola, con fresa
if ( Proc.Box:getDimX() < MAX_MILL_XZ and Proc.Box:getDimZ() < MAX_MILL_XZ) or Proc.Box:getDimX() * Proc.Box:getDimY() * Proc.Box:getDimZ() < MAX_MILL_VOL then
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
@@ -563,13 +602,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId)
else
return Cut.Make( Proc, nPhase, nRawId, nPartId, 0)
end
end
-- due facce
elseif Proc.Fct == 2 then
-- se lunghezza richiede spezzatura
if Proc.Box:getDimX() > min( BD.LONGCUT_MAXLEN, 0.5 * b3Raw:getDimX()) then
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
else
-- due facce
elseif Proc.Fct == 2 then
-- determino l'angolo tra le facce
local _, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
-- se ortogonali e piccole, con fresa
@@ -580,10 +614,10 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId)
else
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, 'HeadSide')
end
-- tre o più facce
else
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
end
-- tre o più facce
else
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
end
end