DataBeam :

- correzioni e migliorie varie.
This commit is contained in:
Dario Sassi
2019-09-30 06:50:03 +00:00
parent e42f60cebe
commit 79b7d2337f
6 changed files with 130 additions and 49 deletions
+34 -6
View File
@@ -1,4 +1,4 @@
-- ProcessTenon.lua by Egaltech s.r.l. 2019/09/25
-- ProcessTenon.lua by Egaltech s.r.l. 2019/09/27
-- Gestione calcolo tenone per Travi
-- Tabella per definizione modulo
@@ -15,6 +15,34 @@ EgtOutLog( ' ProcessTenon started', 1)
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
---------------------------------------------------------------------
local function VerifyOrientation( Proc, vtN, b3Raw)
-- se trave bassa
if b3Raw:getDimZ() <= 200 then
-- se tenone praticamente in asse, accetto fino a -30 deg
if abs( vtN:getY()) < 0.04 then
return ( vtN:getZ() >= -0.5)
-- altrimenti accetto fino a -20deg
else
return ( vtN:getZ() >= -0.343)
end
-- se trave media
elseif b3Raw:getDimZ() <= 300 then
-- se tenone praticamente in asse, accetto fino a -20 deg
if abs( vtN:getY()) < 0.04 then
return ( vtN:getZ() >= -0.343)
-- altrimenti, accetto fino a -10 deg
else
return ( vtN:getZ() >= -0.174)
end
-- altrimenti
else
-- accetto fino a -5deg
return ( vtN:getZ() >= -0.088)
end
end
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessTenon.Identify( Proc)
@@ -24,14 +52,14 @@ end
---------------------------------------------------------------------
-- Classificazione della feature
function ProcessTenon.Classify( Proc)
function ProcessTenon.Classify( Proc, b3Raw)
-- recupero i dati della curva di contorno della faccia top
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if not AuxId then return false end
AuxId = AuxId + Proc.Id
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- verifico se il tenone è lavorabile solo da sotto (-20 deg)
local bDown = ( vtExtr:getZ() < - 0.35)
-- verifico se il tenone è lavorabile solo da sotto
local bDown = not VerifyOrientation( Proc, vtExtr, b3Raw)
return true, bDown
end
@@ -60,8 +88,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
local bClosed = EgtCurveIsClosed( AuxId)
-- verifico che il tenone non sia orientato verso il basso (-20 deg)
if vtExtr:getZ() < - 0.35 then
-- verifico che il tenone non sia orientato troppo verso il basso
if not VerifyOrientation( Proc, vtExtr, b3Raw) then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Tenon from bottom impossible'
EgtOutLog( sErr)
return false, sErr