DataBeam :

- migliorato calcolo ingombri di testa delle feature per posizionamento pinze
- feature Chamfer divisa in parti se lunga.
This commit is contained in:
Dario Sassi
2020-02-12 19:49:48 +00:00
parent dbb43355c3
commit 3f19150681
5 changed files with 157 additions and 41 deletions
+55 -1
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/02/10
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/02/12
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
@@ -139,6 +139,13 @@ end
---------------------------------------------------------------------
-- Verifica se feature di testa
function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
-- se una sola faccia
if Proc.Fct == 1 then
local _, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
if vtN0:getX() > 0 then
return true
end
end
-- verifico se è in testa
if Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dCurrOvmH - BD.MAX_DIST_HTFEA then
return false
@@ -175,6 +182,13 @@ end
---------------------------------------------------------------------
-- Verifica se feature di coda
function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
-- se una sola faccia
if Proc.Fct == 1 then
local _, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
if vtN0:getX() < 0 then
return true
end
end
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, bHead = VerifyIfByBHSideMill( Proc)
if bUseBHSideMill then
@@ -273,6 +287,13 @@ end
local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- recupero l'ingombro della trave
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
if not b3Solid then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found'
EgtOutLog( sErr)
return false, sErr
end
-- verifico il numero di facce della tacca
assert( ( Proc.Fct == 1), 'Error : MakeOneFaceByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
-- dati della faccia
@@ -321,6 +342,17 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
-- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
BL.UpdateTCING( nRawId, dOffs)
end
end
return true
end
@@ -328,6 +360,13 @@ end
local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- recupero l'ingombro della trave
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
if not b3Solid then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found'
EgtOutLog( sErr)
return false, sErr
end
-- verifico il numero di facce della tacca
assert( ( Proc.Fct == 2), 'Error : MakeTwoFacesByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
-- dati delle facce
@@ -418,6 +457,21 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
-- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
BL.UpdateTCING( nRawId, dOffs)
elseif Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
local dDist = b3Solid:getMax():getX() - Proc.Box:getMax():getX()
BL.UpdateHCING( nRawId, dOffs, dDist)
end
end
return true
end