diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 79a4f54..06d1895 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -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)