Compare commits

..

8 Commits

Author SHA1 Message Date
luca.mazzoleni 52aaea30ac - in BeamDataNew rimossi parametri mlde non necessari; aggiunte funzioni per calcolo RestrictedLength (al momento è MinJoin + extra) e grezzo minimo scaricabile 2026-07-29 14:56:01 +02:00
luca.mazzoleni 6922eac78e - corretto Compile 2026-07-17 17:24:52 +02:00
luca.mazzoleni 4c80f37797 - in BeamDataNew ripristinari valori corretti GetBlockedAxis 2026-06-19 15:37:50 +02:00
luca.mazzoleni 5da4ccece9 Merge branch 'master' into develop 2026-06-11 18:30:18 +02:00
luca.mazzoleni 171187c172 Merge branch 'master' of https://gitlab.steamware.net/egalware-machines/essetre/Essetre-FAST 2026-06-11 18:30:12 +02:00
luca.mazzoleni 3413e43f62 - update BeamDataNew 2026-06-11 18:29:32 +02:00
daniele.nicoli d8cd917aaf Merge remote-tracking branch 'origin/master' into develop 2026-04-24 11:30:18 +02:00
daniele.nicoli 507e75121f Merge branch 'master' into develop 2026-04-22 13:08:39 +02:00
2 changed files with 101 additions and 115 deletions
+96 -110
View File
@@ -46,16 +46,12 @@ local BeamData = {
-- costanti riportate da mlde non necessarie per automatismo (sostituire con GetParameters o simile)
local MldeParameters = {}
MldeParameters.NumericalControl = 'TPA' -- NUM o TPA o NUM_PLUS
MldeParameters.MinX = 0
MldeParameters.MaxX = 1350
MldeParameters.MinZ = -1350
MldeParameters.MaxZ = 0
MldeParameters.MillOffs = 177.35
MldeParameters.SawOffs = -242.68
MldeParameters.DeltaTabY = 898.0
MldeParameters.DeltaTabZ = -1017.8 + MldeParameters.MillOffs -- per TPA : -1013.3 + MillOffs -- per NUM : -838.4
MldeParameters.NewTopC = true
MldeParameters.MinJoinVV = 75
MldeParameters.MinJoinSS = 100
MldeParameters.MinJoinLS = 290
MldeParameters.MinJoinSL = 100
MldeParameters.MinJoinLL = 400
-- Aggiornamento con dati macchina personalizzati
-- TODO sostituire con GetParameters o simile
@@ -71,22 +67,6 @@ if EgtExistsFile( sData) then
local Machine = dofile( sData)
if Machine then
if Machine.Offsets then
if Machine.Offsets.TIPO_CN == 0 then
MldeParameters.NumericalControl = 'NUM'
elseif Machine.Offsets.TIPO_CN == 2 then
MldeParameters.NumericalControl = 'NUM_PLUS'
else
MldeParameters.NumericalControl = 'TPA'
end
if Machine.Offsets.MAX_X then MldeParameters.MinX = - Machine.Offsets.MAX_X end
if Machine.Offsets.MIN_X then MldeParameters.MaxX = - Machine.Offsets.MIN_X end
if Machine.Offsets.MIN_Z then MldeParameters.MinZ = Machine.Offsets.MIN_Z end
if Machine.Offsets.MAX_Z then MldeParameters.MaxZ = Machine.Offsets.MAX_Z end
if Machine.Offsets.PIVOTFRESA then MldeParameters.MillOffs = - Machine.Offsets.PIVOTFRESA end
if Machine.Offsets.PIVOTLAMA then MldeParameters.SawOffs = - Machine.Offsets.PIVOTLAMA end
if Machine.Offsets.OFFSETX then MldeParameters.DeltaTabY = - Machine.Offsets.OFFSETX end
if Machine.Offsets.OFFSETZ then MldeParameters.DeltaTabZ = Machine.Offsets.OFFSETZ + EgtIf( MldeParameters.NumericalControl == 'TPA', MldeParameters.MillOffs, 0) end
if Machine.Offsets.NEWTOPC then MldeParameters.NewTopC = ( Machine.Offsets.NEWTOPC == 1) end
BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S)
BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L)
BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA
@@ -98,9 +78,15 @@ if EgtExistsFile( sData) then
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
BeamData.MAX_HEIGHT2 = Machine.Offsets.MAX_HEIGHT2 or BeamData.MAX_HEIGHT2
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
if Machine.Offsets.PIVOTFRESA then MldeParameters.MillOffs = - Machine.Offsets.PIVOTFRESA end
if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end
if Machine.Offsets.ROT180 ~= nil then BeamData.ROT180 = ( Machine.Offsets.ROT180 == 1) end
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.MIN_JOIN_VV then MldeParameters.MinJoinVV = EgtClamp( Machine.Offsets.MIN_JOIN_VV, 60, 150) end
if Machine.Offsets.MIN_JOIN_SS then MldeParameters.MinJoinSS = EgtClamp( Machine.Offsets.MIN_JOIN_SS, 80, 275) end
if Machine.Offsets.MIN_JOIN_LS then MldeParameters.MinJoinLS = EgtClamp( Machine.Offsets.MIN_JOIN_LS, 250, 400) end
if Machine.Offsets.MIN_JOIN_SL then MldeParameters.MinJoinSL = EgtClamp( Machine.Offsets.MIN_JOIN_SL, 80, 400) end
if Machine.Offsets.MIN_JOIN_LL then MldeParameters.MinJoinLL = EgtClamp( Machine.Offsets.MIN_JOIN_LL, 300, 600) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
@@ -114,6 +100,90 @@ if EgtExistsFile( sData) then
end
end
---------------------------------------------------------------------
local function GetSectionCoeff( dW, dH, dL)
local SEZ_L = 80000
local SEZ_S = 20000
local LEN_SMALL = 2000
local dSez = dW * dH
if dSez <= SEZ_S then
return 0.0
elseif dSez < SEZ_L then
if dL and dL < LEN_SMALL then dSez = max( 0.6 * dSez, SEZ_S) end
local dCoeff = ( dSez - SEZ_S) / ( SEZ_L - SEZ_S)
return dCoeff
else
return 1.0
end
end
---------------------------------------------------------------------
-- TODO questa è copiata (e migliorata) da mlde, va unificata
-- TODO vedere se servono anche dDeltaTol e dMinOther
local function GetMinJoin( dW, dH, dL)
-- funzione di supporto per interpolazione lineare
local function MapRange( x, x1, x2, y1, y2)
if x <= x1 then return y1 end
if x >= x2 then return y2 end
return y1 + ( y2 - y1) * ( ( x - x1) / ( x2 - x1))
end
-- costanti geometriche e tolleranze
local L_SMALL = 800
local H_V, H_S, H_L = 90, 200, 400
local W_V, W_S, W_L = 90, 150, 250
local DELTA_TOL_S = 210
local DELTA_TOL_V = 110
local DELTA_TOL_L = 410
local dMinJoin, dDeltaTol
if dW <= W_V and dH <= H_V then
dMinJoin = MldeParameters.MinJoinVV
dDeltaTol = DELTA_TOL_V
elseif dL <= L_SMALL then
dMinJoin = MldeParameters.MinJoinSS
dDeltaTol = DELTA_TOL_S
else
-- 1. Interpolazione sulla larghezza partendo da valori macchina
local dMinJoinS = MapRange( dW, W_S, W_L, MldeParameters.MinJoinSS, MldeParameters.MinJoinSL)
local dMinJoinL = MapRange( dW, W_S, W_L, MldeParameters.MinJoinLS, MldeParameters.MinJoinLL)
-- 2. Interpolazione sull'altezza partendo dai valori interpolati sulla larghezza
dMinJoin = MapRange( dH, H_S, H_L, dMinJoinS, dMinJoinL)
dDeltaTol = MapRange( dH, H_S, H_L, DELTA_TOL_S, DELTA_TOL_L)
if dW < W_V then
dDeltaTol = DELTA_TOL_V
end
end
--local dMinOther = abs( MldeParameters.MinY) + abs( MldeParameters.MaxV) + dMinJoin
return dMinJoin
end
BeamData.GetMinJoin = GetMinJoin
---------------------------------------------------------------------
local function GetRestrictedLength( dW, dH, dL)
local dMinJoin = GetMinJoin( dW, dH, dL)
local dExtra = 50
local dRestrictedLength = dMinJoin + dExtra
return dRestrictedLength
end
BeamData.GetRestrictedLength = GetRestrictedLength
---------------------------------------------------------------------
local function GetMinUnloadableRaw( dW, dH)
local dCoeff = GetSectionCoeff( dW, dH)
return ( 1 - dCoeff) * BeamData.MINRAW_S + dCoeff * BeamData.MINRAW_L
end
BeamData.GetMinUnloadableRaw = GetMinUnloadableRaw
---------------------------------------------------------------------
local function GetBlockedAxis( sHead, nToolType, sBlockedAxis)
-- lama
@@ -175,87 +245,6 @@ local function GetSCC( vtToolDirection, vtEdgeDirection, vtNFace)
return nSCC
end
---------------------------------------------------------------------
-- sAxis può essere AB, C, Z; restituisce direzioni, profondità di estrusione e punti per il controllo precollisione
local function GetPreCollisionData( sAxis, vtC, vtHead)
local PreCollisionData = {}
-- Pivot uguale per tutti; non c'è aggregato quindi non dipende da SCC
-- riferimento vtPivot
-- - vtHead (Z): asse rotazione utensile, guarda il mandrino
-- - vtToolSCC (X): direzione asse C o aggregato
-- - vtEdge (Y): direzione lato, verso in base a X e Z
-- - punto di applicazione: naso mandrino o aggregato
PreCollisionData.vtMovePivot = Vector3d( 0, 0, -MldeParameters.SawOffs)
-- carro Z
if sAxis == 'Z' then
PreCollisionData.Directions = { vtDirectionX = X_AX(), vtDirectionY = Z_AX(), vtDirectionZ = -Y_AX()}
PreCollisionData.bSurfTmByRevolve = true
PreCollisionData.Points = {
Point3d( 0, 523, 0),
Point3d( 109.556, 523, 0),
Point3d( 109.556, 583, 0),
Point3d( 143.113, 583, 0),
Point3d( 143.113, 2533, 0),
Point3d( 0, 2533, 0)
}
-- motore (asse A o B)
elseif sAxis == 'AB' then
PreCollisionData.Directions = { vtDirectionX = vtC, vtDirectionY = -vtHead, vtDirectionZ = vtC ^ -vtHead}
PreCollisionData.dExtrusionDepth = 180
PreCollisionData.Points = {
Point3d( 100,-122,0),
Point3d( 100, -232.5, 0),
Point3d( -90, -232.5, 0),
Point3d( -90, 204.505, 0),
Point3d( -77.5, 216.55, 0),
Point3d( -89, 234.05, 0),
Point3d( -89, 242.55, 0),
Point3d( 89, 242.55, 0),
Point3d( 89, 234.05, 0),
Point3d( 77.5, 216.55, 0),
Point3d( 90, 204.505, 0),
Point3d( 90, 93, 0),
Point3d( 125, 93, 0),
Point3d( 125, -122, 0),
Point3d( 100, -122, 0)
}
-- asse C
elseif sAxis == 'C' then
PreCollisionData.Directions = { vtDirectionX = vtC, vtDirectionY = Z_AX(), vtDirectionZ = vtC ^ Z_AX()}
PreCollisionData.dExtrusionDepth = 200
PreCollisionData.Points = {
Point3d( 125, -92.752, 0),
Point3d( 203.5, -92.752, 0),
Point3d( 203.5, -100, 0),
Point3d( 400, -100, 0),
Point3d( 450, -50, 0),
Point3d( 450, 400, 0),
Point3d( 360, 490, 0),
Point3d( 170, 490, 0),
Point3d( 170, 523, 0),
Point3d( EgtIf( MldeParameters.NewTopC, -110, -175), 523, 0),
Point3d( EgtIf( MldeParameters.NewTopC, -110, -175), 400, 0),
Point3d( 230.858, 400, 0),
Point3d( 325, 305.858, 0),
Point3d( 325, 146, 0),
Point3d( 203.5, 146, 0),
Point3d( 203.5, 93, 0),
Point3d( 125, 93, 0),
Point3d( 125, -92.752, 0)
}
end
return PreCollisionData
end
---------------------------------------------------------------------
local function GetSetupInfo( sHead)
local SetupInfo = {}
@@ -265,21 +254,18 @@ local function GetSetupInfo( sHead)
SetupInfo.dCAxisEncumbrance = 180
SetupInfo.dCAxisSideEncumbrance = 200
SetupInfo.bToolOnAggregate = false
SetupInfo.vtRotationAxisC = EgtGetAxisDir( 'C')
SetupInfo.vtRotationAxisAB = EgtGetAxisDir( 'B')
-- testa 5 assi da sopra
if sHead == 'H1' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = {}
SetupInfo.dPivot = MldeParameters.MillOffs -- per uscita fresa, diverso da uscita lama
SetupInfo.GetMinNz = function() return sin( -45) end
SetupInfo.GetMinNz = function() return sin( -25) end
-- lama su testa 5 assi da sopra
elseif sHead == 'H2' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = {}
SetupInfo.GetMinNz = function() return sin( -45) end
SetupInfo.GetPreCollisionData = GetPreCollisionData
SetupInfo.GetSCC = GetSCC
-- motosega
elseif sHead == 'H3' then
+5 -5
View File
@@ -25,11 +25,11 @@ REM copio i sorgenti nel percorso temporaneo per i compilati
ROBOCOPY . %fullPathSource%\bin\%machineName%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
REM copio i file compilati nel percorso temporaneo per i compilati
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.mlpe -s Common-FAST.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.mlse -s Common-FAST.mlse
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.NUM.mlpe -s Common-FAST.NUM.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.NUM_PLUS.mlpe -s Common-FAST.NUM_PLUS.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.TPA.mlpe -s Common-FAST.TPA.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_FAST.mlpe -s Common_FAST.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_FAST.mlse -s Common_FAST.mlse
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_FAST.NUM.mlpe -s Common_FAST.NUM.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_FAST.NUM_PLUS.mlpe -s Common_FAST.NUM_PLUS.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_FAST.TPA.mlpe -s Common_FAST.TPA.mlpe
REM comprimo i file compilati in uno zip pronto per essere distribuito
tar.exe acvf %fullPathZip%\%machineName%.zip -C %fullPathSource%\bin\ %machineName%\*.*