Compare commits

..

1 Commits

14 changed files with 18 additions and 152 deletions
+3 -3
View File
@@ -1717,7 +1717,6 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, PartInfo, bRePro
SingleCombination.nRotations = 0
SingleCombination.dTotalTimeToMachine = 0
SingleCombination.dTotalQuality = 0
SingleCombination.dFeatureRotationIndex = 0
SingleCombination.dTotalCompletionIndex = 0
SingleCombination.nComplete = 0
SingleCombination.nNotComplete = 0
@@ -1793,7 +1792,6 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, PartInfo, bRePro
SingleCombination.dTotalTimeToMachine = SingleCombination.dTotalTimeToMachine + Data.dTimeToMachine
SingleCombination.dTotalQuality = SingleCombination.dTotalQuality + Data.dQuality
SingleCombination.dTotalCompletionIndex = SingleCombination.dTotalCompletionIndex + Data.dCompletionIndex
SingleCombination.dFeatureRotationIndex = SingleCombination.dFeatureRotationIndex + ( Data.dFeatureRotationIndex or 3)
SingleCombination.nComplete = SingleCombination.nComplete + EgtIf( Data.bComplete, 1, 0)
SingleCombination.nNotComplete = SingleCombination.nNotComplete + EgtIf( Data.bNotComplete, 1, 0)
SingleCombination.nNotExecute = SingleCombination.nNotExecute + EgtIf( Data.bNotApplicable, 1, 0)
@@ -2390,6 +2388,8 @@ function BeamExec.ProcessAlternatives( PARTS)
local HeadCut = PROCESSINGS[nPart].Rotation[nRotHeadCut+nOffsetIndex][MatrixResult.nIndexHeadCutInVProc]
local TailCut = PROCESSINGS[nPart].Rotation[nRotSplitCut+nOffsetIndex][MatrixResult.nIndexTailCutInVProc]
local HeadCutOnFirstRotation = PROCESSINGS[nPart].Rotation[1+nOffsetIndex][MatrixResult.nIndexHeadCutInVProc]
local TailCutOnFirstRotation = PROCESSINGS[nPart].Rotation[1+nOffsetIndex][MatrixResult.nIndexTailCutInVProc]
-- setto nella Proc l'indice rotazione nella quale deve essere lavorata
HeadCut.nIndexRotation = nRotHeadCut
@@ -2431,7 +2431,7 @@ function BeamExec.ProcessAlternatives( PARTS)
-- aggiornamento info testa/coda per Nesting
local nRotation = BeamLib.ConvertBitIndexToRotationIndex( BestCombination.sBitIndexCombination)
local sBitIndexCombinationWithInvert = BestCombination.sBitIndexCombination .. EgtIf( BestCombination.bPartInCombiIsInverted, '_INV', '')
local HeadcutInfo, TailcutInfo = GetHeadTailInfoForNesting( HeadCut, TailCut, PARTS[nPart])
local HeadcutInfo, TailcutInfo = GetHeadTailInfoForNesting( HeadCutOnFirstRotation, TailCutOnFirstRotation, PARTS[nPart])
if HeadcutInfo then
-- offset e vettori vanno adeguati alla rotazione attuale (inversione è già corretta)
BeamLib.RotateTableFromIndexInPlace( HeadcutInfo.OffsetX, nRotation)
+2 -4
View File
@@ -788,17 +788,15 @@ function FeatureLib.CalculateCombinationsCompositeRating( CombinationsList, sMac
local dIndexWeightTimeToMachine = 5 - ( 4 * ( EgtClamp( CombinationsList[n].dTotalTimeToMachine / CombinationsList.dAllCombinationsTotalTime, 0, 1)))
-- si calcolano gli indici pesati in base alla configurazione utente. Possibili parametri di configurazione:
local dQuality, dCompletion, dTime, dFeatureRotationIndex, dCoeffQuality, dCoeffCompletion, dCoeffTime
local dQuality, dCompletion, dTime, dCoeffQuality, dCoeffCompletion, dCoeffTime
dCoeffQuality, dCoeffCompletion, dCoeffTime = GetMachiningStrategyCoefficients( sMachiningStrategy)
dQuality = CombinationsList[n].dTotalQuality * dCoeffQuality
dCompletion = CombinationsList[n].dTotalCompletionIndex * dCoeffCompletion
dTime = dIndexWeightTimeToMachine * dCoeffTime
dFeatureRotationIndex = CombinationsList[n].dFeatureRotationIndex
-- TODO da verificare se meglio sommare o moltiplicare gli indici
CombinationsList[n].dTotalRating = dQuality + dCompletion + dTime + dFeatureRotationIndex
CombinationsList[n].dTotalRating = dQuality + dCompletion + dTime -- TODO da verificare se meglio sommare o moltiplicare gli indici
else
CombinationsList[n].dTotalRating = 0
end
-3
View File
@@ -209,9 +209,6 @@ function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part)
Machinings[nCurrentMachiningIndex].nFeatureSegment = j
Machinings[nCurrentMachiningIndex].dLengthToMachine = Machinings[nCurrentMachiningIndex].dEdgeLength + Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength + Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength
Machinings[nCurrentMachiningIndex].dTimeToMachine = MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machinings[nCurrentMachiningIndex], Part)
Machinings[nCurrentMachiningIndex].bIsFirstSegment = ( j == 1)
Machinings[nCurrentMachiningIndex].bIsLastSegment = ( j == nParts)
Machinings[nCurrentMachiningIndex].bIsMachiningSplitted = true
end
-- anche le lavorazioni non splittate necessitano del segmento assegnato
else
-2
View File
@@ -319,6 +319,4 @@
1000316=Autocam will apply a machining on the theoretical zero, to avoid collision if the theoretical piece length doesn't correspond to the real length
1000317=Finish with mill
1000318=Use a mill to finish the surface if split with chain saw
1000319=Allow multiple short strips
1000320=Allow multiple short strips
// ----- End -----
-2
View File
@@ -319,6 +319,4 @@
1000316=Autocam applicherà una lavorazione sullo zero teorico per evitare collisioni se la lunghezza teorica del pezzo non corrisponde alla lunghezza reale
1000317=Finisci con la fresa
1000318=Utilizza una fresa per rifinire la superficie se tagliata con la sega a catena
1000319=Permettere codoli multipli
1000320=Permettere codoli multipli
// ----- End -----
-2
View File
@@ -319,6 +319,4 @@
1000316=Autocam past een bewerking toe op het theoretische nulpunt om botsingen te voorkomen als de theoretische lengte niet overeenkomt met de werkelijke lengte
1000317=Afwerken met frees
1000318=Gebruik een frees om het oppervlak na te bewerken als dit met de kettingzaag is gespleten
1000319=Sta meerdere korte verbindingsstrips toe
1000320=Sta meerdere korte verbindingsstrips toe
// ----- End -----
+1 -1
View File
@@ -292,7 +292,7 @@ local function GetTenonMachiningResult( Proc, Result)
else
TotalResult.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
end
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
TotalResult.sInfo = ''
-- lavorazione incompleta
-12
View File
@@ -136,18 +136,6 @@
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bAllowPerpendicularStrip",
"sNameNge": "ALLOW_PERPENDICULAR_STRIP",
"sValue": "false",
"sDescriptionShort": "Allow multiple short strips",
"sDescriptionLong": "Allow multiple short strips",
"idDescriptionShortMsg": 1000319,
"idDescriptionLongMsg": 1000320,
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bFinishWithMill",
"sNameNge": "ALLOW_FINISH_MILL",
+1 -22
View File
@@ -46,20 +46,6 @@ local function IsTwoFacesCommonEdgeTooLong( Proc, Part)
return bIsTwoFacesCommonEdgeTooLong
end
-------------------------------------------------------------------------------------------------------------
-- si cerca di tenere la feature rivolta verso il fronte o sopra, cioè dal lato opposto la battuta
local function GetFeatureRotationIndex( Proc)
local nVoteIndex
if Proc.MainFaces.BottomFaces[1].vtN:getY() < 0 or Proc.MainFaces.BottomFaces[1].vtN:getZ() < 0 then
nVoteIndex = 2
else
nVoteIndex = 3
end
return nVoteIndex
end
-------------------------------------------------------------------------------------------------------------
function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
-- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti)
@@ -126,12 +112,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
or bKeepWasteAttached then
local BladeKeepWasteResult
local OptionalParameters = { dExtendAfterTail = dExtendAfterTail,
dStripWidth = Strategy.Parameters.dStripWidth,
bAllowPerpendicularStrip = Strategy.Parameters.bAllowPerpendicularStrip,
bFinishWithMill = Strategy.Parameters.bFinishWithMill,
bForced = bKeepWasteAttached
}
local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dStripWidth = Strategy.Parameters.dStripWidth, bForced = bKeepWasteAttached}
AuxiliaryData.bIgnoreNotClampableLength = true
Blade.Result, BladeKeepWasteResult = BladeKeepWaste.Make( Proc, Part, OptionalParameters)
dTimeToMachine = BladeKeepWasteResult.dTimeToMachine
@@ -139,7 +120,6 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
dQuality = BladeKeepWasteResult.dQuality
Strategy.Result.sInfo = BladeKeepWasteResult.sInfo or ''
Strategy.Result.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
end
-- lavorazione a cubetti / taglio singolo
@@ -177,7 +157,6 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
dMRRBlade = BladeKeepWasteResult.dMRR
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
dQuality = BladeKeepWasteResult.dQuality
Strategy.Result.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
end
-- lavorazione eventuale terza faccia tipo RidgeLap
+1 -1
View File
@@ -247,7 +247,7 @@ local function GetTenonMachiningResult( Proc, Result)
TotalResult.dCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
TotalResult.dMRR = ( Result.Milling.dMRR + Result.Cutting.dMRR) / 2
TotalResult.dQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'STD', 'FINE'))
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
TotalResult.sInfo = ''
-- lavorazione incompleta
+2 -2
View File
@@ -249,7 +249,7 @@ function GetMortiseMachiningResult( Proc, Result)
sQuality = 'STD'
end
TotalResult.dQuality = FeatureLib.GetStrategyQuality( sQuality)
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.sInfo = ''
-- lavorazione mortasa completa
elseif Strategy.Machining.Milling.bIsApplicable and not( Proc.FeatureInfo.bIsFrontMortise) then
@@ -258,7 +258,7 @@ function GetMortiseMachiningResult( Proc, Result)
TotalResult.dMRR = Result.Milling.dMRR
local sQuality = EgtIf( Strategy.Machining.AntiSplint.bIsApplicable, 'BEST', 'STD')
TotalResult.dQuality = FeatureLib.GetStrategyQuality( sQuality)
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.sInfo = ''
-- lavorazione incompleta
elseif Strategy.Machining.Cutting.bIsApplicable then
-24
View File
@@ -125,30 +125,6 @@
}
]
},
{
"sName": "dStripWidth",
"sNameNge": "STRIP_WIDTH",
"sValue": "5",
"sDescriptionShort": "Strip width",
"sDescriptionLong": "In case the waste is still kept attached, this is the wigth dimension of the strip",
"idDescriptionShortMsg": 1000129,
"idDescriptionLongMsg": 1000130,
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bAllowPerpendicularStrip",
"sNameNge": "ALLOW_PERPENDICULAR_STRIP",
"sValue": "false",
"sDescriptionShort": "Allow multiple short strips",
"sDescriptionLong": "Allow multiple short strips",
"idDescriptionShortMsg": 1000319,
"idDescriptionLongMsg": 1000320,
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dMaxWasteLength",
"sSource": "GEN_dMaxWasteLength",
+5 -22
View File
@@ -18,20 +18,6 @@ local Strategy = {}
local RidgeLap = {}
RidgeLap.Result = {}
-------------------------------------------------------------------------------------------------------------
-- si cerca di tenere la feature rivolta verso il fronte o sopra, cioè dal lato opposto la battuta
local function GetFeatureRotationIndex( Proc)
local nVoteIndex
if Proc.MainFaces.BottomFaces[1].vtN:getY() < 0 or Proc.MainFaces.BottomFaces[1].vtN:getZ() < 0 then
nVoteIndex = 2
else
nVoteIndex = 3
end
return nVoteIndex
end
-------------------------------------------------------------------------------------------------------------
-- TODO risolvere problemi calcolo volume nullo se facce rimosse
-- TODO gestire lavorazione con svuotatura
@@ -115,25 +101,22 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters)
or bKeepWasteAttached then
local BladeKeepWasteResult
local OptionalParameters = { bAllowPerpendicularStrip = Strategy.Parameters.bAllowPerpendicularStrip,
dStripWidth = Strategy.Parameters.dStripWidth,
dExtendAfterTail = dExtendAfterTail, bFinishWithMill = false}
local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dStripWidth = 5, bFinishWithMill = false}
AuxiliaryData.bIgnoreNotClampableLength = true
TwoFaces.Result, BladeKeepWasteResult = BladeKeepWaste.Make( NewProc, Part, OptionalParameters)
dTimeToMachine = BladeKeepWasteResult.dTimeToMachine
dMRRBlade = BladeKeepWasteResult.dMRR
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
dQuality = BladeKeepWasteResult.dQuality
Strategy.Result.dFeatureRotationIndex = GetFeatureRotationIndex( NewProc)
-- lavorazione a cubetti facce concave
else
local BladeToWasteResult
local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume,
dMaxWasteLength = Strategy.Parameters.dMaxWasteLength,
bSaveAddedGeometries = bAddMachining,
dExtendAfterTail = dExtendAfterTail,
bReduceBladePath = Strategy.Parameters.bReduceBladePath
dMaxWasteLength = Strategy.Parameters.dMaxWasteLength,
bSaveAddedGeometries = bAddMachining,
dExtendAfterTail = dExtendAfterTail,
bReduceBladePath = Strategy.Parameters.bReduceBladePath
}
AuxiliaryData.bIgnoreNotClampableLength = false
TwoFaces.Result, BladeToWasteResult = BladeToWaste.Make( NewProc, Part, OptionalParameters)
+3 -52
View File
@@ -146,12 +146,10 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
local dExtendAfterTail = Parameters.dExtendAfterTail
local nToolIndex = Parameters.nToolIndex
local dStripWidth = Parameters.dStripWidth
local bAllowPerpendicularStrip = Parameters.bAllowPerpendicularStrip
local OtherBottomFace = Parameters.OtherBottomFace
local dDepthToMachine = EdgeToMachine.dElevation / 2 - dStripWidth / 2
local OptionalParametersFaceByBlade1 = { dDepthToMachine = dDepthToMachine, bIsSplitFeature = bIsSplitFeature,
dExtendAfterTail = dExtendAfterTail, nToolIndex = nToolIndex}
local OptionalParametersFaceByBlade1 = { dDepthToMachine = dDepthToMachine, bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail, nToolIndex = nToolIndex}
local EdgeToMachineOpposite = BeamLib.FindEdgeBestOrientedAsDirection( BottomFace.Edges, -EdgeToMachine.vtN)
-- primo lato
@@ -177,15 +175,8 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
dStripWidth = TOOLS[Cutting2.nToolIndex].dThickness + 2 * dStripWidth
end
-- se richiesto, si calcola il codolo verticale
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
dDepthToMachine = TOOLS[Cutting2.nToolIndex].dMaxMaterial - 10
else
dDepthToMachine = min( TOOLS[Cutting2.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
end
dDepthToMachine = min( TOOLS[Cutting2.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
OptionalParametersFaceByBlade2.bAllowPerpendicularStrip = bAllowPerpendicularStrip
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
Cutting2.nInternalSortingPriority = 2
@@ -198,15 +189,8 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
dStripWidth = TOOLS[Cutting1.nToolIndex].dThickness + 2 * dStripWidth
end
-- se richiesto, si calcola il codolo verticale
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting2.dEdgeLength, Part) then
dDepthToMachine = TOOLS[Cutting1.nToolIndex].dMaxMaterial - 10
else
dDepthToMachine = min( TOOLS[Cutting1.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
end
dDepthToMachine = min( TOOLS[Cutting1.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
OptionalParametersFaceByBlade1.bAllowPerpendicularStrip = bAllowPerpendicularStrip
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
Cutting1.nInternalSortingPriority = 2
@@ -266,7 +250,6 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
local bFinishWithMill = ( OptionalParameters.bFinishWithMill ~= false)
local dMillingOffsetFromSide = OptionalParameters.dMillingOffsetFromSide or 1
local dStripWidth = OptionalParameters.dStripWidth or 5
local bAllowPerpendicularStrip = OptionalParameters.bAllowPerpendicularStrip or false
local bForced = OptionalParameters.bForced or false
-- volume della feature
@@ -313,7 +296,6 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
dExtendAfterTail = dExtendAfterTail,
nToolIndex = nToolIndex,
dStripWidth = dStripWidth,
bAllowPerpendicularStrip = bAllowPerpendicularStrip,
OtherBottomFace = BottomFace2
}
local Cuttings1 = MakeBottomFace( Proc, Part, BottomFace1, BottomEdgeToMachine1, Parameters1)
@@ -445,37 +427,6 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
Machinings = MachiningLib.GetSplitMachinings( Machinings, FeatureSplittingPoints, Part)
end
-- se codoli perpendicolari, si accorciano LeadIn/LeadOut
if bAllowPerpendicularStrip then
for j = 1, #Machinings do
if Machinings[j].bIsMachiningSplitted then
-- se primo spezzone
if Machinings[j].bIsFirstSegment then
if MachiningLib.StartsLeftSide( Machinings[j]) then
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - Machinings[j].dToolMarkLength - dStripWidth
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - dStripWidth
else
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - Machinings[j].dToolMarkLength - dStripWidth
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - dStripWidth
end
-- se ultimo spezzone
elseif Machinings[j].bIsLastSegment then
if MachiningLib.StartsLeftSide( Machinings[j]) then
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - Machinings[j].dToolMarkLength - dStripWidth
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - dStripWidth
else
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - Machinings[j].dToolMarkLength - dStripWidth
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - dStripWidth
end
-- se spezzoni centrali
else
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - Machinings[j].dToolMarkLength - dStripWidth
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - Machinings[j].dToolMarkLength - dStripWidth
end
end
end
end
-- ordinamento
table.sort( Machinings, SortMachiningsBySegment)