- in BeamExec.GetAvailableCombinations se FlipRot e Nesting2D si disattivano le combinazioni con rotazioni; i tagli di testa ottimizzati (inclinati) si usano solo se FlipRot e Nesing2D
This commit is contained in:
+29
-7
@@ -341,6 +341,11 @@ function BeamExec.GetAvailableCombinations( PartInfo, bIsFlipRot)
|
||||
nCycles = 2
|
||||
end
|
||||
|
||||
if bIsFlipRot and PartInfo.GeneralParameters.GEN_bGetAlternativesNesting2D then
|
||||
BeamData.ROT90 = false
|
||||
BeamData.ROT180 = false
|
||||
end
|
||||
|
||||
-- verifico tutte le combinazioni che possono essere considerate
|
||||
for nInvertIndex = 1, nCycles do
|
||||
for nUnloadPos = 1, 4 do
|
||||
@@ -358,22 +363,31 @@ function BeamExec.GetAvailableCombinations( PartInfo, bIsFlipRot)
|
||||
Combination.bPartInCombiIsInverted = true
|
||||
end
|
||||
|
||||
-- counter numero totale di rotazioni della combinazione
|
||||
Combination.nRotationCounter = 0
|
||||
|
||||
-- se posizionamento iniziale attivo
|
||||
if string.sub( sBitIndexCombination, 1, 1) == '1' then
|
||||
CombinationList.Rotations[1] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
-- se attiva rotazione 90
|
||||
if string.sub( sBitIndexCombination, 2, 2) == '1' then
|
||||
CombinationList.Rotations[2] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
-- se attiva rotazione 180
|
||||
if string.sub( sBitIndexCombination, 3, 3) == '1' then
|
||||
CombinationList.Rotations[3] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
-- se attiva rotazione 270
|
||||
if string.sub( sBitIndexCombination, 4, 4) == '1' then
|
||||
CombinationList.Rotations[4] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
|
||||
Combination.nRotationCounter = Combination.nRotationCounter - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -808,7 +822,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
-- gruppo per geometrie temporanee
|
||||
local idTempGroup = BeamLib.GetTempGroup()
|
||||
|
||||
@@ -820,12 +834,10 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
-- ciclo tutte le feature
|
||||
for i = 1, #vProcSingleRot do
|
||||
local Proc = vProcSingleRot[i]
|
||||
if Proc.Topology.sName == 'HeadCut' then
|
||||
if not HeadProcOriginal and Proc.Topology.sName == 'HeadCut' then
|
||||
HeadProcOriginal = Proc
|
||||
HeadProcOriginal.bIsOriginalHeadcut = true
|
||||
elseif Proc.Topology.sName == 'TailCut' then
|
||||
elseif not TailProcOriginal and Proc.Topology.sName == 'TailCut' then
|
||||
TailProcOriginal = Proc
|
||||
TailProcOriginal.bIsOriginalTailcut = true
|
||||
end
|
||||
-- se feature abilitata alla lavorazione
|
||||
if Proc.nFlg ~= 0 then
|
||||
@@ -840,7 +852,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
and ( FeatureLib.IsFeatureCuttingEntireSection( Proc.b3Box, Part) and FeatureLib.IsFeatureCuttingEntireSection( ProcB.b3Box, Part))
|
||||
|
||||
-- si trovano i veri tagli di testa e coda e si disattivano gli altri, se necessario
|
||||
if Part.GeneralParameters.GEN_bGetAlternativesNesting2D and bAreBothTruncatingCuts then
|
||||
if bIsFlipRot and Part.GeneralParameters.GEN_bGetAlternativesNesting2D and bAreBothTruncatingCuts then
|
||||
-- testa
|
||||
if Proc.Faces[1].vtN:getX() > GEO.EPS_SMALL and ProcB.Faces[1].vtN:getX() > GEO.EPS_SMALL then
|
||||
-- il primo taglio è più verso il centro della trave
|
||||
@@ -922,6 +934,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
HeadProcOriginal = Proc
|
||||
end
|
||||
-- se entrambi tagli di coda, si tiene sempre il primo ( ma non quello aggiunto dall'automatismo)
|
||||
if ( ID.IsTailCut( Proc) and not EgtGetInfo( Proc.id, 'HEAD_ADD_CUT', 'i')) and ID.IsTailCut( ProcB) then
|
||||
@@ -931,6 +944,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
TailProcOriginal = Proc
|
||||
end
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
|
||||
if ( Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Groove' or ID.IsMortise( Proc)) and
|
||||
@@ -956,12 +970,20 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
return vProcSingleRot
|
||||
end
|
||||
|
||||
-- si tiene via il riferimento alla Proc Head/Tail originale in caso si dovesse rimpiazzare
|
||||
HeadProcOriginal.bIsOriginalHeadcut = true
|
||||
TailProcOriginal.bIsOriginalTailcut = true
|
||||
if not HeadProc then
|
||||
HeadProc = HeadProcOriginal
|
||||
else
|
||||
HeadProc.HeadProcOriginal = HeadProcOriginal
|
||||
end
|
||||
if not TailProc then
|
||||
TailProc = TailProcOriginal
|
||||
else
|
||||
TailProc.TailProcOriginal = TailProcOriginal
|
||||
end
|
||||
|
||||
HeadProc.Topology = {}
|
||||
TailProc.Topology = {}
|
||||
HeadProc.Topology.sFamily = 'HeadCut'
|
||||
@@ -1431,7 +1453,7 @@ function BeamExec.GetProcessings( PARTS, bIsFlipRot)
|
||||
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
|
||||
-- TODO le dipendenze cambiano in base alla rotazione del pezzo? probabilmente no
|
||||
vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart])
|
||||
vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart], bIsFlipRot)
|
||||
else
|
||||
-- inserisco una tabella vuota
|
||||
table.insert( vProcRot, {})
|
||||
|
||||
Reference in New Issue
Block a user