- modificate NestProcess e HEADCUT per saltare il taglio di testa se corrisponde al taglio di coda precedente
This commit is contained in:
+15
-3
@@ -392,7 +392,8 @@ local function CalculateMove( Beam, dPartLength, sState, State)
|
||||
end
|
||||
|
||||
-- Bonus Shared Cut: se le normali sono opposte, si risparmia un taglio/posizionamento
|
||||
if AreOppositeVectorApprox( Beam.LastVtN, State.Tail.vtN) then
|
||||
local bSharedCut = AreOppositeVectorApprox( Beam.LastVtN, State.Tail.vtN)
|
||||
if bSharedCut then
|
||||
dScore = dScore + CONFIG.BONUS_SHARED_CUT
|
||||
end
|
||||
|
||||
@@ -405,7 +406,8 @@ local function CalculateMove( Beam, dPartLength, sState, State)
|
||||
sState = sState,
|
||||
dScore = dScore,
|
||||
dSafeOverlap = dSafeOverlap,
|
||||
dFutureResidualLength = dFutureResidualLength
|
||||
dFutureResidualLength = dFutureResidualLength,
|
||||
bSharedCut = bSharedCut
|
||||
}
|
||||
return Move
|
||||
end
|
||||
@@ -527,7 +529,8 @@ local function CommitBestMove( BestMove)
|
||||
sState = BestMove.sState,
|
||||
dSafeOverlap = BestMove.dSafeOverlap,
|
||||
dLength = Template.dLength,
|
||||
dPosX = BestMove.dFutureResidualLength
|
||||
dPosX = BestMove.dFutureResidualLength,
|
||||
bSharedCut = BestMove.bSharedCut
|
||||
})
|
||||
|
||||
-- chiusura job
|
||||
@@ -625,6 +628,8 @@ for i = 1, #RawInventory.ActiveBeams do
|
||||
|
||||
-- Spostamento pezzi verso la testa della barra e aggiunta duplo
|
||||
local nIndex = 1
|
||||
local bSkipNextHeadCut = false
|
||||
|
||||
for j = #Beam.NestedParts, 1, -1 do
|
||||
local Part = Beam.NestedParts[j]
|
||||
local nInitialPosition = EgtGetInfo( Part.id, 'INITIALPOSITION', 'i')
|
||||
@@ -635,6 +640,11 @@ for i = 1, #RawInventory.ActiveBeams do
|
||||
-- copia del pezzo (aggiunta duplo)
|
||||
local idDuplo = EgtDuploNew( Part.id)
|
||||
|
||||
-- pezzo già intestato dal Tailcut precedente: si segnala all'automatismo che si può saltare Headcut
|
||||
if bSkipNextHeadCut then
|
||||
EgtSetInfo( idDuplo, "SKIP_HEADCUT", 1)
|
||||
end
|
||||
|
||||
-- eventuale rotazione
|
||||
if ( EgtStartsWith( Part.sState, '0010') and nInitialPosition == 1)
|
||||
or ( EgtStartsWith( Part.sState, '1000') and nInitialPosition == 3) then
|
||||
@@ -656,6 +666,8 @@ for i = 1, #RawInventory.ActiveBeams do
|
||||
EgtSetInfo( idMachGroup, "PART" .. nIndex, idDuplo .. "," .. dPosX)
|
||||
|
||||
nIndex = nIndex + 1
|
||||
|
||||
bSkipNextHeadCut = Part.bSharedCut
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user