fibomat.layout.lattices.dim_lattice module¶
- class fibomat.layout.lattices.dim_lattice.DimLattice(elements: List[fibomat.linalg.transformables.dim_transformable.DimTransformable], description: Optional[str] = None)[source]¶
Bases:
fibomat.layout.groups.group_base.GroupBase[fibomat.linalg.transformables.dim_transformable.DimTransformable,fibomat.linalg.vectors.dim_vector.DimVector,fibomat.linalg.boundingboxes.dim_boundingbox.DimBoundingBox],fibomat.linalg.transformables.dim_transformable.DimTransformable- __init__(elements: List[fibomat.linalg.transformables.dim_transformable.DimTransformable], description: Optional[str] = None)[source]¶
- Args:
description (str, optional): description
- classmethod generate_rect(nu: int, nv: int, dim_du: pint.quantity.Quantity, dim_dv: pint.quantity.Quantity, dim_element: Union[fibomat.linalg.transformables.transformable.Transformable, Callable], dim_center: Optional[Union[fibomat.linalg.vectors.dim_vector.DimVector, pint.quantity.Quantity]] = None, predicate: Optional[Union[Callable, List[Callable]]] = None, explode: bool = False, remove_outliers: bool = False)[source]¶
- classmethod generate(dim_boundary: fibomat.shapes.dim_shape.DimShape, dim_u: Union[fibomat.linalg.vectors.vector.Vector, Iterable[float]], dim_v: Union[fibomat.linalg.vectors.vector.Vector, Iterable[float]], dim_element: Union[fibomat.linalg.transformables.transformable.Transformable, Callable[[Tuple[float, float], Tuple[int, int]], Optional[fibomat.linalg.transformables.dim_transformable.DimTransformable]]], dim_center: Optional[Union[fibomat.linalg.vectors.vector.Vector, Iterable[float]]] = None, predicate: Optional[Union[Callable, List[Callable]]] = None, explode: bool = False, remove_outliers: bool = False, dim_seed: Optional[Union[fibomat.linalg.vectors.dim_vector.DimVector, pint.quantity.Quantity]] = None)[source]¶
predicate get its coordinates in µm
- Args:
dim_boundary: dim_u: dim_v: dim_element: dim_center: predicate: explode: remove_outliers:
Returns:
- property bounding_box: fibomat.layout.groups.group_base.BBoxT¶
BoundingBox: bounding box of transformable- Access:
get
- property center: fibomat.layout.groups.group_base.VectorT¶
center of the (geometric) object
- Access:
get
- Returns:
Any
- clone() fibomat.describable.T¶
Create a deepcopy of the object.
- Returns:
Describable
- property description: Optional[str]¶
Description str.
- Access:
get
- Returns:
Optional[str]
- property elements¶
- layout_elements() Iterator[fibomat.layout.layoutbase.ElementT]¶
Access to the saved elements.
- Yields:
Any: Type depends on saved element.
- mirrored(mirror_plane: fibomat.linalg.transformables.transformable_base.VectorT) fibomat.linalg.transformables.transformable_base.SelfT¶
Return a mirrored object mirrored about mirror_plane.
- Args:
mirror_plane (VectorLike): mirror plane to be used.
- Returns:
TransformableBase
- property pivot: fibomat.linalg.transformables.transformable_base.VectorT¶
Origin of the (geometric) object. If origin is set to None,
Transformable.centerwill be returned.Pivot must be set to a callable function without parameters.
transformable_obj = ... transformable_obj.pivot = lambda: return Vector(1, 2) print(transformable_obj.pivot) # will print Vector(1, 2)
- Access:
get/set
- Returns:
Vector
- rotated(theta: float, origin: Optional[Union[fibomat.linalg.transformables.transformable_base.VectorT, str]] = None) fibomat.linalg.transformables.transformable_base.SelfT¶
Return a rotated copy around origin with angle theta in math. positive direction (counterclockwise).
- Args:
theta (float): rotation angle in rad origin (Optional[Union[linalg.VectorLike, str]], optional):
origin of rotation. If not set, (0,0) is used as origin. If origin == ‘center’, the
Transformable.centerof the object will be used. The same applies for the case that origin == ‘origin’ with theTransformable.originproperty. Default to None.- Returns:
TransformableBase
- scaled(fac: float, origin: Optional[Union[fibomat.linalg.transformables.transformable_base.VectorT, str]] = None) fibomat.linalg.transformables.transformable_base.SelfT¶
Return a scale object homogeneously about origin with factor s.
- Args:
fac (float): rotation angle in rad origin (Optional[Union[linalg.VectorLike, str]], optional):
origin of rotation. If not set, (0,0) is used as origin. If origin == ‘center’, the
Transformable.centerof the object will be used. The same applies for the case that origin == ‘origin’ with theTransformable.originproperty. Default to None.- Returns:
TransformableBase
- transformed(transformations: fibomat.linalg.transformables.transformation_builder._TransformationBuilder[fibomat.linalg.transformables.transformable_base.VectorT]) fibomat.linalg.transformables.transformable_base.SelfT¶
- Return a transformed object. the transformation can be build by the following functions:
translate()rotate()scale()mirror()
E.g.
transformable_obj.transform(translate([1, 2]) | rotate(np.pi/3) | mirror([3,4])
- Args:
transformations (_TransformationBuilder): transformation
- Returns:
TransformableBase
- translated(trans_vec: fibomat.linalg.transformables.transformable_base.VectorT) fibomat.linalg.transformables.transformable_base.SelfT¶
Return a translated copy of the object by trans_vec.
- Args:
trans_vec (VectorLike): translation vector
- Returns:
TransformableBase
- translated_to(pos: fibomat.linalg.transformables.transformable_base.VectorT) fibomat.linalg.transformables.transformable_base.SelfT¶
Return a translated copy of the object so that self.pivot == pos
- Args:
pos: new position of object
- Returns:
TransformableBase