USDInterface#

class ansys.tools.visualization_interface.backends.usd.usd_interface.USDInterface(title: str = 'USD Viewer', size: Tuple[int, int] = (750, 750))#

Bases: ansys.tools.visualization_interface.backends._base.BaseBackend

USD backend interface using python-usd-viewer.

Parameters:
titlestr, default: "USD Viewer"

Title of the viewer window.

sizetuple[int, int], default: (750, 750)

Width and height of the viewer window in pixels.

Overview#

add_points

Not implemented for the USD backend.

add_lines

Not implemented for the USD backend.

add_planes

Not implemented for the USD backend.

add_text

Not implemented for the USD backend.

add_labels

Not implemented for the USD backend.

clear

Not implemented for the USD backend.

plot

Add a plottable object to the USD stage.

plot_iter

Add all objects in an iterable to the USD stage.

show

Display the current USD stage in the viewer window.

Import detail#

from ansys.tools.visualization_interface.backends.usd.usd_interface import USDInterface

Method detail#

USDInterface.plot(plottable_object: Any, **plotting_options) None#

Add a plottable object to the USD stage.

Parameters:
plottable_objectAny

Supported types:

  • pxr.Usd.Stage — replaces the current stage.

  • str / pathlib.Path — USD files replace the current stage; VTK-compatible files are converted and merged into it.

  • MeshObjectPlot — the underlying PyVista mesh is converted and added.

  • Any PyVista or VTK dataset — converted via VTKConverter.

**plotting_optionsdict

Reserved for future backend-specific options.

USDInterface.plot_iter(plotting_list: Iterable) None#

Add all objects in an iterable to the USD stage.

USDInterface.show(plottable_object=None, screenshot=None, name_filter=None, **kwargs) None#

Display the current USD stage in the viewer window.

Opens the Qt-based USD viewer and starts the event loop. This call blocks until the window is closed.

Parameters:
plottable_objectAny, optional

Optional object to plot before showing.

screenshotstr, optional

Unused — screenshots are not supported by the USD backend.

name_filterstr, optional

Unused — name filtering is not supported by the USD backend.

**kwargsdict

Additional keyword arguments (unused).

abstractmethod USDInterface.add_points(points, color='red', size=10.0, **kwargs)#

Not implemented for the USD backend.

abstractmethod USDInterface.add_lines(points, connections=None, color='white', width=1.0, **kwargs)#

Not implemented for the USD backend.

abstractmethod USDInterface.add_planes(center=(0.0, 0.0, 0.0), normal=(0.0, 0.0, 1.0), i_size=1.0, j_size=1.0, **kwargs)#

Not implemented for the USD backend.

abstractmethod USDInterface.add_text(text, position, font_size=12, color='white', **kwargs)#

Not implemented for the USD backend.

abstractmethod USDInterface.add_labels(points, labels, font_size=12, point_size=5.0, **kwargs)#

Not implemented for the USD backend.

abstractmethod USDInterface.clear() None#

Not implemented for the USD backend.