DataBeam :

- migliorie e correzioni varie
- unificati BirdsMouth con LapJoint.
This commit is contained in:
Dario Sassi
2019-07-03 10:27:55 +00:00
parent 9ac596d5d7
commit 7c1a4ba546
20 changed files with 473 additions and 511 deletions
+28 -3
View File
@@ -6,6 +6,7 @@ local ProcessMortise = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
EgtOutLog( ' ProcessMortise started', 1)
@@ -58,9 +59,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId)
EgtCloseCurveCompo( AuxId)
end
end
-- recupero i dati della curva e del top
local dDepth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- recupero i dati del bottom
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
EgtOutLog( 'ptC=' .. tostring( ptC) ..' vtN=' .. tostring( vtN), 3)
-- verifico che la mortasa non sia orientata verso il basso (-5 deg)
@@ -69,6 +68,13 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- determino altezza della mortasa
local frMor = Frame3d( ptC, vtN)
local b3Mor = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frMor)
local dMorH = b3Mor:getDimZ()
-- elevazione del punto centro
local _, dCenElev = BL.GetPointDirDepth( nRawId, ptC, vtN)
dMorH = max( dMorH, dCenElev or 0)
-- recupero la lavorazione
local sPocketing = ML.FindPocketing( 'Mortise')
if not sPocketing then
@@ -76,6 +82,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dMillDiam = 20
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sPocketing) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMaxDepth = ( EgtTdbGetCurrToolMaxDepth() or dMaxDepth) - BD.COLL_SIC
end
end
-- inserisco la lavorazione di svuotatura
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing)
@@ -92,6 +108,15 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId)
else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
end
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
if dMorH > dMaxDepth + 10 * GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dMorH)
dMorH = dMaxDepth
local sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
-- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMorH, 1) .. ';')
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()