-
|
Hi everyone, I’m currently working on a project where I’d like to export the mesh for multiple objects in an HFSS design — ideally in a way that allows me to separate them afterward. The goal is to extract the nodes, vertices, and other mesh data for each object individually so that I can reconstruct the geometry independently and assign additional properties (such as materials) to each node. To illustrate what I mean, here’s a workaround I implemented. It iterates through all 3D objects, hides everything except one at a time, generates a mesh for that single object, and exports it separately. After exporting, I parse the mesh data using the internal pyvista._parse_aedtplt function to extract vertices and faces for visualization. This approach works, but it’s quite inefficient since it requires re-meshing and exporting for each object separately. Is there a PyAEDT or PyAnsys function that can directly export the mesh for multiple objects (or provide per-object mesh data) without having to isolate and re-mesh each one individually? Any pointers or best practices for achieving this more efficiently would be greatly appreciated! Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
Hi @ptrem , Thanks for opening this issue. Thanks, Giulia |
Beta Was this translation helpful? Give feedback.
-
|
@ptrem or another thing I could also suggest is to use the plot_field() method instead. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ptrem, We were thinking of a couple of workarounds while there's no solution available, although they require a certain amount of effort: You can keep exporting a .case file x object and then merge them with PyVista and load them individually and visualize together in a PyVista Plotter. The add_mesh method accepts a label argument which can be used as an identifier of the object (ID). Something like: p = pv.Plotter() Kind regards, Giulia |
Beta Was this translation helpful? Give feedback.
-
|
@ptrem you could use both the export_field_plot or the plot_field method to export the initial .case file and then try one of the workarounds I suggested. |
Beta Was this translation helpful? Give feedback.
Hi @ptrem,
We were thinking of a couple of workarounds while there's no solution available, although they require a certain amount of effort:
You can keep exporting a .case file x object and then merge them with PyVista and load them individually and visualize together in a PyVista Plotter. The add_mesh method accepts a label argument which can be used as an identifier of the object (ID). Something like:
files = ["part1.case", "part2.case", "part3.case"]
meshes = [pv.read(f) for f in files]
p = pv.Plotter()
for i, m in enumerate(meshes):
p.add_mesh(m, label=f"Part {i+1}")
You could rely on PyVista and intersect the case field data with the objs and get mesh obj x obj.
Hope this helps,
Kin…