DataBeam :
- correzioni varie - gestione scassi a C passanti e grandi con fresature sui due lati - miglioria a contorni liberi chiusi per posizione di attacco - correzioni a feature 3/4-020-X caso particolare Olaf.
This commit is contained in:
@@ -35,6 +35,92 @@ function ProcessSimpleScarf.Classify( Proc)
|
||||
return true, false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione smussi
|
||||
local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- verifico che lo smusso sia richiesto
|
||||
local dDepth = EgtGetInfo( Proc.Id, 'Q01', 'd') or 0
|
||||
if dDepth < 0.1 then return true end
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- 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) & GDB_FY.GEO_CURVE) == 0 then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dWidth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- eseguo lo smusso solo se direzione orizzontale
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped not horizontale chamfer'
|
||||
EgtOutLog( sWarn)
|
||||
return true
|
||||
end
|
||||
-- eseguo lo smusso solo se feature larga come la trave
|
||||
if dWidth < b3Raw:getDimY() - 1 then
|
||||
local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped chamfer (feature smaller than beam)'
|
||||
EgtOutLog( sWarn)
|
||||
return true
|
||||
end
|
||||
local dExtra = 2
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Mark')
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||
if not nMch1Id then
|
||||
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtAddMachining( sName2, sMilling)
|
||||
if not nMch2Id then
|
||||
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- inverto direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -128,6 +214,9 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then return bOk, sNameOrErr end
|
||||
end
|
||||
end
|
||||
-- inserimento smussi
|
||||
-- local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- if not bOkc then return bOkc, sErrC end
|
||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||
local vCuts = {}
|
||||
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
||||
|
||||
Reference in New Issue
Block a user