Lattice#
- class blueprints.Lattice[source]#
Bases:
LatticeTypeA Lattice is constructed from a Thing, a set of directions or axes and the number of repetitions. Lattices are not mujoco objects but blueprints utility.
Attributes Summary
The number of dimensions in the Lattice
Methods Summary
copy(**kwargs)lattice(directions, repetitions[, name])A Lattice created with the parent Lattice as its content Thing (see examples above).
locate([pos, x, y, z])This method creates a copy that is relocated to
pos.shift([pos, x, y, z])This method creates a copy that is shifted by
pos.Attributes Documentation
- n_dim#
The number of dimensions in the Lattice
- Return type:
int
Methods Documentation
- copy(**kwargs)[source]#
- Parameters:
kwargs (
dict) – The keyword arguments are passed to the individual component Things copy method.- Returns:
A fresh copy of the Lattice
- Return type:
blue.LatticeType
- lattice(directions, repetitions, name=None)[source]#
A Lattice created with the parent Lattice as its content Thing (see examples above).
- Return type:
blue.LatticeType- Parameters:
directions (list[float | int] | ndarray | list[list[int | float]] | list[ndarray])
repetitions (int | list[int] | ndarray)
name (str | None)
- locate(pos=None, x=None, y=None, z=None, **kwargs)[source]#
This method creates a copy that is relocated to
pos.- Parameters:
pos (
list[int | float] | np.ndarray | blue.MoveableThingType | None) – The position to which the Thing is shifted, optionally anotherMoveableThingcan be passed in which case the position of this Thing is taken.globally (
bool, optional) – Determining whether the relocation is relative to the local orientation or the global orientation.x (
int | float | np.int32 | np.int64 | np.float32 | np.float64 | None) – This argument can be set if just the X component of the position is to be changed.y (
int | float | np.int32 | np.int64 | np.float32 | np.float64 | None) – This argument can be set if just the Y component of the position is to be changed.z (
int | float | np.int32 | np.int64 | np.float32 | np.float64 | None) – This argument can be set if just the Z component of the position is to be changed.**kwargs – Keyword arguments are passed to
copy().
- Returns:
A relocated copy is returned.
- Return type:
blue.LatticeType
- shift(pos=None, x=None, y=None, z=None, **kwargs)[source]#
This method creates a copy that is shifted by
pos.- Parameters:
pos (
list[int | float] | np.ndarray | blue.MoveableThingType | None) – The amount by which the Thing is shifted, optionally anotherMoveableThingcan be passed in which case the position of this Thing is taken.globally (
bool, optional) – Determining whether the shift is relative to the local orientation or the global orientation.x (
int | float | np.int32 | np.int64 | np.float32 | np.float64 | None) – This argument can be set if just the X component of the position is to be changed.y (
int | float | np.int32 | np.int64 | np.float32 | np.float64 | None) – This argument can be set if just the Y component of the position is to be changed.z (
int | float | np.int32 | np.int64 | np.float32 | np.float64 | None) – This argument can be set if just the Z component of the position is to be changed.**kwargs – Keyword arguments are passed to the
copy().
- Returns:
A shifted copy is returned.
- Return type:
blue.LatticeType
- __init__(thing, directions, repetitions, name=None)[source]#
- Parameters:
thing (
blue.MoveableThingType | blue.LatticeType) – This Thing will consitute the content of the Latticedirections (
list [ float | int ] | np.ndarray | list [ list [ int | float ] ] | list [ np.ndarray ]) – A list of axes pointing into the directions of the Lattice.repetitions (
int | list [ int ] | np.ndarray) – A list of repetitions for each axis with the same length asdirectionsname (
str | None) – The name of the Lattice (used for displaying purposes).
- Return type:
None
- classmethod __new__(*args, **kwargs)#