From 9eeccf67a0236cb8c62af620f759399fba047d0e Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 19 May 2025 18:22:10 +0200 Subject: [PATCH] - RidgeLap usa strategia STR0012 solo se 3 facce; 1 o 2 passano dalle strategie standard - BasicCustomerStrategies e AvailableStrategies modificate di conseguenza - in STR0012 correzioni varie --- LuaLibs/BasicCustomerStrategies.lua | 24 ++++++++++++++++++++++-- LuaLibs/FeatureLib.lua | 8 ++++++++ Strategies/AvailableStrategyList.json | 14 +++++++++++++- Strategies/Standard/STR0012/STR0012.lua | 11 ++++++++--- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index e5ebe0f..e8e2676 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -115,7 +115,17 @@ local function GetStrategies_Egalware( Proc) --------------------------------------------------------------------- -- Feature : Ridge Lap (1-30) elseif ID.IsRidgeLap( Proc) then - Strategies = { { sStrategyId = 'STR0012'}} + if Proc.Topology.sName == 'RidgeLap-3-Through' then + Strategies = { { sStrategyId = 'STR0012'}} + elseif Proc.Topology.sName == 'Groove-3-Blind' then + Strategies = { { sStrategyId = 'STR0002'}} + elseif Proc.Topology.sName == 'Bevel-3-Blind' then + Strategies = { { sStrategyId = 'STR0002'}} + elseif Proc.Topology.sName == 'Rabbet-2-Through' then + Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0010'}} + elseif Proc.Topology.sName == 'Cut-1-Through' then + Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}} + end --------------------------------------------------------------------- -- Feature : Lap Joint (0-30) elseif ID.IsLapJoint( Proc) then @@ -427,7 +437,17 @@ local function GetStrategies_Essetre( Proc) --------------------------------------------------------------------- -- Feature : Ridge Lap (1-30) elseif ID.IsRidgeLap( Proc) then - Strategies = { { sStrategyId = 'STR0012'}} + if Proc.Topology.sName == 'RidgeLap-3-Through' then + Strategies = { { sStrategyId = 'STR0012'}} + elseif Proc.Topology.sName == 'Groove-3-Blind' then + Strategies = { { sStrategyId = 'STR0002'}} + elseif Proc.Topology.sName == 'Bevel-3-Blind' then + Strategies = { { sStrategyId = 'STR0002'}} + elseif Proc.Topology.sName == 'Rabbet-2-Through' then + Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0010'}} + elseif Proc.Topology.sName == 'Cut-1-Through' then + Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}} + end --------------------------------------------------------------------- -- Feature : Lap Joint (0-30) elseif ID.IsLapJoint( Proc) then diff --git a/LuaLibs/FeatureLib.lua b/LuaLibs/FeatureLib.lua index ae6e484..a43a8f9 100644 --- a/LuaLibs/FeatureLib.lua +++ b/LuaLibs/FeatureLib.lua @@ -80,6 +80,12 @@ function FeatureLib.NeedTopologyFeature( Proc) return true elseif ID.IsBlockHaus( Proc) then return true + elseif ID.IsRidgeLap( Proc) then + if Proc.nFct == 3 then + return false + else + return true + end end -- se feature non tra quelle sopra, riconoscimento topologico non necessario @@ -246,6 +252,8 @@ function FeatureLib.GetTopologyFromFeature( Proc, Part) elseif Proc.FeatureInfo.bIsMortiseThrough then Topology.sName = Topology.sName .. '-Through' end + elseif ID.IsRidgeLap( Proc) then + Topology.sName = 'RidgeLap-3-Through' else Topology.sName = 'FEATURE' end diff --git a/Strategies/AvailableStrategyList.json b/Strategies/AvailableStrategyList.json index 2eeb0f4..df18fae 100644 --- a/Strategies/AvailableStrategyList.json +++ b/Strategies/AvailableStrategyList.json @@ -131,8 +131,20 @@ "nPrc": "30", "nGrp": "1", "TopologyList" : [ - { "sName": "Feature", + { "sName": "RidgeLap-3-Through", "StrategyList" : [ { "sStrategyId": "STR0012"} ] + }, + { "sName": "Groove-3-Blind", + "StrategyList" : [ { "sStrategyID": "STR0002" } ] + }, + { "sName": "Bevel-3-Blind", + "StrategyList" : [ { "sStrategyID": "STR0002" } ] + }, + { "sName": "Rabbet-2-Through", + "StrategyList" : [ { "sStrategyID": "STR0002" }, { "sStrategyId": "STR0010"} ] + }, + { "sName": "Cut-1-Through", + "StrategyList" : [ { "sStrategyID": "STR0002" }, { "sStrategyID": "STR0005" } ] } ] }, diff --git a/Strategies/Standard/STR0012/STR0012.lua b/Strategies/Standard/STR0012/STR0012.lua index 26bbf26..08dde72 100644 --- a/Strategies/Standard/STR0012/STR0012.lua +++ b/Strategies/Standard/STR0012/STR0012.lua @@ -18,6 +18,9 @@ local RidgeLap = {} RidgeLap.Result = {} ------------------------------------------------------------------------------------------------------------- +-- TODO risolvere problemi calcolo volume nullo se facce rimosse +-- TODO gestire lavorazione con svuotatura +-- TODO risolvere problema ultimo cubetto troppo profondo!! 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 = {} @@ -39,9 +42,9 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) local dCompletionPercentageAddedFace = 0 local nQualityAddedFace = 0 - -- RidgeLap ha sempre 3 facce + -- gestito solo RidgeLap 3 facce if Proc.nFct ~= 3 then - Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( 'RidgeLap must have 3 faces') + Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( 'Only RidgeLap 3 faces is applicable') end -- estensione oltre la coda @@ -67,8 +70,10 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) -- rimozione della terza faccia dalla Proc local idNewProc = EgtCopyGlob( Proc.id, nAddGrpId) EgtSurfTmRemoveFacet( idNewProc, nAddedFace) + local OriginalProc = Proc Proc = FeatureLib.GetProcFromTrimesh( idNewProc, Part, Proc) + -- TODO rimuovere??? codolo da implementare o no?? -- considerazioni necessarie a determinare se lavorare con codolo oppure no local bKeepWasteAttached = ( Strategy.Parameters.sCuttingStrategy == 'KEEP_WASTE_ATTACHED') local bDropWaste = ( Strategy.Parameters.sCuttingStrategy == 'DROP_WASTE') @@ -148,7 +153,7 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) if RidgeLap.Result[i].bIsApplicable then nIsApplicableCount = nIsApplicableCount + 1 if bAddMachining then - local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, RidgeLap.Result[i]) + local bIsMachiningAdded = MachiningLib.AddMachinings( OriginalProc, RidgeLap.Result[i]) if not bIsMachiningAdded then bAreAllMachiningsAdded = false end