Compare commits

...

4 Commits

Author SHA1 Message Date
luca.mazzoleni a8036e1645 Merge branch 'develop' into DeleteOldAlternatives 2026-07-20 18:01:59 +02:00
luca.mazzoleni ae720e71d4 - in BeamExec.ProcessBeams correzione nella creazione grezzi 2026-07-20 17:53:33 +02:00
luca.mazzoleni 3debeafd77 Merge branch 'main' into develop 2026-07-20 16:11:34 +02:00
luca.mazzoleni 37ff2e7f4c - in BeamExec.ProcessAlternatives si azzerano le alternative non usate 2026-07-16 17:07:28 +02:00
+49 -12
View File
@@ -401,6 +401,7 @@ end
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, bCreateMachGroup, bIsFlipRot )
-- 1. Inizializzazione e Default
local idTempGroup = BeamLib.GetTempGroup( )
local dMinLengthToCreateRaw = 10
BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11 )
BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8 )
@@ -465,7 +466,17 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
end
local dStartOffset = dNextStartOffset
local dEndOffset = ( i == #PARTS ) and 0 or dOvmMid
local dEndOffset = dOvmMid
-- se ultimo pezzo bisogna allungare il grezzo del restante solo se non viene creato un grezzo indipendente
if ( i == #PARTS ) then
local dPotentialRemaining = max( 0, dRawL - ( CurrentPart.dPosX + dPartLen ))
if ( dPotentialRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
dEndOffset = 0 -- Coda a zero, il resto diventerà un idRawRest indipendente
else
dEndOffset = dPotentialRemaining -- Il pezzo si allunga per prendere tutta la barra residua
end
end
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui)
if ( i < #PARTS ) then
@@ -568,7 +579,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
if ( idPrevRaw ) then EgtSetInfo( idPrevRaw, 'BDST', 10000 ) end
local dRemaining = dRawL - dMaxX
if ( dRemaining > 10 ) then
if ( dRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0 ), dRemaining, dRawW, dRawH, BeamData.RAWCOL )
EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR )
EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0 ) )
@@ -2642,17 +2653,43 @@ function BeamExec.ProcessAlternatives( PARTS)
end
-- passaggio info a interfaccia da scrivere sul pezzo
BEAM.INFONGEPART = {}
for i = 1, #AlternativesNest2D do
if PARTS[nPart].HeadcutInfo then
local sOffsetX = table.concat( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].OffsetX, ',')
local sVtN = ( tostring( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i].. '_H' .. '=' .. sOffsetX .. ';' .. sVtN )
local function IsStateInAlternativesNest2D( sState)
for _, v in ipairs( AlternativesNest2D) do
if v == sState then
return true
end
end
if PARTS[nPart].TailcutInfo then
local sOffsetX = table.concat( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].OffsetX, ',')
local sVtN = ( tostring( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i] .. '_T' .. '=' .. sOffsetX .. ';' .. sVtN)
return false
end
BEAM.INFONGEPART = {}
local States = {
"1000",
"0100",
"0010",
"0001",
"1000_INV",
"0100_INV",
"0010_INV",
"0001_INV",
}
for i = 1, #States do
local sState = States[i]
if IsStateInAlternativesNest2D( sState) then
if PARTS[nPart].HeadcutInfo then
local HeadcutInfo = PARTS[nPart].HeadcutInfo[sState]
local sOffsetX = table.concat( HeadcutInfo.OffsetX, ',')
local sVtN = ( tostring( HeadcutInfo.vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_H' .. '=' .. sOffsetX .. ';' .. sVtN )
end
if PARTS[nPart].TailcutInfo then
local TailCutInfo = PARTS[nPart].TailcutInfo[sState]
local sOffsetX = table.concat( TailCutInfo.OffsetX, ',')
local sVtN = ( tostring( TailCutInfo.vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. sState .. '_T' .. '=' .. sOffsetX .. ';' .. sVtN)
end
else
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_H' .. '= ')
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_T' .. '= ')
end
end