DataBeam :
- migliorato ordinamento features - in LapJoint gestione ElleShape con 4 lati - in LongCut gestione taglio con lama.
This commit is contained in:
+46
-15
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/10/08
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/11/07
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||
|
||||
@@ -55,7 +55,7 @@ function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
||||
end
|
||||
if vtN:getX() < 0.5 then
|
||||
if vtN:getX() < 0.499 then
|
||||
return false
|
||||
elseif Proc.Fct >= 5 then
|
||||
return true
|
||||
@@ -91,7 +91,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
||||
end
|
||||
if vtN:getX() > -0.5 then
|
||||
if vtN:getX() > -0.499 then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
@@ -147,11 +147,9 @@ function ProcessLapJoint.Classify( Proc)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function TestElleShape( Proc)
|
||||
local function TestElleShape3( Proc)
|
||||
-- valida solo nel caso di tre facce
|
||||
if Proc.Fct ~= 3 then
|
||||
return false
|
||||
end
|
||||
if Proc.Fct ~= 3 then return false end
|
||||
-- determino se L con una faccia terminale o U con tre facce
|
||||
local bIsL = true
|
||||
for i = 1, 3 do
|
||||
@@ -171,6 +169,41 @@ local function TestElleShape( Proc)
|
||||
return bIsL
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function TestElleShape4( Proc)
|
||||
-- valida solo nel caso di quattro facce
|
||||
if Proc.Fct ~= 4 then return false end
|
||||
-- determino se L con due facce terminali o O
|
||||
local bIsL = false
|
||||
local dMinArea3 = GEO.INFINITO
|
||||
local dMaxArea2 = 0
|
||||
for i = 1, 4 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
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
local dArea = dH * dV
|
||||
if nCount == 2 then
|
||||
dMaxArea2 = max( dMaxArea2, dArea)
|
||||
elseif nCount == 3 then
|
||||
dMinArea3 = min( dMinArea3, dArea)
|
||||
bIsL = true
|
||||
end
|
||||
end
|
||||
if not bIsL then return false end
|
||||
-- verifico se L profona oppure lunga
|
||||
if dMinArea3 < dMaxArea2 then
|
||||
return 1
|
||||
else
|
||||
return 2
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Lavorazione con fresa
|
||||
---------------------------------------------------------------------
|
||||
@@ -344,11 +377,9 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, b3Raw)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||
local nCutFacet = EgtSurfTmFacetCount( AddId)
|
||||
if nCutFacet == 1 then
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0)
|
||||
if not bOk then return bOk, sErr end
|
||||
return Cut.Make( CutProc, nPhase, nRawId, nPartId, 0)
|
||||
elseif nCutFacet == 2 then
|
||||
local bOk, sErr = DoubleCut.Make( CutProc, nPhase, nRawId, nPartId, 0)
|
||||
if not bOk then return bOk, sErr end
|
||||
return DoubleCut.Make( CutProc, nPhase, nRawId, nPartId, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -641,7 +672,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMchFind = 'Pocket'
|
||||
if Proc.Fct <= 3 and not TestElleShape( Proc) then sMchFind = 'OpenPocket' end
|
||||
if Proc.Fct <= 3 and not TestElleShape3( Proc) then sMchFind = 'OpenPocket' end
|
||||
local dDiam = min( dH, dV)
|
||||
local dCollSic = 2 * BD.COLL_SIC
|
||||
if abs( vtN:getX()) > 0.996 or abs( vtN:getY()) > 0.996 or abs( vtN:getZ()) > 0.996 then dCollSic = BD.COLL_SIC end
|
||||
@@ -650,7 +681,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
-- se non trova una svuotatura adatta
|
||||
if not sPocketing then
|
||||
-- verifico se due o tre facce a L con una faccia di terminazione
|
||||
local bIsL = ( Proc.Fct == 2 or TestElleShape( Proc))
|
||||
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
|
||||
-- se due facce o tre a L provo con contornatura
|
||||
if bIsL then
|
||||
return MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev)
|
||||
@@ -814,9 +845,9 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- due facce
|
||||
elseif Proc.Fct == 2 then
|
||||
-- determino l'angolo tra le facce
|
||||
local _, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
-- se ortogonali e piccole, con fresa
|
||||
if abs( dAng + 90) < 1 and
|
||||
if bAdj and abs( dAng + 90) < 1 and
|
||||
( ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) or
|
||||
Proc.Box:getDimX() * Proc.Box:getDimY() * Proc.Box:getDimZ() < MAX_MILL_VOL) then
|
||||
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
|
||||
|
||||
Reference in New Issue
Block a user