200 lines
10 KiB
Lua
200 lines
10 KiB
Lua
-- BeamData.lua by Egaltech s.r.l. 2022/03/20
|
|
-- Raccolta dati generali per Travi
|
|
|
|
EgtOutLog( ' KAIROS-BeamData started', 1)
|
|
|
|
-- Tabella per definizione modulo
|
|
local BeamData = {
|
|
ROT180 = true, -- flag abilitazione rotazione 90 gradi
|
|
MIN_WIDTH = 40, -- larghezza minima del grezzo
|
|
MIN_HEIGHT = 40, -- altezza minima del grezzo
|
|
MAX_WIDTH = 250, -- larghezza massima del grezzo
|
|
MAX_HEIGHT = 620, -- altezza massima del grezzo
|
|
LEN_SHORT_PART = 1200, -- lunghezza massima pezzo corto
|
|
LEN_VERY_SHORT_PART = 400, -- lunghezza massima pezzo molto corto (molto probabile lo scarico a caduta)
|
|
MAX_RAW = 30000, -- massima lunghezza grezzo (deve essere minore di LenTable - RAW_OFFSET)
|
|
STD_RAW = 14000, -- lunghezza standard della barra di grezzo
|
|
OVM_HEAD = 10, -- sovramateriale testa
|
|
OVM_MID = 5.4, -- sovramateriale intermedio (spessore lama)
|
|
MINRAW_S = 750, -- minimo grezzo in coda scaricabile per sezioni piccole
|
|
MINRAW_L = 1070, -- minimo grezzo in coda scaricabile per sezioni grandi
|
|
MAX_LEN_SCRAP = 270, -- massima lunghezza scarto di coda
|
|
MAX_LEN_SCRAP_START = 270, -- massima lunghezza scarto di testa
|
|
MAX_DIM_HTCUT = 130, -- larghezza massima taglio di testa o coda
|
|
MAX_DIM_HTCUT_HBEAM = -195, -- larghezza massima taglio di testa o coda con trave alta
|
|
MIN_DIM_HBEAM = 621, -- altezza minima di trave alta
|
|
MAX_DIM_DICE = 110, -- dimensione trasversale massima cubetto
|
|
MAX_LEN_DICE = 400, -- lunghezza massima cubetto
|
|
DECR_VERT_CUT = 12.5, -- riduzione profondità per affondamento verticale in taglio orizzontale
|
|
COLL_SIC = 5, -- distanza di sicurezza per collisioni
|
|
CUT_SIC = 20, -- distanza di sicurezza per tagli
|
|
CUT_EXTRA = 5, -- affondamento extra standard per tagli di lama e fresature
|
|
CUT_EXTRA_MIN = 1, -- affondamento extra ridotto per tagli di lama e fresature
|
|
NZ_MINA = -0.6, -- componente limite in Z normale di una faccia (-36.8deg)
|
|
NZ_MINB = -0.4, -- componente limite in Z normale di un insieme di facce (-23deg)
|
|
DRILL_TOL = 0.5, -- tolleranza tra diametro foro e diametro punta
|
|
DRILL_VZ_MIN = -0.51, -- componente limite in Z del versore di un foro
|
|
DRILL_VX_MAX = 0.867, -- componente limite in X del versore di un foro sulle facce laterali
|
|
DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature
|
|
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
|
|
MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale
|
|
MAX_LEN_HTFEA = 2000.0, -- massima lunghezza di feature di testa o coda
|
|
LONGCUT_ENDLEN = 600, -- lunghezza lavoro estremi iniziale e finale (std=600)
|
|
LONGCUT_MAXLEN = 1200, -- lunghezza massima sezione di taglio longitudinale (std=1200)
|
|
MAX_LEN_RIDGELAP_FROM_BOTTOM = 141, -- massima lunghezza ridgelap lavorabile da sotto
|
|
MAX_LEN_RIDGELAP_FROM_BOTTOM_HBEAM = 96, -- massima lunghezza ridgelap lavorabile da sotto con trave alta
|
|
DIM_TO_CENTER_STRIP = 50, -- larghezza minima trave per inserimento codolo nel centro del trave; 0 = automatico
|
|
DIM_STRIP = -1, -- dimensione codolo sostegno parti lasciate su contorno libero o archi (-1 = da Q...)
|
|
DIM_STRIP_SMALL = 1, -- dimensione codolo piccolo (quando le parti sostenute sono sicuramente sulla parte sopra del pezzo)
|
|
RAWCOL = { 255, 160, 32, 30}, -- colore del grezzo
|
|
RAW_OFFSET = 2000, -- spostamento grezzo rimanente dopo split
|
|
VICE_MINH = 110, -- altezza minima della morsa
|
|
OFFSET_DRILL_TENON = 0, -- offset fori su tenoni verso base degli stessi (0=non fare)
|
|
USER_HOLE_DIAM = 0, -- diametro foro per L20
|
|
MAX_TOOL_LEN_FOR_HOR_MACH = 311, -- massima lunghezza utensile per poter fare forature (fresature) oltre i 10 gradi dalla verticale
|
|
DRILL_VZ_MIN_LONG_TOOL = 0.984, -- componente limite per lavorazioni con punta lunga
|
|
MAX_TOOL_LEN_BACK_HOR_MACH = 250, -- massima lunghezza utensile per poter eseguire lavorazioni (forature/svuotature) da dietro (faccia 4)
|
|
MAX_HEIGHT_ROT_B_ABOVE = 500, -- massima altezza della trave che permette di ruotare l'asse B sopra la stessa senza collisioni
|
|
KIOTP = 3, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare
|
|
MAXDIAM_POCK_CORNER = 30, -- diametro massimo utensile ammesso per tasche con angoli interni
|
|
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con probabile caduta
|
|
ADVANCE_TAIL_OFFS = 5, -- accorciamento taglio di coda avanzato (minimo 1)
|
|
STRATEGIES_CONFIG_FILE = 'Std2.json',
|
|
FASTCLAMPING = false
|
|
}
|
|
|
|
-- Aggiornamento con dati da B&W
|
|
local sData = EgtGetCurrMachineDir().."\\Beam\\EbwData.lua"
|
|
if EgtExistsFile( sData) then
|
|
local Machine = dofile( sData)
|
|
if Machine then
|
|
if Machine.Trave then
|
|
BeamData.MIN_WIDTH = Machine.Trave.YMIN or BeamData.MIN_WIDTH
|
|
BeamData.MIN_HEIGHT = Machine.Trave.ZMIN or BeamData.MIN_HEIGHT
|
|
BeamData.MAX_WIDTH = Machine.Trave.YMAX or BeamData.MAX_WIDTH
|
|
BeamData.MAX_HEIGHT = Machine.Trave.ZMAX or BeamData.MAX_HEIGHT
|
|
end
|
|
if Machine.User then
|
|
if Machine.User.OPTIMIZATIONS_ENABLE_SLICES_F5 == 1 then
|
|
BeamData.MAX_LEN_SCRAP = Machine.User.OPTIMIZATIONS_LENGTH_SLICES or BeamData.MAX_LEN_SCRAP
|
|
else
|
|
BeamData.MAX_LEN_SCRAP = 100000
|
|
end
|
|
if Machine.User.OPTIMIZATIONS_ENABLE_SLICES_F6 == 1 then
|
|
BeamData.MAX_LEN_SCRAP_START = Machine.User.OPTIMIZATIONS_LENGTH_SLICES or BeamData.MAX_LEN_SCRAP_START
|
|
else
|
|
BeamData.MAX_LEN_SCRAP_START = 100000
|
|
end
|
|
BeamData.USER_HOLE_DIAM = Machine.User.L020_DIAM_HOLE or BeamData.USER_HOLE_DIAM
|
|
BeamData.OFFSET_DRILL_TENON = Machine.User.L040_OFFSET_P1 or BeamData.OFFSET_DRILL_TENON
|
|
end
|
|
end
|
|
end
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
local function GetNzLimDownUp( b3Raw, vtN, vtOrtho, bDiceCut)
|
|
return -0.173
|
|
end
|
|
BeamData.GetNzLimDownUp = GetNzLimDownUp
|
|
|
|
---------------------------------------------------------------------
|
|
local function GetChainSawBlockedAxis( nInd)
|
|
if nInd == 1 then
|
|
return 'CS=0'
|
|
else
|
|
return 'CS=-90'
|
|
end
|
|
end
|
|
BeamData.GetChainSawBlockedAxis = GetChainSawBlockedAxis
|
|
|
|
---------------------------------------------------------------------
|
|
local function GetMaxLenRidgeLapFromBottom( dHRaw)
|
|
if dHRaw < BeamData.MIN_DIM_HBEAM then
|
|
return BeamData.MAX_LEN_RIDGELAP_FROM_BOTTOM + 0.01
|
|
else
|
|
return BeamData.MAX_LEN_RIDGELAP_FROM_BOTTOM_HBEAM + 0.01
|
|
end
|
|
end
|
|
BeamData.GetMaxLenRidgeLapFromBottom = GetMaxLenRidgeLapFromBottom
|
|
|
|
---------------------------------------------------------------------
|
|
local function GetMinNzTopHead( vtNFace, Tool)
|
|
if Tool and Tool.sFamily ~= 'SAWBLADE' then
|
|
if abs( vtNFace:getY()) < 0.68 then
|
|
return sin( -15)
|
|
else
|
|
return sin( -10)
|
|
end
|
|
else
|
|
if abs( vtNFace:getY()) < 0.68 then
|
|
return sin( -11)
|
|
else
|
|
return sin( -10)
|
|
end
|
|
end
|
|
end
|
|
|
|
---------------------------------------------------------------------
|
|
local function GetMinNzDownUp( b3Raw, vtNFace, vtToolDirection, Tool)
|
|
if vtNFace and abs( vtNFace:getY()) < 0.173
|
|
and vtToolDirection and vtToolDirection:getY() < 0.173 then
|
|
|
|
return sin ( -10.9)
|
|
else
|
|
return -1
|
|
end
|
|
end
|
|
|
|
---------------------------------------------------------------------
|
|
local function GetSetupInfo( sHead)
|
|
local SetupInfo = {}
|
|
|
|
-- dati comuni
|
|
SetupInfo.bIsCSymmetrical = false
|
|
SetupInfo.dCAxisEncumbrance = 180
|
|
SetupInfo.dCAxisSideEncumbrance = 200
|
|
SetupInfo.dPivot = 210
|
|
SetupInfo.bToolOnAggregate = false
|
|
|
|
-- testa 5 assi da sopra
|
|
if sHead == 'H1' then
|
|
SetupInfo.HeadType = { bTop = true, bBottom = false}
|
|
SetupInfo.PreferredSide = {}
|
|
SetupInfo.GetMinNz = GetMinNzTopHead
|
|
SetupInfo.GetMinNzDownUp = GetMinNzDownUp
|
|
end
|
|
|
|
return SetupInfo
|
|
end
|
|
BeamData.GetSetupInfo = GetSetupInfo
|
|
|
|
---------------------------------------------------------------------
|
|
local function GetMaxMatReductionBladeCut( sHead, vtDir)
|
|
local MaxMatReductionBladeCut = 0
|
|
-- la lama è montata solo su H2, non si controllano altre teste
|
|
if sHead == 'H2' then
|
|
if BeamData.NEWTOPC == nil or BeamData.NEWTOPC then
|
|
MaxMatReductionBladeCut = -65
|
|
end
|
|
if AreSameVectorApprox( vtDir, X_AX()) then
|
|
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
|
|
elseif AreSameVectorApprox( vtDir, -X_AX()) then
|
|
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
|
|
elseif AreSameVectorApprox( vtDir, Y_AX()) then
|
|
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
|
|
elseif AreSameVectorApprox( vtDir, -Y_AX()) then
|
|
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
|
|
elseif AreSameVectorApprox( vtDir, Z_AX()) then
|
|
MaxMatReductionBladeCut = 80
|
|
elseif AreSameVectorApprox( vtDir, -Z_AX()) then
|
|
MaxMatReductionBladeCut = 80
|
|
end
|
|
MaxMatReductionBladeCut = MaxMatReductionBladeCut + BeamData.COLL_SIC
|
|
end
|
|
return MaxMatReductionBladeCut + BeamData.COLL_SIC
|
|
end
|
|
BeamData.GetMaxMatReductionBladeCut = GetMaxMatReductionBladeCut
|
|
|
|
---------------------------------------------------------------------
|
|
return BeamData
|