- Prima versione file INI interfaccia selezione strategie Beam&Wall
- BeamLib : nuova funzione 'LoadCustomParametersInStrategy' - Piccoli aggiustamenti vari
This commit is contained in:
@@ -27,7 +27,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
if true or ID.IsHeadCut( Proc) then -- TODO TOGLIERE IL true PER FORZARE IF!!! PROVVISORIO PER PROVARE STRATEGIE
|
||||
if Proc.Topology.Name == 'FEATURE' then
|
||||
Strategy_Egalware = {
|
||||
StrategyId = 'STR0010',
|
||||
StrategyId = 'STR0001',
|
||||
Parameters = {
|
||||
{ Value = '15', Name = 'Step', Type = 'd'},
|
||||
{ Value = 'false', Name = 'AntiSplint', Type = 'b'}
|
||||
@@ -206,7 +206,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
if true or ID.IsHeadCut( Proc) then -- TODO TOGLIERE IL true PER FORZARE IF!!! PROVVISORIO PER PROVARE STRATEGIE
|
||||
if Proc.Topology.Name == 'FEATURE' then
|
||||
Strategy_Essetre = {
|
||||
StrategyId = 'STR0010',
|
||||
StrategyId = 'STR0001',
|
||||
Parameters = {
|
||||
{ Value = '15', Name = 'Step', Type = 'd'},
|
||||
{ Value = 'false', Name = 'AntiSplint', Type = 'b'}
|
||||
|
||||
@@ -496,7 +496,7 @@ local function CollectFeatures( PartId, Part)
|
||||
Proc.Topology = {}
|
||||
if FeatureData.NeedTopologyFeature( Proc) then
|
||||
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
|
||||
Proc.Faces = FaceData.GetFacesInfo( Proc)
|
||||
Proc.Faces = FaceData.GetFacesInfo( Proc, Part)
|
||||
Proc.Topology = FeatureData.ClassifyTopology( Proc, Part)
|
||||
else
|
||||
Proc.Topology.Family = 'FEATURE'
|
||||
|
||||
@@ -259,5 +259,23 @@ function BeamLib.GetUpdateCustomParameters( CustomStrategyParamList, DefaultStra
|
||||
return DefaultStrategyParamList
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- si traduce la tabella dei parametri con tutte le informazioni in una lista contenente i parametri utilizzabili con accesso diretto
|
||||
function BeamLib.LoadCustomParametersInStrategy( CustomParameters)
|
||||
local Parameters = {}
|
||||
if CustomParameters and #CustomParameters > 0 then
|
||||
for i=1, #CustomParameters do
|
||||
if CustomParameters[i].Type == 'b' then
|
||||
Parameters[CustomParameters[i].Name] = CustomParameters[i].Value == 'true'
|
||||
elseif CustomParameters[i].Type == 'd' then
|
||||
Parameters[CustomParameters[i].Name] = tonumber( CustomParameters[i].Value)
|
||||
else -- CustomParameters.Type == 's'
|
||||
Parameters[CustomParameters[i].Name] = CustomParameters[i].Value
|
||||
end
|
||||
end
|
||||
end
|
||||
return Parameters
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
|
||||
+13
-12
@@ -111,7 +111,7 @@ function FaceData.GetFacesByAdjacencyNumber( Proc)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function FaceData.GetFacesInfo( Proc)
|
||||
function FaceData.GetFacesInfo( Proc, Part)
|
||||
EgtOutLog( '---Faces START---')
|
||||
local Faces = {}
|
||||
|
||||
@@ -131,7 +131,7 @@ function FaceData.GetFacesInfo( Proc)
|
||||
Faces[i].Id = i - 1
|
||||
Faces[i].PtCenter, Faces[i].VtN = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
if Proc.Fct < 6 then
|
||||
local frHV, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1)
|
||||
local frHV, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1, Part)
|
||||
-- frame OCS faccia
|
||||
Faces[i].FrameHV = frHV
|
||||
-- larghezza OCS faccia
|
||||
@@ -216,19 +216,20 @@ local function GetBottomFace( Proc)
|
||||
|
||||
-- la faccia di fondo ha sempre Fct - 1 adiacenze. Se si trovano più facce di fondo si sceglie quella con minor elevazione
|
||||
local FacesByAdjacencyNumber = FaceData.GetFacesByAdjacencyNumber( Proc)
|
||||
local BottomFaces = FacesByAdjacencyNumber[ Proc.Fct - 1]
|
||||
if #BottomFaces > 1 then
|
||||
local dMinElevation = GEO.INFINITO
|
||||
for i = 1, #BottomFaces do
|
||||
if Proc.Faces[BottomFaces[i].Id + 1].Elevation < dMinElevation then
|
||||
dMinElevation = Proc.Faces[BottomFaces[i].Id + 1].Elevation
|
||||
BottomFace = Proc.Faces[BottomFaces[i].Id + 1]
|
||||
if FacesByAdjacencyNumber then
|
||||
local BottomFaces = FacesByAdjacencyNumber[ Proc.Fct - 1]
|
||||
if #BottomFaces > 1 then
|
||||
local dMinElevation = GEO.INFINITO
|
||||
for i = 1, #BottomFaces do
|
||||
if Proc.Faces[BottomFaces[i].Id + 1].Elevation < dMinElevation then
|
||||
dMinElevation = Proc.Faces[BottomFaces[i].Id + 1].Elevation
|
||||
BottomFace = Proc.Faces[BottomFaces[i].Id + 1]
|
||||
end
|
||||
end
|
||||
else
|
||||
BottomFace = BottomFaces[1]
|
||||
end
|
||||
else
|
||||
BottomFace = BottomFaces[1]
|
||||
end
|
||||
|
||||
return BottomFace
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user