microstructpy.geometry.box module

Box

This module contains the Box class.

class microstructpy.geometry.box.Box(**kwargs)[source]

Bases: microstructpy.geometry.n_box.NBox

This class contains a generic, 3D box. The position and dimensions of the box can be specified using any of the parameters below.

Parameters:
  • side_lengths (list, optional) – Side lengths.
  • center (list, optional) – Center of box.
  • corner (list, optional) – bottom-left corner.
  • limits (list, optional) – Bounds of box.
  • bounds (list, optional) – Alias for limits.
plot(**kwargs)[source]

Plot the box.

This function adds an mpl_toolkits.mplot3d.art3d.Poly3DCollection to the current axes. The keyword arguments are passed through to the Poly3DCollection.

Parameters:**kwargs (dict) – Keyword arguments for Poly3DCollection.
n_dim

number of dimensions, 3

Type:int
volume

volume of box, \(V=l_1 l_2 l_3\)

Type:float
class microstructpy.geometry.box.Cube(**kwargs)[source]

Bases: microstructpy.geometry.box.Box

A cube.

This class contains a generic, 3D cube. It is derived from the Box and contains the side_length property, rather than multiple side lengths.

Parameters:
  • side_length (float, optional) – Side length.
  • center (list, tuple, numpy.ndarray, optional) – Center of box.
  • corner (list, tuple, numpy.ndarray, optional) – bottom-left corner.
side_length

length of the side of the cube.

Type:float