add_planes#
- PrimePlotter.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)#
Add a plane to the scene.
This method provides a backend-agnostic way to add plane objects to the visualization scene. Planes are useful for showing reference planes, symmetry planes, or cutting planes.
- Parameters:
- center
Tuple[float,float,float], default: (0.0, 0.0, 0.0) Center point of the plane in 3D space (x, y, z).
- normal
Tuple[float,float,float], default: (0.0, 0.0, 1.0) Normal vector of the plane (x, y, z). The vector will be normalized by the backend if needed.
- i_size
float, default: 1.0 Size of the plane in the i direction (local coordinate system).
- j_size
float, default: 1.0 Size of the plane in the j direction (local coordinate system).
- **kwargs
dict Additional backend-specific keyword arguments for advanced customization (e.g., color, opacity, resolution).
- center
- Returns:
- :
AnyBackend-specific actor or object representing the added plane. Can be used for further manipulation or removal.
- Return type:
Examples
Add a horizontal plane at z=0:
>>> from ansys.tools.visualization_interface import Plotter >>> plotter = Plotter() >>> plotter.add_planes(center=(0, 0, 0), normal=(0, 0, 1), i_size=2.0, j_size=2.0) >>> plotter.show()
Add a vertical plane with custom styling:
>>> plotter.add_planes( ... center=(1, 0, 0), ... normal=(1, 0, 0), ... i_size=3.0, ... j_size=3.0, ... color='lightblue', ... opacity=0.5 ... ) >>> plotter.show()