- in Process require di BeamExec spostato dopo la dichiarazione delle variabili globali

- in BeamExec -> CollectFeatures si salva l'indice della Proc nel vProc
- in FeatureLib aggiunta funzione GetFeatureMaxNotClampableLengths
- correzioni e migliorie GetFeatureMaxNotClampableLengths
This commit is contained in:
luca.mazzoleni
2025-01-14 15:17:18 +01:00
parent cc8410b0c5
commit d76ecbc9f6
6 changed files with 70 additions and 49 deletions
+24 -5
View File
@@ -430,7 +430,7 @@ function FeatureLib.GetFeatureVolume( Proc, Part)
end
-------------------------------------------------------------------------------------------------------------
-- TODO bisogna calcolarla per tutte le rotazioni; funzione copiata direttamente da automatismo vecchio, da migliorare / completare
-- TODO funzione copiata direttamente da automatismo vecchio, da migliorare / completare
function FeatureLib.CalculateFeatureNotClampableLengths( Proc, Part)
local NotClampableLength = {}
@@ -492,13 +492,32 @@ function FeatureLib.CalculateFeatureNotClampableLengths( Proc, Part)
end
end
NotClampableLength.Rot0 = { Head = dNotClampableLengthHead, Tail = dNotClampableLengthTail}
NotClampableLength.Rot90 = { Head = dNotClampableLengthHead, Tail = dNotClampableLengthTail}
NotClampableLength.Rot180 = { Head = dNotClampableLengthHead, Tail = dNotClampableLengthTail}
NotClampableLength.Rot270 = { Head = dNotClampableLengthHead, Tail = dNotClampableLengthTail}
NotClampableLength.dNotClampableLengthHead = dNotClampableLengthHead
NotClampableLength.dNotClampableLengthTail = dNotClampableLengthTail
return NotClampableLength
end
-------------------------------------------------------------------------------------------------------------
function FeatureLib.GetFeatureMaxNotClampableLengths( Proc, Part)
local nPartIndex = Part.nIndexInParts
local nProcIndex = Proc.nIndexInVProc
local Rotations = PROCESSINGS[nPartIndex].Rotation
local dMaxOnHead = 0
local dMaxOnTail = 0
for i = 1, #Part.CombinationList do
for j = 1, 4 do
-- controllo che la rotazione sia attiva
if string.sub( Part.CombinationList[i].sBitIndexCombination, j, j) == '1' then
dMaxOnHead = max( Rotations[j][nProcIndex].NotClampableLength.dNotClampableLengthHead, dMaxOnHead)
dMaxOnTail = max( Rotations[j][nProcIndex].NotClampableLength.dNotClampableLengthTail, dMaxOnTail)
end
end
end
return dMaxOnHead, dMaxOnTail
end
-------------------------------------------------------------------------------------------------------------
return FeatureLib