pyvista.Renderer.add_floor#

Renderer.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,
)[source]#

Show a floor mesh.

This generates planes at the boundaries of the scene to behave like floors or walls.

Parameters:
facestr, 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_resolutionint, default: 10

Number of points on the plane in the i direction.

j_resolutionint, default: 10

Number of points on the plane in the j direction.

colorColorLike, optional

Color of all labels and axis titles. Default gray. Either a string, rgb list, or hex color string.

line_widthint, optional

Thickness of the edges. Only if show_edges is True.

opacityfloat, default: 1.0

The opacity of the generated surface.

show_edgesbool, default: False

Flag on whether to show the mesh edges for tiling.

line_widthfloat, default: False

Thickness of lines. Only valid for wireframe and surface representations.

lightingbool, default: False

Enable or disable view direction lighting.

edge_colorColorLike, optional

Color of the edges of the mesh.

reset_camerabool, optional

Resets the camera when True after adding the floor.

padfloat, default: 0.0

Percentage padding between 0 and 1.

offsetfloat, 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.

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()
../../../_images/pyvista-Renderer-add_floor-1_00_00.png