microstructpy.geometry.Cube¶
-
class
microstructpy.geometry.
Cube
(**kwargs)[source]¶ A cube.
This class contains a generic, 3D cube. It is derived from the
Box
and contains theside_length
property, rather than multiple side lengths.Without any parameters, this is a unit cube centered on the origin.
- 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.
-
plot
(**kwargs)¶ 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.
-
within
(points)¶ Test if points are within n-box.
This function tests whether a point or set of points are within the n-box. For the set of points, a list of booleans is returned to indicate which points are within the n-box.
- Parameters
points (list or numpy.ndarray) – Point or list of points.
- Returns
Flags set to True for points in geometry.
- Return type