DataBeam :

- aggiunta gestione feature SawCut (0/3/4-013-X)
- elevazione del tenone diminuita di 0.1 per evitare poi problemi con arrotondamenti.
This commit is contained in:
Dario Sassi
2020-01-29 16:32:16 +00:00
parent 20b05935fb
commit c0bb72e816
10 changed files with 119 additions and 10 deletions
+9
View File
@@ -41,6 +41,8 @@ _G.package.loaded.ProcessLongCut = nil
local LongCut = require( 'ProcessLongCut')
_G.package.loaded.ProcessLongDoubleCut = nil
local Long2Cut = require( 'ProcessLongDoubleCut')
_G.package.loaded.ProcessSawCut = nil
local SawCut = require( 'ProcessSawCut')
_G.package.loaded.ProcessRidgeLap = nil
local RidgeLap = require( 'ProcessRidgeLap')
_G.package.loaded.ProcessLapJoint = nil
@@ -502,6 +504,9 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
-- se doppio taglio longitudinale
elseif Long2Cut.Identify( Proc) then
bOk, bDown = Long2Cut.Classify( Proc)
-- se taglio con lama
elseif SawCut.Identify( Proc) then
bOk, bDown = SawCut.Classify( Proc)
-- se mezzo-legno di testa
elseif RidgeLap.Identify( Proc) then
bOk, bDown = RidgeLap.Classify( Proc)
@@ -642,6 +647,10 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3
else
bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId)
end
-- se taglio con lama ( 0/3/4-013-X)
elseif SawCut.Identify( Proc) then
-- esecuzione taglio
bOk, sErr = SawCut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se mezzo-legno di testa ( 1/2-030-X)
elseif RidgeLap.Identify( Proc) then
-- esecuzione mezzo-legno di testa
+1 -1
View File
@@ -49,7 +49,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
-- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
+1 -1
View File
@@ -86,7 +86,7 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
+2 -2
View File
@@ -123,7 +123,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
@@ -268,7 +268,7 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
+1 -1
View File
@@ -64,7 +64,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId)
if AuxId then
AuxId = AuxId + Proc.Id
end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
+1 -1
View File
@@ -93,7 +93,7 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
+100
View File
@@ -0,0 +1,100 @@
-- ProcessSawCut.lua by Egaltech s.r.l. 2020/01/29
-- Gestione calcolo taglio di lama per Travi
-- Tabella per definizione modulo
local ProcessSawCut = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local DC = require( 'DiceCut')
EgtOutLog( ' ProcessSawCut started', 1)
-- Dati
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessSawCut.Identify( Proc)
return ( ( Proc.Grp == 0 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 13)
end
---------------------------------------------------------------------
-- Classificazione della feature
function ProcessSawCut.Classify( Proc, b3Raw)
-- recupero i dati del versore direzione di accesso della lavorazione
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if not AuxId then return false end
AuxId = AuxId + Proc.Id
local vtDir = EgtSV( AuxId, GDB_ID.ROOT)
return true, ( vtDir:getZ() <= - 0.088)
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessSawCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
local b3Solid = EgtGetBBoxGlob( Ls 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
-- dati geometrici del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- recupero e verifico l'entità vettore
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.GEO_VECTOR then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing access direction'
EgtOutLog( sErr)
return false, sErr
end
local vtDir = EgtSV( AuxId, GDB_ID.ROOT)
-- se taglio di testa
if Proc.Head then
-- se coincide con il taglio di separazione precedente, non va fatto
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
return true
end
-- altrimenti taglio di coda
else
-- se coincide con taglio di separazione, non va fatto
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < BD.OVM_MID + 10 * GEO.EPS_SMALL then
return true
end
end
-- recupero la lavorazione
local sCutting = ML.FindCutting( EgtIf( Proc.Head, 'HeadSide', 'TailSide'))
if not sCutting then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dSawDiam = 400
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- lavoro la faccia
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, vtDir, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
return true
end
---------------------------------------------------------------------
return ProcessSawCut
+1 -1
View File
@@ -192,7 +192,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero e verifico l'entità curva associata
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
+2 -2
View File
@@ -87,7 +87,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
@@ -209,7 +209,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sistemo i parametri
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dTenH, 1) .. ';')
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1) .. ';')
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
local dOffset = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffset)
+1 -1
View File
@@ -105,7 +105,7 @@ local dStep = 1.23 * min( max( b3Solid:getDimY(), b3Solid:getDimZ()), 2 * min( b
local ProcLy = EgtGetFirstNameInGroup( PartId, 'Processings')
local ProcId = EgtGetFirstInGroup( ProcLy)
while ProcId do
if EgtGetInfo( ProcId, 'DO', 'i') ~= 0 and EgtGetType( ProcId) == GDB_TY.SRF_MESH then
if EgtGetInfo( ProcId, 'DO', 'i') ~= 0 and EgtGetInfo( ProcId, 'TRIM', 'i') ~= 0 and EgtGetType( ProcId) == GDB_TY.SRF_MESH then
local NewSurfId = RegularizeTriMesh( ProcId, SolidLy, dStep)
EgtSurfTmIntersect( SolidId, NewSurfId)
if NewSurfId ~= ProcId then