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
+1 -1
View File
@@ -13,7 +13,7 @@ EgtEnableDebug( false)
-- Per test
--BEAM = {}
--BEAM.FILE = 'c:\\EgtData\\Varie\\TestEssetreFast\\Xxx\\2-Banchina smussata.nge'
--BEAM.FILE = 'c:\\EgtData\\Varie\\TestEssetreFast\\TestFabio\\BTL_TS37\\Bar_25_2.btl'
--BEAM.MACHINE = 'FAST'
--BEAM.FLAG = 3
+2 -2
View File
@@ -486,13 +486,13 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
bOk, bDown = Drill.Classify( Proc, b3Raw)
-- se tenone
elseif Tenon.Identify( Proc) then
bOk, bDown = Tenon.Classify( Proc)
bOk, bDown = Tenon.Classify( Proc, b3Raw)
-- se mortasa (anche frontale)
elseif Mortise.Identify( Proc) then
bOk, bDown = Mortise.Classify( Proc)
-- se tenone a coda di rondine
elseif DtTenon.Identify( Proc) then
bOk, bDown = DtTenon.Classify( Proc)
bOk, bDown = DtTenon.Classify( Proc, b3Raw)
-- se mortasa a coda di rondine (anche frontale)
elseif DtMortise.Identify( Proc) then
bOk, bDown = DtMortise.Classify( Proc)
+1 -1
View File
@@ -638,7 +638,7 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dV
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BeamLib.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
if dLen < 1.1 or dWidth < 1.1 then
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
return true, ''
+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 a coda di rondine 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 ProcessDtTenon.Identify( Proc)
@@ -23,14 +51,14 @@ end
---------------------------------------------------------------------
-- Classificazione della feature
function ProcessDtTenon.Classify( Proc)
function ProcessDtTenon.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
@@ -59,8 +87,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local dDepth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
-- 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 verso il basso
if not VerifyOrientation( Proc, vtExtr, b3Raw) then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' DtTenon from bottom impossible'
EgtOutLog( sErr)
return false, sErr
+58 -33
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/09/25
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/09/27
-- Gestione calcolo mezzo-legno per Travi
-- Tabella per definizione modulo
@@ -144,6 +144,31 @@ function ProcessLapJoint.Classify( Proc)
end
end
---------------------------------------------------------------------
local function TestElleShape( Proc)
-- valida solo nel caso di tre facce
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
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
return bIsL
end
---------------------------------------------------------------------
-- Lavorazione con fresa
---------------------------------------------------------------------
@@ -227,14 +252,19 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
local nFacInd
-- se entrambe possibili
if bFaceOk[1] and bFaceOk[2] then
-- se in testa o coda, scelgo quella con la normale più parallela all'asse trave
if Proc.Head or Proc.Tail then
if vtN[1]:getZ() < BD.NZ_MINA then
nFacInd = 1
elseif vtN[2]:getZ() < BD.NZ_MINA then
-- se in testa, scelgo quella orientata verso la testa
if Proc.Head then
if vtN[1]:getX() > vtN[2]:getX() then
nFacInd = 0
else
nFacInd = EgtIf( abs( vtN[1]:getX()) > abs( vtN[2]:getX()), 0, 1)
nFacInd = 1
end
-- se altrimenti in coda, scelgo quella orientata verso la coda
elseif Proc.Tail then
if vtN[1]:getX() < vtN[2]:getX() then
nFacInd = 0
else
nFacInd = 1
end
-- altrimenti, scelgo quella con la normale più perpendicolare all'asse trave (se uguali, quella verso X+)
else
@@ -512,8 +542,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
return false, sErr
end
end
-- recupero la lavorazione
local dDiam = min( dH, dV) * EgtIf( Proc.Fct > 3, 1, 1.4)
-- verifico se tre facce a L con una faccia di terminazione
local bIsL = TestElleShape( Proc)
-- recupero la lavorazione ( se L posso accettare utensili un poco più grandi)
local dDiam = min( dH, dV) * EgtIf( bIsL, 1.4, 1)
EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam))
local sPocketing = ML.FindPocketing( 'Mortise', dDiam)
-- se non trova una svuotatura adatta, provo con la sega a catena o lama
@@ -628,34 +660,27 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- due facce
elseif Proc.Fct == 2 then
-- determino se due facce lunghe oppure una lunga e l'altra terminale
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
local CopyId = EgtCopyGlob( Proc.Id, Proc.Id, GDB_IN.AFTER)
local NewId, nCount = EgtExplodeSurf( CopyId)
local b3Fac1 = EgtGetBBoxGlob( NewId, GDB_BB.STANDARD)
local b3Fac2 = EgtGetBBoxGlob( NewId + 1, GDB_BB.STANDARD)
if abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 10 then
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- altrimenti U lunga
elseif b3Fac1:getDimX() < 1 then
-- la faccia 0 deve essere quella lunga
local nNew2Id = EgtSurfTmBySewing( EgtGetParent( Proc.Id), { NewId+1, NewId})
EgtCopyAttributes( Proc.Id, nNew2Id)
EgtErase( Proc.Id)
EgtChangeId( nNew2Id, Proc.Id)
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
elseif b3Fac2:getDimX() < 1 then
EgtErase( {NewId, NewId+1})
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
else
EgtErase( {NewId, NewId+1})
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
end
-- più facce
-- tre o più facce
else
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
end
+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