Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/ansys/fluent/visualization/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ def add_graphics(
"""
self._list_of_positions.append(position)
if isinstance(graphics_obj._obj, GraphicsDefn):
locals()["object"] = locals().pop("graphics_obj")
self._graphics_objs.append({**locals()})
self._graphics_objs.append(
{
"object": graphics_obj,
"opacity": opacity,
"position": position,
"kwargs": kwargs,
}
)
else:
warnings.warn("Only graphics objects are supported.")

Expand All @@ -114,8 +120,14 @@ def add_plot(
"""
self._list_of_positions.append(position)
if isinstance(plot_obj._obj, PlotDefn):
locals()["object"] = locals().pop("plot_obj")
self._graphics_objs.append({**locals()})
self._graphics_objs.append(
{
"object": plot_obj,
"position": position,
"title": title,
"kwargs": kwargs,
}
)
else:
warnings.warn("Only 2D plot objects are supported.")

Expand Down