pyvista.CubeFacesSource.explode_factor

pyvista.CubeFacesSource.explode_factor#

property CubeFacesSource.explode_factor: float | None[source]#

Push the faces away from (or pull them toward) the cube’s center.

If set, this is the factor by which to move each face. The magnitude of the move is relative to the smallest edge length of the cube, and all faces are moved by the same (constant) amount.

Note

  • A value of 0.0 has no effect.

  • Increasing positive values will push the faces farther away (explode).

  • Decreasing negative values will pull the faces closer together (implode).

This has a similar effect to using explode().

Examples

>>> import pyvista as pv
>>> cube_faces_source = pv.CubeFacesSource(
...     x_length=3, y_length=2, z_length=1, explode_factor=0.2
... )
>>> output = cube_faces_source.output
>>> output.plot(show_edges=True, line_width=10)
../../../_images/pyvista-CubeFacesSource-explode_factor-1_00_00.png

Note how all faces are moved by the same amount. Compare this to using explode() where the distance each face moves is relative to distance of each face to the center of the cube.

>>> exploded = pv.merge(output).explode(0.2)
>>> exploded.plot(show_edges=True, line_width=10)
../../../_images/pyvista-CubeFacesSource-explode_factor-1_01_00.png