bluemira.geometry.placement
Wrapper for FreeCAD Placement objects
Classes
Bluemira Placement class. |
Module Contents
- class bluemira.geometry.placement.BluemiraPlacement(base: collections.abc.Iterable[float] = [0.0, 0.0, 0.0], axis: collections.abc.Iterable[float] = [0.0, 0.0, 1.0], angle: float = 0.0, label: str = '')
Bluemira Placement class.
- Parameters:
base (collections.abc.Iterable[float]) – Placement origin
axis (collections.abc.Iterable[float]) – vector describing the axis of rotation
angle (float) – angle of rotation in degree
label (str) – Label of the placement
- _shape
- label = ''
- classmethod from_3_points(point_1: collections.abc.Iterable[float], point_2: collections.abc.Iterable[float], point_3: collections.abc.Iterable[float], label: str = '') BluemiraPlacement
Instantiate a BluemiraPlacement from three points.
- Parameters:
point_1 (collections.abc.Iterable[float]) – First point
point_2 (collections.abc.Iterable[float]) – Second Point
point_3 (collections.abc.Iterable[float]) – Third point
label (str) – Label of the placement
- Returns:
A BluemiraPlacement from three points.
- Raises:
GeometryError – Points are co-linear
- Return type:
- classmethod from_matrix(matrix: numpy.ndarray, label: str = '') BluemiraPlacement
Instantiate a BluemiraPlacement from a 4 x 4 matrix
- Parameters:
matrix (numpy.ndarray) – 4 x 4 matrix from which to make the placement
label (str) – Label of the placement
- Returns:
A BluemiraPlacement from a 4 x 4 matrix
- Return type:
- property base: numpy.ndarray
Placement’s local origin
- Return type:
numpy.ndarray
- property axis: numpy.ndarray
Placement’s rotation matrix
- Return type:
numpy.ndarray
- property angle: float
Placement’s angle of rotation
- Return type:
float
- to_matrix() numpy.ndarray
- Returns:
A matrix (quaternion) representing the Placement’s transformation
- Return type:
numpy.ndarray
- inverse() BluemiraPlacement
Returns the inverse placement
- Returns:
An inverted placement.
- Return type:
- move(vector: collections.abc.Iterable[float])
Moves the Placement along the given vector
- Parameters:
vector (collections.abc.Iterable[float])
- __repr__()
- copy(label: str | None = None) BluemiraPlacement
Make a copy of the BluemiraPlacement
- Returns:
A copy of the BluemiraPlacement.
- Parameters:
label (str | None)
- Return type:
- deepcopy(label: str | None = None) BluemiraPlacement
Make a deepcopy of the BluemiraPlacement
- Returns:
A deepcopy of the BluemiraPlacement.
- Parameters:
label (str | None)
- Return type:
- classmethod _create(obj: bluemira.codes._freecadapi.apiPlacement, label: str = '') BluemiraPlacement
Create a placement from a cadapi Placement
- Returns:
A bluemira placement from a FreeCAD placement.
- Raises:
TypeError – Can only be created with cadapi placement
- Parameters:
obj (bluemira.codes._freecadapi.apiPlacement)
label (str)
- Return type:
- mult_vec(vec: collections.abc.Iterable[float]) numpy.ndarray
Transform a vector into the local placement
- Returns:
A placement from a vector.
- Parameters:
vec (collections.abc.Iterable[float])
- Return type:
numpy.ndarray
- extract_plane(v1: collections.abc.Iterable[float], v2: collections.abc.Iterable[float], base: float | None = None) bluemira.geometry.plane.BluemiraPlane
Return a plane identified by two vector given in the self placement
- Parameters:
v1 (collections.abc.Iterable[float]) – first reference vector
v2 (collections.abc.Iterable[float]) – second reference vector
base (float | None) – output plane origin
- Return type:
A BluemiraPlane
- xy_plane()
- Returns:
The corresponding placement xy plane
- yz_plane()
- Returns:
The corresponding placement yz plane
- xz_plane()
- Returns:
The corresponding placement xz plane