diff --git a/Strategies/Standard/STR0005/STR0005.json b/Strategies/Standard/STR0005/STR0005.json index 0064e6b..d08cff3 100644 --- a/Strategies/Standard/STR0005/STR0005.json +++ b/Strategies/Standard/STR0005/STR0005.json @@ -110,6 +110,16 @@ "sMessageId": " ", "sMinUserLevel": "1" }, + { + "sName": "bAllowFastCuts", + "sNameNge": "ALLOW_FAST_CUTS", + "sValue": "false", + "sDescriptionShort": "Prioritize machining speed over quality", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, { "sName": "bReduceBladePath", "sNameNge": "REDUCE_BLADE_PATH", diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 554fd6d..3af108c 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -140,6 +140,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) dMaxNyTopBlade = dMaxNyTopBlade, bSaveAddedGeometries = bAddMachining, dExtendAfterTail = dExtendAfterTail, + bAllowFastCuts = Strategy.Parameters.bAllowFastCuts, bReduceBladePath = Strategy.Parameters.bReduceBladePath, bDisableDicing = Strategy.Parameters.bDisableDicing } diff --git a/Strategies/Standard/STR0012/STR0012.lua b/Strategies/Standard/STR0012/STR0012.lua index 48e73a1..8894984 100644 --- a/Strategies/Standard/STR0012/STR0012.lua +++ b/Strategies/Standard/STR0012/STR0012.lua @@ -21,6 +21,7 @@ RidgeLap.Result = {} -- TODO risolvere problemi calcolo volume nullo se facce rimosse -- TODO gestire lavorazione con svuotatura -- TODO risolvere problema ultimo cubetto troppo profondo!! +-- TODO gestire strategia con fresa function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} diff --git a/StrategyLibs/BLADETOWASTE.lua b/StrategyLibs/BLADETOWASTE.lua index 00f9df3..a19fa79 100644 --- a/StrategyLibs/BLADETOWASTE.lua +++ b/StrategyLibs/BLADETOWASTE.lua @@ -204,7 +204,7 @@ local function CompareEdgesNoPreference( EdgeA, EdgeB) end -local function GetEdgeToMachine( Edges, vtNFace, sBladeType) +local function GetEdgeToMachine( Edges, vtNFace, sBladeType, bAllowFastCuts) local EdgeToMachine = {} local EdgesSorted = {} @@ -213,7 +213,11 @@ local function GetEdgeToMachine( Edges, vtNFace, sBladeType) end if ( sBladeType == 'Top') then - table.sort( EdgesSorted, CompareEdgesTopHead) + if bAllowFastCuts then + table.sort( EdgesSorted, CompareEdgesNoPreference) + else + table.sort( EdgesSorted, CompareEdgesTopHead) + end EdgeToMachine = EdgesSorted[1] elseif sBladeType == 'Bottom' then table.sort( EdgesSorted, CompareEdgesBottomHead) @@ -369,15 +373,16 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters) OptionalParameters = OptionalParameters or {} local nToolIndex = OptionalParameters.nToolIndex local bReduceBladePath = OptionalParameters.bReduceBladePath or false + local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1] -- lati da lavorare in base al tipo di lama -- se non arrivano dall'esterno si cercano i migliori disponibili local EdgeToMachineList = OptionalParameters.EdgeToMachineList or { - Top = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'Top'), - Bottom = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'Bottom'), - TopDownUp = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'TopDownUp'), - TopGuillotine = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'TopGuillotine') + Top = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'Top', bAllowFastCuts), + Bottom = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'Bottom', bAllowFastCuts), + TopDownUp = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'TopDownUp', bAllowFastCuts), + TopGuillotine = GetEdgeToMachine( FaceToMachine.Edges, FaceToMachine.vtN, 'TopGuillotine', bAllowFastCuts) } local sChosenBladeType