103x
005567
03.07.2024

Exporter la géométrie déformée

Comment exporter la géométrie déformée d’un modèle RFEM 6 ?


Réponse:

Vous pouvez exporter la géométrie déformée d’un modèle RFEM 6 en exportant le maillage déformé sous forme de fichier CSV à l’aide de l’interface du service Web et du script Python suivant :


#References
from RFEM.initModel import *
from RFEM import *
from RFEM.Results.meshTables import *
import pandas

#Establish connection to currently active model
connectToServer()
connectionGlobals.client.service.get_active_model()
Model(False,'')

#Query save directory and define name for csv files
path = input("Save directory for csv files:")
path = path.removeprefix("\"")
path = path.removesuffix("\"")

deformedNodesTableName = "deformed_nodes"
memberTableName = "members"
surfaceTableName = "surfaces"

#Read out deformed geometry
deformedNodes = pandas.DataFrame(MeshTables.GetAllFENodesDeformed())
deformedNodes = deformedNodes[["x", "y", "z"]]
deformedNodes.to_csv(path + "\\" + deformedNodesTableName + ".csv", index=False)

deformedMembersRaw = MeshTables.GetAllFE1DElements()
if(len(deformedMembersRaw) != 0):
    deformedMembers = pandas.DataFrame(deformedMembersRaw)
    deformedMembers = deformedMembers[["member_no","FE_node1_no", "FE_node2_no"]].astype(int)
    deformedMembers.to_csv(path + "\\" + memberTableName + ".csv", index=False)

deformedSurfacesRaw = MeshTables.GetAllFE2DElements()
if(len(deformedSurfacesRaw) != 0):
    deformedSurfaces = pandas.DataFrame(deformedSurfacesRaw)
    deformedSurfaces = deformedSurfaces[["surface_no","FE_node1_no", "FE_node2_no", "FE_node3_no", "FE_node4_no"]].astype(int)
    deformedSurfaces.to_csv(path + "\\" + surfaceTableName + ".csv", index=False)

Auteur

M. Gutmann est responsable du support client chez Dlubal Software.



;