File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 77class BoundingBox :
88 def __init__ (
99 self ,
10- dimensions : int = 3 ,
1110 origin : Optional [np .ndarray ] = None ,
1211 maximum : Optional [np .ndarray ] = None ,
1312 nsteps : Optional [np .ndarray ] = None ,
13+ step_vector : Optional [np .ndarray ] = None ,
14+ dimensions : int = 3 ,
1415 ):
1516 """A bounding box for a model, defined by the
1617 origin, maximum and number of steps in each direction
@@ -26,6 +27,14 @@ def __init__(
2627 nsteps : Optional[np.ndarray], optional
2728 _description_, by default None
2829 """
30+ if origin is None :
31+ raise LoopValueError ("Origin is not set" )
32+ if maximum is None and nsteps is not None and step_vector is not None :
33+ maximum = origin + nsteps * step_vector
34+ if maximum is None :
35+ raise LoopValueError (
36+ "Maximum is not set, either specify nsteps and step vector or maximum"
37+ )
2938 self ._origin = np .array (origin )
3039 self ._maximum = np .array (maximum )
3140 self .dimensions = dimensions
You can’t perform that action at this time.
0 commit comments