TransformationStack
Canonical path: Utils.Geometry.TransformationStack.TransformationStack
implementation of the transformation stack
Methods:
-
__getitem__–get a transformation matrix from the stack
-
__init__–initialize
-
append–append a transformation matrix to the stack
-
pop–pop the last transformation matrix from the stack
-
restore–restore a transformation
-
restore_all–restore all transformations
-
restore_stack–restore the stack
-
rotate_x–add a rotation around the x axis to the stack
-
rotate_y–add a rotation around the y axis to the stack
-
rotate_z–add a rotation around the z axis to the stack
-
save_stack–save and clear the stack
-
scale–add a scaling to the stack
-
scale_x–add a x scaling to the stack
-
scale_xy–add a x/y scaling to the stack
-
scale_y–add a y scaling to the stack
-
scale_z–add a z scaling to the stack
-
transform–transform a geometry element with the current transformation matrix
-
translate–add a vector translation to the stack
-
translate_x–add a x translation to the stack
-
translate_xy–add a x/y translation to the stack
-
translate_xyz–add a x/y/z translation to the stack
-
translate_y–add a y translation to the stack
-
translate_z–add a z translation to the stack
Attributes:
-
length_fac(float) –get the length factor
-
trans_matrix(Matrix3D) –get the current transformation matrix
trans_matrix
property
trans_matrix: Matrix3D
__getitem__
__getitem__(pos: int) -> Matrix3D
get a transformation matrix from the stack
Parameters:
-
pos(int) –index of the transformation matrix
Returns:
-
Matrix3D–transformation matrix at the given index
__init__
__init__(length_unit: LengthUnit = MM, angle_unit: AngleUnit = DEGREE)
initialize
Parameters:
-
length_unit(LengthUnit, default:MM) –length unit
-
angle_unit(AngleUnit, default:DEGREE) –angle unit
append
append(matrix: Matrix3D)
pop
pop(pos: int = -1) -> Matrix3D
pop the last transformation matrix from the stack
Parameters:
-
pos(int, default:-1) –index of the transformation matrix to pop, -1 for the last one
Returns:
-
Matrix3D–returns
rotate_x
rotate_y
rotate_z
scale
add a scaling to the stack
Parameters:
-
x_fac(float) –scale factor in x direction
-
y_fac(float) –scale factor in y direction
-
z_fac(float) –scale factor in z direction
scale_x
add a x scaling to the stack
Parameters:
-
x_fac(float) –scale factor in x direction
scale_xy
add a x/y scaling to the stack
Parameters:
-
x_fac(float) –scale factor in x direction
-
y_fac(float) –scale factor in y direction
scale_y
add a y scaling to the stack
Parameters:
-
y_fac(float) –scale factor in y direction
scale_z
add a z scaling to the stack
Parameters:
-
z_fac(float) –scale factor in z direction
transform
transform a geometry element with the current transformation matrix
Parameters:
-
geo_ele(Any) –geometry element to transform
Returns:
-
Any–transformed geometry element
translate
translate(vec: Vector3D)
translate_x
add a x translation to the stack
Parameters:
-
vec_x(float) –x translation
translate_xy
add a x/y translation to the stack
Parameters:
-
vec_x(float) –x translation
-
vec_y(float) –y translation
translate_xyz
add a x/y/z translation to the stack
Parameters:
-
vec_x(float) –x translation
-
vec_y(float) –y translation
-
vec_z(float) –z translation
translate_y
add a y translation to the stack
Parameters:
-
vec_y(float) –y translation