DataBeam :

- correzioni varie specie a taglio con cubetti.
This commit is contained in:
Dario Sassi
2019-06-22 07:35:01 +00:00
parent 728e8f3885
commit 9ac596d5d7
11 changed files with 69 additions and 37 deletions
+30 -2
View File
@@ -13,6 +13,10 @@ EgtOutLog( ' ProcessDrill started', 1)
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
-- Costanti
local TH_RAD = 35 -- raggio portautensile
local COS_SLANT_LIM = 0.82 -- 35deg da piano
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessDrill.Identify( Proc)
@@ -91,6 +95,10 @@ function ProcessDrill.Classify( Proc, b3Raw)
vtExtr = - vtExtr
ptCen = ptCen + vtExtr * dLen
end
-- verifico se troppo inclinato e quindi non lavorabile
if not ( Proc.Fcs == 5 or Proc.Fcs == 6) and abs( vtExtr:getX()) > COS_SLANT_LIM then
return false, false
end
local bOpen = ( Proc.Fce ~= 0)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + dDiam)
-- verifico se il foro è fattibile solo da sotto
@@ -131,6 +139,24 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dMaxDepth = 20
if EgtMdbSetCurrMachining( sDrilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- se foro intermedio e inclinato, limito il massimo affondamento
if not ( Proc.Fcs == 5 or Proc.Fcs == 6) then
local CosB = abs( vtExtr:getX())
if CosB < COS_SLANT_LIM then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dMaxDepth = dMaxDepth - TH_RAD * TgA
else
dMaxDepth = 0
end
end
-- inserisco la lavorazione
local sName = 'Drill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling)
@@ -153,10 +179,12 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
nSCC = MCH_SCC.ADIR_YP
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- se foro dai due lati, aggiusto l'affondamento
-- aggiusto l'affondamento
local dDepth = min( dLen, dMaxDepth)
if Proc.Flg == 2 or Proc.Flg == -2 then
EgtSetMachiningParam( MCH_MP.DEPTH, dLen / 2 + BD.DRILL_OVERLAP)
local dDepth = min( dLen / 2 + BD.DRILL_OVERLAP, dMaxDepth)
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- dichiaro non si generano sfridi per VMill
EgtSetMachiningParam( MCH_MP.USERNOTES, 'VMRS=0;')
-- eseguo