I want to create a plot like this: Where the mesh not associated with the results is translucent or trans parent.
All I can get with DPFPlotter is this:
It should not be so difficult to plot results scoped to a named selection
@Jim Kosloski You will need to add the other mesh as a separate object, then set the opacity. This method however will get one layer of elements attached to the nodes as opaque. Not sure if we can get rid of that as well.
from ansys.dpf import core as dpf from ansys.dpf.core.plotter import DpfPlotter dpf.start_local_server(ansys_path=r"C:\Program Files\ANSYS Inc\v252") rst = r"D:\…\file.rst" ds = dpf.DataSources(rst) model = dpf.Model(ds) mesh = model.metadata.meshed_region # Get Mesh Scoping ns = dpf.operators.scoping.on_named_selection(named_selection_name="FACES") ns.inputs.data_sources.connect(ds) my_mesh_scoping = ns.outputs.mesh_scoping() # Get Mesh from Scoping mesh_ns = dpf.operators.mesh.from_scoping(scoping=my_mesh_scoping, mesh=model.metadata.meshed_region) mesh_ns_out = mesh_ns.outputs.mesh.get_data() # Displacement Field disp = dpf.operators.result.displacement_X(data_sources=ds, mesh_scoping=my_mesh_scoping) disp_f = disp.outputs.fields_container.get_data()[0] # Plot results plot = DpfPlotter() plot.add_mesh(mesh, opacity=0.3) plot.add_field(disp_f, meshed_region=mesh_ns_out) plot.show_figure(show_axes=True)
@Jim Kosloski
Another idea is to create shell elements from the nodes and plot results on that meshed region. Add the original mesh with the opacity argument.