From 66b273354eb67270c847c10fc86ee27bdb29254c Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 20 Oct 2025 10:33:35 +0200 Subject: [PATCH] =?UTF-8?q?Tagli=20testa=20e=20coda=20si=20riconoscono=20d?= =?UTF-8?q?a=20topologia=20e=20non=20pi=C3=B9=20da=20Prc=3D340/350?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BasicCustomerStrategies.lua | 24 ++++++------- LuaLibs/BeamExec.lua | 52 +++++++++------------------ LuaLibs/BeamLib.lua | 4 +-- LuaLibs/FeatureLib.lua | 7 +--- LuaLibs/Identity.lua | 12 ++----- Strategies/AvailableStrategyList.json | 3 ++ 6 files changed, 35 insertions(+), 67 deletions(-) diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index ebb9f66..7862b18 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -69,17 +69,17 @@ local function GetStrategies_Essetre( Proc) local Strategies = {} --------------------------------------------------------------------- - -- Feature : Cut (1-340) + -- Feature : Cut (1-10) if ID.IsHeadCut( Proc) then Strategies = { { sStrategyId = 'HEADCUT'}} --------------------------------------------------------------------- - -- Feature : Cut (2-350) + -- Feature : Cut (2-10) elseif ID.IsTailCut( Proc) then Strategies = { { sStrategyId = 'TAILCUT'}} --------------------------------------------------------------------- -- Feature : Cut (1-10) elseif ID.IsCut( Proc) then - if Proc.Topology.sName == 'Cut-1-Through' then + if Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'Bevel-1-Through' then Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}} elseif Proc.Topology.sName == 'HeadCut' then Strategies = { { sStrategyId = 'HEADCUT'}} @@ -444,17 +444,13 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) if ID.IsHeadCut( Proc) then -- Per Essetre non esiste il taglio di testa, quindi si leggono le variabili Q sul processing che coincide con il taglio di testa if sStrategyIdToGet == 'HEADCUT' then - -- eventuali informazioni da recuperare sulla feature sostituita - if Proc.SlaveProcIndexes then - local idSlaveProc = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nCurrentRotation][Proc.SlaveProcIndexes[1]].id - local dDepthChamfer = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q06', 'd') or 0 - table.insert( Parameters, { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'}) - local dCuttingStrategy = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q05', 'd') or 0 - local bForceChainSaw = dCuttingStrategy > 0 - table.insert( Parameters, { sName = 'bForceChainSaw', sValue = bForceChainSaw, sType = 'b'}) - local bFinishWithMill = dCuttingStrategy == 2 - table.insert( Parameters, { sName = 'bFinishWithMill', sValue = bFinishWithMill, sType = 'b'}) - end + local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q06', 'd') or 0 + table.insert( Parameters, { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'}) + local dCuttingStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q05', 'd') or 0 + local bForceChainSaw = dCuttingStrategy > 0 + table.insert( Parameters, { sName = 'bForceChainSaw', sValue = bForceChainSaw, sType = 'b'}) + local bFinishWithMill = dCuttingStrategy == 2 + table.insert( Parameters, { sName = 'bFinishWithMill', sValue = bFinishWithMill, sType = 'b'}) end --###---###---###---###---###---###---###---###---###---###---###---###---###-- -- Feature : Cut (1-10) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 09054ae..88c4b9d 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -586,24 +586,6 @@ local function GetFeatureForcedStrategy( Proc) return nil end -------------------------------------------------------------------------------------------------------------- -local function AdjustPrcGrp( Proc, bPartInCombiIsInverted) - local nNewPrc = { nPrc = Proc.nPrc, nGrp = Proc.nGrp} - - -- se pezzo invertito - if bPartInCombiIsInverted 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 @@ -632,8 +614,6 @@ 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 @@ -788,23 +768,23 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part) local ProcB = vProcSingleRot[j] -- non si controlla la feature con se stessa o se feature disabilitata if i ~= j and ProcB.nFlg ~= 0 then - -- verifico se il taglio può essere saltato perchè è nella stessa posizione del taglio di testa - if ID.IsHeadCut( Proc) and ProcB.Topology.sFamily == 'HeadCut' then - if not Proc.SlaveProcIndexes then - Proc.SlaveProcIndexes = {} - end - table.insert( Proc.SlaveProcIndexes, j) - ProcB.nIndexMasterProc = i - ProcB.nFlg = 0 + -- verifico se il taglio aggiunto manualmente può essere saltato perchè nella stessa posizione c'è un altro taglio di testa + if ID.IsHeadCut( Proc) and ( ID.IsHeadCut( ProcB) and EgtGetName( ProcB.id) == 'StartCut') then + if not Proc.SlaveProcIndexes then + Proc.SlaveProcIndexes = {} + end + table.insert( Proc.SlaveProcIndexes, j) + ProcB.nIndexMasterProc = i + ProcB.nFlg = 0 end - -- verifico se il taglio può essere saltato perchè è nella stessa posizione del taglio di coda - if ID.IsTailCut( Proc) and ProcB.Topology.sFamily == 'TailCut' then - if not Proc.SlaveProcIndexes then - Proc.SlaveProcIndexes = {} - end - table.insert( Proc.SlaveProcIndexes, j) - ProcB.nIndexMasterProc = i - ProcB.nFlg = 0 + -- verifico se il taglio aggiunto manualmente può essere saltato perchè nella stessa posizione c'è un altro taglio di coda + if ID.IsTailCut( Proc) and ( ID.IsTailCut( ProcB) and EgtGetName( ProcB.id) == 'EndCut') then + if not Proc.SlaveProcIndexes then + Proc.SlaveProcIndexes = {} + end + table.insert( Proc.SlaveProcIndexes, j) + ProcB.nIndexMasterProc = i + ProcB.nFlg = 0 end -- verifico se feature tipo LapJoint è attraversata da almeno un foro if ( Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Groove' or ID.IsMortise( Proc)) and diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index f3686ba..350a6e6 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -35,7 +35,7 @@ function BeamLib.AddPartStartFace( PartId, b3Solid) -- applico gli opportuni attributi di feature EgtSetName( nStmId, 'StartCut') EgtSetInfo( nStmId, 'GRP', 1) - EgtSetInfo( nStmId, 'PRC', 340) + EgtSetInfo( nStmId, 'PRC', 10) -- ex 340 return true end @@ -60,7 +60,7 @@ function BeamLib.AddPartEndFace( PartId, b3Solid) -- applico gli opportuni attributi di feature EgtSetName( nStmId, 'EndCut') EgtSetInfo( nStmId, 'GRP', 2) - EgtSetInfo( nStmId, 'PRC', 350) + EgtSetInfo( nStmId, 'PRC', 10) -- ex 350 return true end diff --git a/LuaLibs/FeatureLib.lua b/LuaLibs/FeatureLib.lua index f5c91fe..65533c3 100644 --- a/LuaLibs/FeatureLib.lua +++ b/LuaLibs/FeatureLib.lua @@ -53,13 +53,8 @@ end --------------------------------------------------------------------- -- recupero topologia della feature function FeatureLib.NeedTopologyFeature( Proc, Part) - -- feature Egalware con calcolo topologia SEMPRE da geometria - if ID.IsHeadCut( Proc) then -- (1-340) - return true - elseif ID.IsTailCut( Proc) then -- (2-350) - return true -- feature BTL con calcolo topologia SEMPRE da geometria - elseif ID.IsCut( Proc) then -- (1-10) + if ID.IsCut( Proc) then -- (1-10) return true elseif ID.IsLongitudinalCut( Proc) then -- (0-10) return true diff --git a/LuaLibs/Identity.lua b/LuaLibs/Identity.lua index d77691e..94ce9c8 100644 --- a/LuaLibs/Identity.lua +++ b/LuaLibs/Identity.lua @@ -6,22 +6,16 @@ local Identity = {} --------------------------------------------------------------------- ------------------------- EGALWARE FEATURES ------------------------ +------------------------ SPECIAL TOPOLOGY ------------------------- --------------------------------------------------------------------- -- Feature : Head Cut function Identity.IsHeadCut( Proc) - local bIdentity = ( Proc.nGrp == 1 and Proc.nPrc == 340) - local idPrc = 340 - local idGrp = 1 - return bIdentity, idPrc, idGrp + return Identity.IsCut( Proc) and Proc.Topology.sName == 'HeadCut' end --------------------------------------------------------------------- -- Feature : Tail Cut function Identity.IsTailCut( Proc) - local bIdentity = ( Proc.nGrp == 2 and Proc.nPrc == 350) - local idPrc = 350 - local idGrp = 2 - return bIdentity, idPrc, idGrp + return Identity.IsCut( Proc) and Proc.Topology.sName == 'TailCut' end --------------------------------------------------------------------- diff --git a/Strategies/AvailableStrategyList.json b/Strategies/AvailableStrategyList.json index 396510b..b98e6b8 100644 --- a/Strategies/AvailableStrategyList.json +++ b/Strategies/AvailableStrategyList.json @@ -8,6 +8,9 @@ { "sName": "Cut-1-Through", "StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ] }, + { "sName": "Bevel-1-Through", + "StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ] + }, { "sName": "HeadCut", "StrategyList" : [ { "sStrategyId": "HEADCUT" } ] },