diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 98d3976..45b5c4b 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -239,7 +239,7 @@ elseif BEAM.FLAG == 9 then Proc.nPrc = EgtGetInfo( Proc.id, 'PRC', 'i') Proc.Topology = {} - if FeatureLib.NeedTopologyFeature( Proc) then + if FeatureLib.NeedTopologyFeature( Proc, Part) then Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part) else Proc = FeatureLib.GetAdditionalInfo( Proc, Part) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 88e3414..5bb8f3c 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -647,7 +647,7 @@ local function CollectFeatures( Part, dRotIndex) Proc.AffectedFaces = BeamLib.GetAffectedFaces( Proc, Part) -- calcolo topologia solo se necessario, altrimenti si sfruttano le informazioni della feature BTL local bIsFeatureReadyForProcessing = false - if FeatureLib.NeedTopologyFeature( Proc) then + if FeatureLib.NeedTopologyFeature( Proc, Part) then Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc) Proc.Faces = FaceData.GetFacesInfo( Proc, Part) Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part) diff --git a/LuaLibs/FeatureLib.lua b/LuaLibs/FeatureLib.lua index 178cb25..fcda380 100644 --- a/LuaLibs/FeatureLib.lua +++ b/LuaLibs/FeatureLib.lua @@ -37,9 +37,22 @@ function FeatureLib.GetProcFromTrimesh( idTrimesh, Part, ProcToCopyFrom) return Proc end +------------------------------------------------------------------------------------------------------------- +-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra +local function IsFeatureCuttingEntireSection( b3Proc, Part) + return ( b3Proc:getDimY() > ( Part.b3Part:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.b3Part:getDimZ() - 500 * GEO.EPS_SMALL)) +end + +------------------------------------------------------------------------------------------------------------- +-- restituisce vero se la feature con box b3Proc taglia l'intera lunghezza della barra +local function IsFeatureCuttingEntireLength( b3Proc, Part) + return ( ( b3Proc:getDimY() > ( Part.b3Part:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Part:getDimX() - 500 * GEO.EPS_SMALL)) or + ( b3Proc:getDimZ() > ( Part.b3Part:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Part:getDimX() - 500 * GEO.EPS_SMALL))) +end + --------------------------------------------------------------------- -- recupero topologia della feature -function FeatureLib.NeedTopologyFeature( Proc) +function FeatureLib.NeedTopologyFeature( Proc, Part) -- feature Egalware con calcolo topologia SEMPRE da geometria if ID.IsHeadCut( Proc) then -- (1-340) return true @@ -54,8 +67,6 @@ function FeatureLib.NeedTopologyFeature( Proc) return true elseif ID.IsDoubleLongitudinalCut( Proc) then -- (0-12) return true - elseif ID.IsSawCut( Proc) then -- (0-13) - return true elseif ID.IsSlot( Proc) then -- (1-16) return true elseif ID.IsFrontSlot( Proc) then -- (1-17) @@ -79,6 +90,10 @@ function FeatureLib.NeedTopologyFeature( Proc) elseif ID.IsStepJointNotch( Proc) then -- (0-80) return true -- feature con calcolo topologia da geometria SOLO se rispettano certe condizioni, altrimenti riconoscimento specifico + elseif ID.IsSawCut( Proc) and Proc.nFct == 1 + and ( IsFeatureCuttingEntireSection( Proc.b3Box, Part) + or IsFeatureCuttingEntireLength( Proc.b3Box, Part)) then -- (0-13) + return true elseif ID.IsHipValleyRafterNotch( Proc) and Proc.nFct < 4 then -- (0-25) return true elseif ID.IsRidgeLap( Proc) and Proc.nFct ~= 3 then -- (1-30) @@ -139,19 +154,6 @@ local function IsAnyDimensionLongAsPart( Proc, Part) return bResult end -------------------------------------------------------------------------------------------------------------- --- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra -local function IsFeatureCuttingEntireSection( b3Proc, Part) - return ( b3Proc:getDimY() > ( Part.b3Part:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.b3Part:getDimZ() - 500 * GEO.EPS_SMALL)) -end - -------------------------------------------------------------------------------------------------------------- --- restituisce vero se la feature con box b3Proc taglia l'intera lunghezza della barra -local function IsFeatureCuttingEntireLength( b3Proc, Part) - return ( ( b3Proc:getDimY() > ( Part.b3Part:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Part:getDimX() - 500 * GEO.EPS_SMALL)) or - ( b3Proc:getDimZ() > ( Part.b3Part:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Part:getDimX() - 500 * GEO.EPS_SMALL))) -end - --------------------------------------------------------------------- -- restituisce una stringa con il nome esteso della topologia della feature -- *famiglia - numero di facce - passante* diff --git a/Strategies/AvailableStrategyList.json b/Strategies/AvailableStrategyList.json index 885806c..e549f76 100644 --- a/Strategies/AvailableStrategyList.json +++ b/Strategies/AvailableStrategyList.json @@ -46,7 +46,7 @@ "nGrp": 0, "TopologyList" : [ { "sName": "Feature", - "StrategyList" : [ ] + "StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010" } ] } ] },