- in NestProcess si provano barre nuove solo se non si trovano soluzioni con quelle già attive

This commit is contained in:
luca.mazzoleni
2026-05-18 12:03:46 +02:00
parent 1cde1c94d9
commit a404bf2f9e
+19 -16
View File
@@ -4,7 +4,7 @@
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
EgtEnableDebug( false)
-- Include
local BeamData = require( 'BeamDataNew')
@@ -504,21 +504,24 @@ while true do
end
end
-- 2 Si provano le barre ancora a stock (VirtualBeam si resetta invece di crearne una nuova per velocizzare il calcolo)
for i = 1, #RawInventory.Stock do
if RawInventory.Stock[i].nCount > 0 then
VirtualBeam.dTotalLength = RawInventory.Stock[i].dLength
VirtualBeam.dResidualLength = RawInventory.Stock[i].dLength - ( NEST.STARTOFFSET or 0)
VirtualBeam.LastOffsetX = { 0, 0, 0, 0}
VirtualBeam.LastVtN = Vector3d( 1, 0, 0)
VirtualBeam.vtNXabs = 1
VirtualBeam.dLastHeadRecess = 0
VirtualBeam.NestedParts = {}
local CurrentMove = FindBestPartForBeam( VirtualBeam)
if CurrentMove and CurrentMove.dScore > dHighestScore then
dHighestScore = CurrentMove.dScore
BestMove = CurrentMove
BestMove.nStockIndex = i
-- 2 Si provano le barre ancora a stock SOLO SE NON TROVATA SOLUZIONE CON BARRE ATTIVE
-- VirtualBeam si resetta invece di crearne una nuova per velocizzare il calcolo
if not BestMove then
for i = 1, #RawInventory.Stock do
if RawInventory.Stock[i].nCount > 0 then
VirtualBeam.dTotalLength = RawInventory.Stock[i].dLength
VirtualBeam.dResidualLength = RawInventory.Stock[i].dLength - ( NEST.STARTOFFSET or 0)
VirtualBeam.LastOffsetX = { 0, 0, 0, 0}
VirtualBeam.LastVtN = Vector3d( 1, 0, 0)
VirtualBeam.vtNXabs = 1
VirtualBeam.dLastHeadRecess = 0
VirtualBeam.NestedParts = {}
local CurrentMove = FindBestPartForBeam( VirtualBeam)
if CurrentMove and CurrentMove.dScore > dHighestScore then
dHighestScore = CurrentMove.dScore
BestMove = CurrentMove
BestMove.nStockIndex = i
end
end
end
end