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 ---------------------------------------------------------------------