visualization.system.utils
Visualization Utilities Module
This module contains utility functions for visualization tasks.
Kramer Harrison, 2024
Functions
|
Revolves a contour defined by the input points (x, y, z) around the z-axis to create a 3D surface and returns the corresponding VTK actor. |
|
Transforms the coordinates (x, y, z) based on the surface geometry. |
|
Applies the effective rotation and translation of a surface to an actor. |
- revolve_contour(x, y, z)[source]
Revolves a contour defined by the input points (x, y, z) around the z-axis to create a 3D surface and returns the corresponding VTK actor.
- Parameters:
x (list of float) – List of x-coordinates of the contour points.
y (list of float) – List of y-coordinates of the contour points.
z (list of float) – List of z-coordinates of the contour points.
- Returns:
VTK actor representing the revolved 3D surface.
- Return type:
vtk.vtkActor
- transform(x, y, z, surface, is_global=True)[source]
Transforms the coordinates (x, y, z) based on the surface geometry.
- Parameters:
x (numpy.ndarray) – The x-coordinates of the points.
y (numpy.ndarray) – The y-coordinates of the points.
z (numpy.ndarray) – The z-coordinates of the points.
surface (Surface) – The surface object that contains the geometry for transformation.
is_global (bool, optional) – If True, localize the points to the surface geometry. If False, globalize the points. Defaults to True.
- Returns:
Transformed x, y, and z coordinates as numpy arrays.
- Return type:
tuple
- transform_3d(actor, surface)[source]
Applies the effective rotation and translation of a surface to an actor.
- Parameters:
actor – The actor to be transformed. This is typically an instance of a VTK actor.
surface – The surface whose transformation will be applied to the actor.
- Returns:
The transformed actor with the applied rotation and translation.