From cfc2260997a0720b841e52c61513497aa7cb6e2a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Sat, 17 May 2025 11:13:53 +0200 Subject: [PATCH] =?UTF-8?q?-=20in=20BatchProcessNew=20aggiunto=20flag=207?= =?UTF-8?q?=20per=20la=20restituzione=20della=20topologia=20-=20in=20Featu?= =?UTF-8?q?reLib=20IsFeatureCuttingEntireSection=20e=20IsFeatureCuttingEnt?= =?UTF-8?q?ireLength=20se=20non=20c'=C3=A8=20il=20box=20del=20grezzo=20si?= =?UTF-8?q?=20usa=20quello=20della=20parte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BatchProcessNew.lua | 33 +++++++++++++++++++++++++++++++++ LuaLibs/FeatureLib.lua | 8 +++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 8a18c61..8c7b163 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -88,6 +88,7 @@ local BeamData = require( 'BeamData') -- carico librerie local BeamExec = require( 'BeamExec') local BeamLib = require( 'BeamLib') +local FeatureLib = require( 'FeatureLib') -- Variabili di modulo local dRawW @@ -173,6 +174,8 @@ elseif BEAM.FLAG == 4 then sFlag = 'CHECK+GENERATE' elseif BEAM.FLAG == 6 then sFlag = 'CREATE_BAR' +elseif BEAM.FLAG == 7 then + sFlag = 'GET_TOPOLOGY' else sFlag = 'FLAG='..tostring( BEAM.FLAG) end @@ -198,7 +201,37 @@ if BEAM.FLAG == 0 then end hLogFile:close() end +-- restituisce all'interfaccia il nome della topologia della feature di id passato +-- TODO valutare se fare script separato +-- TODO gestire grezzo altrimenti la topologia potrebbe essere errata!! +elseif BEAM.FLAG == 7 then + if type( BEAM.FEATUREID) == 'number' then + local Proc = FeatureLib.GetProcFromTrimesh( BEAM.FEATUREID) + Proc.nGrp = nGrp + Proc.nPrc = nPrc + + local Part = {} + Part.id = EgtGetParent( Proc.id) + Part.b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Part.id, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) + + Proc.Topology = {} + if FeatureLib.NeedTopologyFeature( Proc) then + Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part) + else + Proc = FeatureLib.GetAdditionalInfo( Proc, Part) + Proc.Topology = FeatureLib.GetTopologyFromFeature( Proc, Part) + end + + if Proc.Topology and Proc.Topology.sName then + BEAM.TOPOLOGY = Proc.Topology.sName + else + BEAM.TOPOLOGY = 'NOT_IMPLEMENTED' + end + else + return + end end + -- Cancello file di log specifico EgtEraseFile( sTxtLogFile) diff --git a/LuaLibs/FeatureLib.lua b/LuaLibs/FeatureLib.lua index 88e806d..719140b 100644 --- a/LuaLibs/FeatureLib.lua +++ b/LuaLibs/FeatureLib.lua @@ -137,14 +137,16 @@ end ------------------------------------------------------------------------------------------------------------- -- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H local function IsFeatureCuttingEntireSection( b3Proc, Part) - return ( b3Proc:getDimY() > ( Part.b3Raw:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.b3Raw:getDimZ() - 500 * GEO.EPS_SMALL)) + local b3RawOrPart = Part.b3Raw or Part.b3Part + return ( b3Proc:getDimY() > ( b3RawOrPart:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( b3RawOrPart:getDimZ() - 500 * GEO.EPS_SMALL)) end ------------------------------------------------------------------------------------------------------------- -- restituisce vero se la feature con box b3Proc taglia l'intera lunghezza della barra, rappresentata dalle sue dimensioni W e L oppure H e L local function IsFeatureCuttingEntireLength( b3Proc, Part) - return ( ( b3Proc:getDimY() > ( Part.b3Raw:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Raw:getDimX() - 500 * GEO.EPS_SMALL)) or - ( b3Proc:getDimZ() > ( Part.b3Raw:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Raw:getDimX() - 500 * GEO.EPS_SMALL))) + local b3RawOrPart = Part.b3Raw or Part.b3Part + return ( ( b3Proc:getDimY() > ( b3RawOrPart:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( b3RawOrPart:getDimX() - 500 * GEO.EPS_SMALL)) or + ( b3Proc:getDimZ() > ( b3RawOrPart:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( b3RawOrPart:getDimX() - 500 * GEO.EPS_SMALL))) end ---------------------------------------------------------------------