pyvista.Plotter.add_floor#
- Plotter.add_floor(
- face='-z',
- i_resolution=10,
- j_resolution=10,
- color=None,
- line_width=None,
- opacity=1.0,
- show_edges=False,
- lighting=False,
- edge_color=None,
- reset_camera=None,
- pad=0.0,
- offset=0.0,
- pickable=False,
- store_floor_kwargs=True,
Show a floor mesh.
This generates planes at the boundaries of the scene to behave like floors or walls.
- Parameters:
- face
str
, default: “-z” The face at which to place the plane. Options are (
'-z'
,'-y'
,'-x'
,'+z'
,'+y'
, and'+z'
). Where the-/+
sign indicates on which side of the axis the plane will lie. For example,'-z'
would generate a floor on the XY-plane and the bottom of the scene (minimum z).- i_resolution
int
, default: 10 Number of points on the plane in the i direction.
- j_resolution
int
, default: 10 Number of points on the plane in the j direction.
- color
ColorLike
,optional
Color of all labels and axis titles. Default gray. Either a string, rgb list, or hex color string.
- line_width
int
,optional
Thickness of the edges. Only if
show_edges
isTrue
.- opacity
float
, default: 1.0 The opacity of the generated surface.
- show_edgesbool, default:
False
Flag on whether to show the mesh edges for tiling.
- line_width
float
, default:False
Thickness of lines. Only valid for wireframe and surface representations.
- lightingbool, default:
False
Enable or disable view direction lighting.
- edge_color
ColorLike
,optional
Color of the edges of the mesh.
- reset_camerabool,
optional
Resets the camera when
True
after adding the floor.- pad
float
, default: 0.0 Percentage padding between 0 and 1.
- offset
float
, default: 0.0 Percentage offset along plane normal.
- pickablebool, default:
False
Make this floor actor pickable in the renderer.
- store_floor_kwargsbool, default:
True
Stores the keyword arguments used when adding this floor. Useful when updating the bounds and regenerating the floor.
- face
- Returns:
vtk.vtkActor
VTK actor of the floor.
Examples
Add a floor below a sphere and plot it.
>>> import pyvista as pv >>> pl = pv.Plotter() >>> actor = pl.add_mesh(pv.Sphere()) >>> actor = pl.add_floor() >>> pl.show()