microstructpy.geometry.n_box.NBox

class microstructpy.geometry.n_box.NBox(**kwargs)[source]

Bases: object

N-dimensional box

This class contains a generic, n-dimensinoal box.

Parameters
  • side_lengths (list) – (optional) Side lengths.

  • center (list) – (optional) Center of box.

  • corner (list) – (optional) Bottom-left corner.

  • bounds (list) – (optional) Bounds of box. Expected in the form [(xmin, xmax), (ymin, ymax), …].

  • limits – Alias for bounds.

  • matrix (list, numpy.ndarray) – (optional) Rotation matrix, nxn

within(points)[source]

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

bool or numpy.ndarray

property bounds

(lower, upper) bounds of the box

Type

list

property corner

bottom-left corner

Type

list

property limits

(lower, upper) bounds of the box

Type

list

property n_vol

area, volume of n-box

Type

float

property sample_limits

(lower, upper) bounds of the sampling region of the box

Type

list