From 74611f99c5a8a377d52851ed5e1b520797294c82 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 23 Apr 2025 12:12:00 +0200 Subject: [PATCH] =?UTF-8?q?-=20in=20STR0003=20correzione=20a=20restituzion?= =?UTF-8?q?e=20risultati=20-=20in=20STR0004=20implementata=20restituzione?= =?UTF-8?q?=20risultati=20nuova=20-=20in=20strategie=20di=20base=20corrett?= =?UTF-8?q?o=20calcolo=20area=20lavorata=20(ora=20contempla=20che=20il=20p?= =?UTF-8?q?ercorso=20=C3=A8=20in=20centro=20utensile=20e=20che=20l'area=20?= =?UTF-8?q?lavorata=20non=20pu=C3=B2=20superare=20quella=20della=20faccia)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Strategies/Standard/STR0003/STR0003.lua | 68 ++++++++++++++++--------- Strategies/Standard/STR0004/STR0004.lua | 45 ++++++++++------ StrategyLibs/BLADEKEEPWASTE.lua | 4 +- StrategyLibs/FACEBYBLADE.lua | 12 ++--- StrategyLibs/FACEBYCHAINSAW.lua | 4 +- StrategyLibs/FACEBYMILL.lua | 12 ++--- 6 files changed, 89 insertions(+), 56 deletions(-) diff --git a/Strategies/Standard/STR0003/STR0003.lua b/Strategies/Standard/STR0003/STR0003.lua index 5ed90ad..5fcb496 100644 --- a/Strategies/Standard/STR0003/STR0003.lua +++ b/Strategies/Standard/STR0003/STR0003.lua @@ -355,21 +355,23 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) -- si lavora solamente l'impronta lama sui lati chiusi if ( Blade.Result.Bottom[1].dResidualDepth < 10 * GEO.EPS_SMALL) and - ( BottomEdge.dLength > 3 * Blade.Result.Bottom[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then + ( BottomEdge.dLength > 3 * Blade.Result.Bottom[1].dToolMarkLength - 10 * GEO.EPS_SMALL) then if not BottomEdge.bIsStartOpen then OptionalParameters.sSideToMachine = 'Start' - OptionalParameters.dLengthToMachine = Blade.Result.Bottom[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Bottom[1].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, BottomEdge, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * Mortising.dEdgeLength Chainsaw.AddResult( Mortising) end if not BottomEdge.bIsEndOpen then OptionalParameters.sSideToMachine = 'End' - OptionalParameters.dLengthToMachine = Blade.Result.Bottom[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Bottom[1].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, BottomEdge, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * Mortising.dEdgeLength Chainsaw.AddResult( Mortising) end @@ -394,21 +396,23 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) -- si lavora solamente l'impronta lama sul fondo if ( #Blade.Result.Side > 0) and Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL then - if ( BottomEdge.bIsStartOpen and SideEdge1.dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then + if ( BottomEdge.bIsStartOpen and SideEdge1.dLength > 3 * Blade.Result.Side[1].dToolMarkLength - 10 * GEO.EPS_SMALL) then OptionalParameters.sSideToMachine = 'End' - OptionalParameters.dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Side[1].dToolMarkLength OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) - elseif ( BottomEdge.bIsEndOpen and SideEdge2.dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then + elseif ( BottomEdge.bIsEndOpen and SideEdge2.dLength > 3 * Blade.Result.Side[1].dToolMarkLength - 10 * GEO.EPS_SMALL) then OptionalParameters.sSideToMachine = 'Start' - OptionalParameters.dLengthToMachine = Blade.Result.Side[2].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Side[2].dToolMarkLength OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) end -- si lavora tutto il lato @@ -426,12 +430,14 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) elseif BottomEdge.bIsEndOpen then OptionalParameters.dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) end end @@ -456,15 +462,16 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.bExtendWithCornerRadius = true -- si lavora solamente l'impronta lama sul fondo - if ( Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL and SideEdge1.dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) and - ( Blade.Result.Side[2].dResidualDepth < 10 * GEO.EPS_SMALL and SideEdge2.dLength > 3 * Blade.Result.Side[2].dBladeMarkLength - 10 * GEO.EPS_SMALL) then + if ( Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL and SideEdge1.dLength > 3 * Blade.Result.Side[1].dToolMarkLength - 10 * GEO.EPS_SMALL) and + ( Blade.Result.Side[2].dResidualDepth < 10 * GEO.EPS_SMALL and SideEdge2.dLength > 3 * Blade.Result.Side[2].dToolMarkLength - 10 * GEO.EPS_SMALL) then OptionalParameters.dDepthToMachine = SideEdge1.dElevation + BeamData.CUT_EXTRA OptionalParameters.sSideToMachine = 'End' - OptionalParameters.dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Side[1].dToolMarkLength OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) -- ancora materiale residuo - si lavora da entrambi i lati @@ -474,16 +481,18 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.dDepthToMachine = SideEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN OptionalParameters.sSideToMachine = 'End' - OptionalParameters.dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Side[1].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) OptionalParameters.dDepthToMachine = SideEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN OptionalParameters.sSideToMachine = 'Start' - OptionalParameters.dLengthToMachine = Blade.Result.Side[2].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Side[2].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters) + Mortising.dAreaToMachine = 0 Chainsaw.AddResult( Mortising) -- lavorando dai due lati non c'è materiale residuo - si può eliminare la lavorazione del fondo @@ -500,6 +509,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) -- ancora materiale residuo - si lavora da entrambi i lati @@ -511,12 +521,14 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) OptionalParameters.dDepthToMachine = SideEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN OptionalParameters.dMaxElev = Blade.Result.Side[2].dResidualDepth + BeamData.CUT_EXTRA Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters) + Mortising.dAreaToMachine = 0 Chainsaw.AddResult( Mortising) -- lavorando dai due lati non c'è materiale residuo - si può disabilitare la lavorazione del fondo @@ -534,22 +546,24 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.bExtendWithCornerRadius = true -- si lavora solamente l'impronta lama sul lato opposto - if ( Blade.Result.Opposite[1].dResidualDepth < 10 * GEO.EPS_SMALL and OppositeEdge1.dLength > 3 * Blade.Result.Opposite[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) and - ( Blade.Result.Opposite[2].dResidualDepth < 10 * GEO.EPS_SMALL and OppositeEdge2.dLength > 3 * Blade.Result.Opposite[2].dBladeMarkLength - 10 * GEO.EPS_SMALL) then + if ( Blade.Result.Opposite[1].dResidualDepth < 10 * GEO.EPS_SMALL and OppositeEdge1.dLength > 3 * Blade.Result.Opposite[1].dToolMarkLength - 10 * GEO.EPS_SMALL) and + ( Blade.Result.Opposite[2].dResidualDepth < 10 * GEO.EPS_SMALL and OppositeEdge2.dLength > 3 * Blade.Result.Opposite[2].dToolMarkLength - 10 * GEO.EPS_SMALL) then OptionalParameters.dLengthToMachine = max( - Blade.Result.Opposite[1].dBladeMarkLength, - Blade.Result.Opposite[2].dBladeMarkLength + Blade.Result.Opposite[1].dToolMarkLength, + Blade.Result.Opposite[2].dToolMarkLength ) OptionalParameters.dDepthToMachine = OppositeEdge1.dElevation + BeamData.CUT_EXTRA OptionalParameters.sSideToMachine = 'Start' Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * Mortising.dEdgeLength Chainsaw.AddResult( Mortising) OptionalParameters.sSideToMachine = 'End' Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters) + Mortising.dAreaToMachine = 0 Chainsaw.AddResult( Mortising) -- se lavorando solo da un lato rimane materiale residuo, si lavora da entrambi @@ -561,28 +575,32 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.dDepthToMachine = OppositeEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN OptionalParameters.sSideToMachine = 'Start' - OptionalParameters.dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Opposite[1].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * Mortising.dEdgeLength Chainsaw.AddResult( Mortising) OptionalParameters.sSideToMachine = 'End' - OptionalParameters.dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Opposite[1].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters) + Mortising.dAreaToMachine = 0 Chainsaw.AddResult( Mortising) OptionalParameters.dDepthToMachine = OppositeEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN OptionalParameters.sSideToMachine = 'Start' - OptionalParameters.dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Opposite[2].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge2, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * Mortising.dEdgeLength Chainsaw.AddResult( Mortising) OptionalParameters.sSideToMachine = 'End' - OptionalParameters.dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength + OptionalParameters.dLengthToMachine = Blade.Result.Opposite[2].dToolMarkLength Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge2, OptionalParameters) + Mortising.dAreaToMachine = 0 Chainsaw.AddResult( Mortising) end @@ -616,7 +634,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) -- sega a catena - lavorazioni raggruppate in unica lista Chainsaw.Result.Sorted = MergeResults( Chainsaw.Result) - -- sega a catena - calcolo completamento + -- sega a catena - calcolo area lavorata local dAreaToMachineChainsaw = GetTotalAreaToMachine( Chainsaw.Result.Sorted) -- sega a catena - aggiunta eventuali lavorazioni splittate @@ -655,12 +673,12 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) else Strategy.Result.sStatus = 'Not-Completed' end + Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( Result) + local dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Result) + Strategy.Result.dMRR = ( dFeatureVolume / dTimeToMachine) / pow( 10, 6) else - Strategy.Result.sStatus = 'Not-Applicable' + Strategy.Result = FeatureLib.GetStrategyResultNotApplicable() end - Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( Result) - local dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Result) - Strategy.Result.dMRR = ( dFeatureVolume / dTimeToMachine) / pow( 10, 6) return bAreAllMachiningsAdded, Strategy.Result end diff --git a/Strategies/Standard/STR0004/STR0004.lua b/Strategies/Standard/STR0004/STR0004.lua index f76ed32..7683c33 100644 --- a/Strategies/Standard/STR0004/STR0004.lua +++ b/Strategies/Standard/STR0004/STR0004.lua @@ -89,6 +89,18 @@ function Chainsaw.AddResult( Mortising) end +local function GetTotalAreaToMachine( Machinings) + local dTotalAreaToMachine = 0 + + for i = 1, #Machinings do + local Machining = Machinings[i] + dTotalAreaToMachine = dTotalAreaToMachine + Machining.dAreaToMachine + end + + return dTotalAreaToMachine +end + + function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} @@ -119,6 +131,9 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) if MachiningLib.CanExtendAfterTail( Strategy.Parameters.sCanDamageNextPiece, Part) then dExtendAfterTail = 10000 end + + -- volume della feature + local dFeatureVolume = FeatureLib.GetFeatureVolume( Proc, Part) -- eventuali punti di spezzatura local FeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part) @@ -167,8 +182,10 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) if BottomEdge.bIsStartOpen then Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) elseif BottomEdge.bIsEndOpen then Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) end Chainsaw.AddResult( Mortising) @@ -188,6 +205,7 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.bOppositeToolDirection = true Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) -- ancora materiale residuo - si lavora da entrambi i lati @@ -199,11 +217,13 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) OptionalParameters.dDepthToMachine = SideEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) OptionalParameters.dDepthToMachine = SideEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters) + Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine) Chainsaw.AddResult( Mortising) -- lavorando dai due lati non c'è materiale residuo - si può disabilitare la lavorazione del fondo @@ -266,13 +286,13 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) -- TODO aggiungere ordinamento per utensile table.sort( Chainsaw.Result.Sorted, SortMachiningsBySegment) + -- calcolo area lavorata + local dTotalAreaToMachine = GetTotalAreaToMachine( Chainsaw.Result.Sorted) + -- aggiunta lavorazioni - local nIsApplicableCount = 0 - local dFinalCompletionPercentage = 100 local bAreAllMachiningsAdded = true for i = 1, #Chainsaw.Result.Sorted do if Chainsaw.Result.Sorted[i].bIsApplicable then - nIsApplicableCount = nIsApplicableCount + 1 if bAddMachining then local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, Chainsaw.Result.Sorted[i]) if not bIsMachiningAdded then @@ -284,25 +304,20 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) end -- calcolo risultati - if nIsApplicableCount > 0 then + Strategy.Result.dCompletionPercentage = dTotalAreaToMachine / LongFace.dArea * 100 + Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( Strategy.Result.dCompletionPercentage) + if #Chainsaw.Result.Sorted > 0 then if Mortising.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then Strategy.Result.sStatus = 'Completed' else Strategy.Result.sStatus = 'Not-Completed' - -- TODO al momento si assume che la percentuale di completamento dell'ultima lavorazione sia quella rilevante - dFinalCompletionPercentage = Mortising.dCompletionPercentage end + Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( Chainsaw.Result.Sorted) + local dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Chainsaw.Result.Sorted) + Strategy.Result.dMRR = ( dFeatureVolume / dTimeToMachine) / pow( 10, 6) else - Strategy.Result.sStatus = 'Not-Applicable' + Strategy.Result = FeatureLib.GetStrategyResultNotApplicable() end - Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dFinalCompletionPercentage) - Strategy.Result.nQuality = TOOLS[Mortising.nToolIndex].nQuality - local MRRParametersChainsaw = { - dStep = min( TOOLS[Mortising.nToolIndex].dStep, SideEdge1.dLength), - dSideStep = TOOLS[Mortising.nToolIndex].dThickness, - dFeed = TOOLS[Mortising.nToolIndex].Feeds.dFeed} - local dMRRChainsaw = MachiningLib.GetToolMRR( MRRParametersChainsaw) - Strategy.Result.dMRR = dMRRChainsaw return bAreAllMachiningsAdded, Strategy.Result end diff --git a/StrategyLibs/BLADEKEEPWASTE.lua b/StrategyLibs/BLADEKEEPWASTE.lua index 3db9fdb..be9e2e5 100644 --- a/StrategyLibs/BLADEKEEPWASTE.lua +++ b/StrategyLibs/BLADEKEEPWASTE.lua @@ -224,9 +224,9 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters) if bFinishWithMill then for i = 1, #LongFaces do local dDepthToMachineMill = BottomFace.MainEdges.LongEdges[i].dElevation - dMillingOffsetFromSide - local dBladeMarkLength = max( Cutting1.dBladeMarkLength, Cutting2.dBladeMarkLength) + local dToolMarkLength = max( Cutting1.dToolMarkLength, Cutting2.dToolMarkLength) local OptionalParametersFaceByMill = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail, - dRadialStepSpan = dBladeMarkLength, dDepthToMachine = dDepthToMachineMill + dRadialStepSpan = dToolMarkLength, dDepthToMachine = dDepthToMachineMill } local Milling = FaceByMill.Make( Proc, Part, BottomFace, BottomFace.MainEdges.LongEdges[i], OptionalParametersFaceByMill) Milling.nInternalSortingPriority = 2 diff --git a/StrategyLibs/FACEBYBLADE.lua b/StrategyLibs/FACEBYBLADE.lua index 0040a91..aa25677 100644 --- a/StrategyLibs/FACEBYBLADE.lua +++ b/StrategyLibs/FACEBYBLADE.lua @@ -176,7 +176,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar Cutting.idProc = Proc.id Cutting.dResidualDepth = EdgeToMachine.dElevation Cutting.dCompletionPercentage = 0 - Cutting.dBladeMarkLength = 0 + Cutting.dToolMarkLength = 0 Cutting.sEdgeType = EdgeToMachine.sType Cutting.nFeatureSegment = 1 @@ -323,8 +323,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar end -- completamento Cutting.dCompletionPercentage = ( 1 - Cutting.dResidualDepth / Cutting.dDepthToMachine) * 100 - -- area lavorata - Cutting.dAreaToMachine = Cutting.dDepthToMachine * Cutting.dEdgeLength -- step verticale e offset longitudinale Cutting.Steps = MachiningLib.GetMachiningSteps( dPocketHeight, TOOLS[Cutting.nToolIndex].dThickness) Cutting.Steps.nStepType = MCH_MILL_ST.ONEWAY @@ -375,12 +373,14 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar Cutting.dLengthToMachineAllStepsWithLeadInOut = MachiningLib.GetLengthToMachineAllStepsWithLeadInOut( Cutting) -- lunghezza impronta lama if Cutting.bIsStartClosed and Cutting.bIsEndClosed then - Cutting.dBladeMarkLength = abs( min( Cutting.LeadIn.dStartAddLength, Cutting.LeadOut.dEndAddLength)) + Cutting.dToolMarkLength = abs( min( Cutting.LeadIn.dStartAddLength, Cutting.LeadOut.dEndAddLength)) elseif Cutting.bIsStartClosed then - Cutting.dBladeMarkLength = abs( Cutting.LeadIn.dStartAddLength) + Cutting.dToolMarkLength = abs( Cutting.LeadIn.dStartAddLength) elseif Cutting.bIsEndClosed then - Cutting.dBladeMarkLength = abs( Cutting.LeadOut.dEndAddLength) + Cutting.dToolMarkLength = abs( Cutting.LeadOut.dEndAddLength) end + -- area lavorata + Cutting.dAreaToMachine = min( EdgeToMachine.dElevation, Cutting.dDepthToMachine) * ( min( Cutting.dEdgeLength, Cutting.dLengthToMachine + 2 * Cutting.dToolMarkLength)) -- geometria Cutting.Geometry = {{Cutting.idProc, FaceToMachine.id}} -- note utente diff --git a/StrategyLibs/FACEBYCHAINSAW.lua b/StrategyLibs/FACEBYCHAINSAW.lua index 98d07b5..f062513 100644 --- a/StrategyLibs/FACEBYCHAINSAW.lua +++ b/StrategyLibs/FACEBYCHAINSAW.lua @@ -161,8 +161,6 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional end -- completamento Mortising.dCompletionPercentage = ( 1 - Mortising.dResidualDepth / Mortising.dDepthToMachine) * 100 - -- area lavorata - Mortising.dAreaToMachine = Mortising.dDepthToMachine * dLengthToMachine -- massima elevazione if dCustomMaxElev < Mortising.dDepthToMachine - 10 * GEO.EPS_SMALL then Mortising.dMaxElev = max( dCustomMaxElev, dCustomMaxElev - Mortising.dLongitudinalOffset) @@ -218,6 +216,8 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional Mortising.dLengthToMachine = Mortising.dEdgeLength + Mortising.LeadIn.dStartAddLength + Mortising.LeadOut.dEndAddLength Mortising.dLengthOnX = abs( dLengthToMachine * EdgeToMachine.vtN:getY()) Mortising.dLengthToMachineAllStepsWithLeadInOut = MachiningLib.GetLengthToMachineAllStepsWithLeadInOut( Mortising) + -- area lavorata + Mortising.dAreaToMachine = min( EdgeToMachine.dElevation, Mortising.dDepthToMachine) * ( min( Mortising.dEdgeLength, Mortising.dLengthToMachine + TOOLS[Mortising.nToolIndex].dDiameter)) -- geometria Mortising.Geometry = {{Proc.id, FaceToMachine.id}} -- nome operazione diff --git a/StrategyLibs/FACEBYMILL.lua b/StrategyLibs/FACEBYMILL.lua index cc170c0..48f2692 100644 --- a/StrategyLibs/FACEBYMILL.lua +++ b/StrategyLibs/FACEBYMILL.lua @@ -174,7 +174,7 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara Milling.idProc = Proc.id Milling.dResidualDepth = EdgeToMachine.dElevation Milling.dCompletionPercentage = 0 - Milling.dBladeMarkLength = 0 + Milling.dToolMarkLength = 0 Milling.sEdgeType = EdgeToMachine.sType Milling.nFeatureSegment = 1 @@ -324,8 +324,6 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara end -- completamento Milling.dCompletionPercentage = ( 1 - Milling.dResidualDepth / Milling.dDepthToMachine) * 100 - -- area lavorata - Milling.dAreaToMachine = Milling.dDepthToMachine * Milling.dEdgeLength -- step verticale e offset longitudinale if OptionalParameters.dPocketHeight then Milling.Steps = MachiningLib.GetMachiningSteps( dPocketHeight, TOOLS[Milling.nToolIndex].dMaxMaterial) @@ -384,12 +382,14 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara Milling.dLengthToMachineAllStepsWithLeadInOut = MachiningLib.GetLengthToMachineAllStepsWithLeadInOut( Milling) -- lunghezza impronta lama if Milling.bIsStartClosed and Milling.bIsEndClosed then - Milling.dBladeMarkLength = abs( min( Milling.LeadIn.dStartAddLength, Milling.LeadOut.dEndAddLength)) + Milling.dToolMarkLength = abs( min( Milling.LeadIn.dStartAddLength, Milling.LeadOut.dEndAddLength)) elseif Milling.bIsStartClosed then - Milling.dBladeMarkLength = abs( Milling.LeadIn.dStartAddLength) + Milling.dToolMarkLength = abs( Milling.LeadIn.dStartAddLength) elseif Milling.bIsEndClosed then - Milling.dBladeMarkLength = abs( Milling.LeadOut.dEndAddLength) + Milling.dToolMarkLength = abs( Milling.LeadOut.dEndAddLength) end + -- area lavorata + Milling.dAreaToMachine = min( EdgeToMachine.dElevation, Milling.dDepthToMachine) * ( min( Milling.dEdgeLength, Milling.dLengthToMachine + 2 * Milling.dToolMarkLength)) -- geometria Milling.Geometry = {{Milling.idProc, FaceToMachine.id}} -- note utente