- Aggiunta tolleranza nella scelta della migliore combinazione di lavorazione. Se voto uguale non era chiaro quale avrebbe scelto prima

- Quando si processano alternative, si resetta flag bPartInCombiIsInverted
This commit is contained in:
andrea.villa
2026-04-01 11:06:15 +02:00
parent d001273704
commit 6fd356f757
+5 -4
View File
@@ -1297,7 +1297,7 @@ local function GetBestCombination( ListToCompare, Part)
-- scelgo soluzione senza rotazioni
if ListToCompare[ListIndex].nRotations == 0 then
-- scelgo soluzione con voto più alto
if ListToCompare[nIndexBestCombination].dTotalRating < ListToCompare[ListIndex].dTotalRating then
if ListToCompare[nIndexBestCombination].dTotalRating + 10 * GEO.EPS_SMALL < ListToCompare[ListIndex].dTotalRating then
nIndexBestCombination = ListIndex
end
end
@@ -1328,7 +1328,7 @@ local function GetBestCombination( ListToCompare, Part)
nIndexBestCombination = ListIndex
elseif ListToCompare[ListIndex].nComplete == ListToCompare[nIndexBestCombination].nComplete then
-- scelgo soluzione con voto più alto
if ListToCompare[nIndexBestCombination].dTotalRating < ListToCompare[ListIndex].dTotalRating then
if ListToCompare[nIndexBestCombination].dTotalRating + 10 * GEO.EPS_SMALL < ListToCompare[ListIndex].dTotalRating then
nIndexBestCombination = ListIndex
end
end
@@ -1343,10 +1343,10 @@ local function GetBestCombination( ListToCompare, Part)
local dOtherTotalRating = ListToCompare[ListIndex].dTotalRating
-- scelgo soluzione con voto più alto
if dBestTotalRating < dOtherTotalRating then
if dBestTotalRating + 10 * GEO.EPS_SMALL < dOtherTotalRating then
nIndexBestCombination = ListIndex
-- se stesso voto
elseif dBestTotalRating == dOtherTotalRating then
elseif abs( dBestTotalRating - dOtherTotalRating) < 10 * GEO.EPS_SMALL then
-- scelgo soluzione con meno rotazioni
if ListToCompare[nIndexBestCombination].nRotations > ListToCompare[ListIndex].nRotations then
nIndexBestCombination = ListIndex
@@ -2040,6 +2040,7 @@ function BeamExec.ProcessAlternatives( PARTS)
BestCombination = GetBestCombination( CombinationListFromMatrix, PARTS[nPart])
-- se la soluzione alternativa migliore è completa, allora la verifico, altrimenti si tiene la migliore in assoluto
if BestCombination.nNotComplete == 0 and BestCombination.nNotExecute == 0 then
PARTS[nPart].bPartInCombiIsInverted = BestCombination.bPartInCombiIsInverted
-- compilazione della vProc finale contenente le feature da lavorare nella giusta rotazione
local vProc, MatrixResult = GetProcessingListFromCombination( BestCombination)