Corretta gestione tagli testa/coda in caso di soluzione con pezzo invertito
This commit is contained in:
+23
-1
@@ -571,6 +571,24 @@ local function GetFeatureForcedStrategy( Proc)
|
||||
return nil
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AdjustPrcGrp( Proc, bPartIsInverted)
|
||||
local nNewPrc = { nPrc = Proc.nPrc, nGrp = Proc.nGrp}
|
||||
|
||||
-- se pezzo invertito
|
||||
if bPartIsInverted then
|
||||
-- il taglio di testa diventa taglio di coda
|
||||
if ID.IsHeadCut( Proc) then
|
||||
_, nNewPrc.nPrc, nNewPrc.nGrp = ID.IsTailCut( Proc)
|
||||
-- il taglio di coda diventa taglio di testa
|
||||
elseif ID.IsTailCut( Proc) then
|
||||
_, nNewPrc.nPrc, nNewPrc.nGrp = ID.IsHeadCut( Proc)
|
||||
end
|
||||
end
|
||||
|
||||
return nNewPrc.nPrc, nNewPrc.nGrp
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CollectFeatures( Part, dRotIndex)
|
||||
-- recupero le feature
|
||||
@@ -599,6 +617,8 @@ local function CollectFeatures( Part, dRotIndex)
|
||||
Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id
|
||||
Proc.nGrp = nGrp
|
||||
Proc.nPrc = nPrc
|
||||
-- aggiorno info feature in caso di pezzo invertito
|
||||
Proc.nPrc, Proc.nGrp = AdjustPrcGrp( Proc, dRotIndex > 4)
|
||||
Proc.nFlg = 1
|
||||
Proc.nFct = EgtSurfTmFacetCount( ProcId) or 0
|
||||
Proc.idCut = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0
|
||||
@@ -1581,16 +1601,18 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
-- salvo sul PART la posizione di partenza che è stata scelta
|
||||
PARTS[nPart].nInitialPosition = MatrixResult.nInitialPosition
|
||||
|
||||
local nOffsetIndex = EgtIf( PARTS[nPart].bPartIsInverted, 4, 0)
|
||||
-- aggiunge tagli testa e coda in fasi opportune
|
||||
local nRotHeadCut = MatrixResult.nInitialPosition + MACHININGS.Info.nHeadCutRotation - 1
|
||||
if nRotHeadCut > 4 then
|
||||
nRotHeadCut = nRotHeadCut - 4
|
||||
end
|
||||
nRotHeadCut = nRotHeadCut + nOffsetIndex
|
||||
local nRotSplitCut = MatrixResult.nInitialPosition + MACHININGS.Info.nSplitCutRotation - 1
|
||||
if nRotSplitCut > 4 then
|
||||
nRotSplitCut = nRotSplitCut - 4
|
||||
end
|
||||
|
||||
nRotSplitCut = nRotSplitCut + nOffsetIndex
|
||||
-- setto nella Proc l'indice rotazione nella quale deve essere lavorata
|
||||
PROCESSINGS[nPart].Rotation[nRotHeadCut][MatrixResult.nIndexHeadCutInVProc].nIndexRotation = nRotHeadCut
|
||||
PROCESSINGS[nPart].Rotation[nRotSplitCut][MatrixResult.nIndexTailCutInVProc].nIndexRotation = nRotSplitCut
|
||||
|
||||
Reference in New Issue
Block a user