gmsh_scripts.transform.transform
Module Contents
Classes
General transformation of Point coordinates. |
|
Translate coordinates of the Point by the displacement |
|
TODO only for 3D coordinate systems |
|
Convert coordinates of the Point from Cartesian to Cartesian system. |
|
Convert coordinates of the Point from Cylindrical to Cartesian system. |
|
Convert coordinates of the Point from Spherical to Cartesian system. |
|
Convert coordinates of the Point from Toroidal to Cartesian system. |
|
Convert coordinates of the Point from Tokamak to Cartesian system. |
|
Convert coordinates of the Point from Block to Cartesian system. |
|
Convert coordinates of the Point from Cartesian to Cartesian system by Block coordinates. |
|
Convert coordinates of the Point from Affine to Affine system. |
|
Convert coordinates of the Point from Affine to Cartesian system. |
|
Convert coordinates of the Point from Path to Cartesian system. |
|
General transformation of Point coordinates. |
|
General transformation of Point coordinates. |
|
Treat any coordinate system as some coordinate system without coordinates transformation |
|
Affine transformation matrix |
Functions
|
Apply transformations on the point. |
Attributes
- gmsh_scripts.transform.transform.reduce_transforms(transforms, point)
Apply transformations on the point.
- class gmsh_scripts.transform.transform.Transform(cs_from=None, cs_to=None, cs_self=None, **kwargs)
General transformation of Point coordinates.
- Параметры:
cs_from (CoordinateSystem) – CoordinateSystem from
cs_to (CoordinateSystem) – CoordinateSystem to
cs_self (CoordinateSystem) – CoordinateSystem self
- class gmsh_scripts.transform.transform.Translate(delta, **kwargs)
Bases:
TransformTranslate coordinates of the Point by the displacement
- Параметры:
delta (list or np.ndarray) – displacement
- class gmsh_scripts.transform.transform.Rotate(origin, direction, angle, **kwargs)
Bases:
TransformTODO only for 3D coordinate systems :param origin: origin of rotation :type origin: list or np.ndarray :param direction: rotation axis :type direction: list or np.ndarray :param angle: counterclockwise angle of rotation in radians [0, 2*pi) :type angle: float
- class gmsh_scripts.transform.transform.CartesianToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Cartesian to Cartesian system.
For compatibility.
- class gmsh_scripts.transform.transform.CylindricalToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Cylindrical to Cartesian system.
[r, phi, z] -> [x, y, z] r - radius [0, inf), phi - azimuthal angle [0, 2*pi) (counterclockwise from X to Y), z - height
- class gmsh_scripts.transform.transform.SphericalToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Spherical to Cartesian system.
[r, phi, theta] -> [x, y, z]
r - radius [0, inf)
phi - azimuthal angle [0, 2*pi) (counterclockwise from X to Y)
theta - polar angle [0, pi] [from top to bottom, i.e XY-plane is pi/2]
- class gmsh_scripts.transform.transform.ToroidalToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Toroidal to Cartesian system.
[r, phi, theta, r2] -> [x, y, z]
r - inner radius (r < r2)
phi - inner angle [0, 2*pi)
theta - outer angle [0, 2*pi)
r2 - outer radius
- class gmsh_scripts.transform.transform.TokamakToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Tokamak to Cartesian system.
[r, phi, theta, r2, kxy, kz] -> [x, y, z]
r - inner radius (r < r2)
phi - inner angle [0, 2*pi)
theta - outer angle [0, 2*pi)
r2 - outer radius
kxy - inner radius XY scale coefficient in positive outer radius direction
kz - inner radius Z scale coefficient
- class gmsh_scripts.transform.transform.BlockToCartesian(cs_from=None, **kwargs)
Bases:
TransformConvert coordinates of the Point from Block to Cartesian system.
[xi, eta, zeta] -> [x, y, z]
xi, eta, zeta - local block coordinates
- Параметры:
cs_from (coordinate_system.Block) – Block Coordinate System
- class gmsh_scripts.transform.transform.CartesianToCartesianByBlock(block=None, block_coordinates=None, **kwargs)
Bases:
TransformConvert coordinates of the Point from Cartesian to Cartesian system by Block coordinates.
[x, y, z] -> [x, y, z] + [dx, dy, dz]
[dx, dy, dz] = [xi, eta, zeta] - block_coordinates in Cartesian system
- Параметры:
block (block.Block) – Block object
block_coordinates (list or np.ndarray) – xi, eta, zeta - block local coordinates
- class gmsh_scripts.transform.transform.AffineToAffine(cs_to, **kwargs)
Bases:
TransformConvert coordinates of the Point from Affine to Affine system.
[x0, y0, z0] -> [x1, y1, z1]
- Параметры:
cs_to (Affine) – Affine coordinate system
- class gmsh_scripts.transform.transform.AffineToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Affine to Cartesian system.
[x0, y0, z0] -> [x, y, z]
- class gmsh_scripts.transform.transform.PathToCartesian(**kwargs)
Bases:
TransformConvert coordinates of the Point from Path to Cartesian system.
[x, y, u] -> [x, y, z]
u - relative path coordinate [0, 1], where 0 - start of the path, 1 - end.
x, y - Cartesian coordinates [-inf, inf] on the normal plane to direction of the path derivative at the point with relative path coordinate u.
- class gmsh_scripts.transform.transform.LayerToCartesian(**kwargs)
Bases:
TransformGeneral transformation of Point coordinates.
- Параметры:
cs_from (CoordinateSystem) – CoordinateSystem from
cs_to (CoordinateSystem) – CoordinateSystem to
cs_self (CoordinateSystem) – CoordinateSystem self
- static update_coordinate(p0, pn, n0, nn, l00, l0n, ln0, lnn, lt)
- class gmsh_scripts.transform.transform.QuarterLayerToCartesian(**kwargs)
Bases:
TransformGeneral transformation of Point coordinates.
- Параметры:
cs_from (CoordinateSystem) – CoordinateSystem from
cs_to (CoordinateSystem) – CoordinateSystem to
cs_self (CoordinateSystem) – CoordinateSystem self
- static update_coordinate(p0, pn, n0, nn, l00, l0n, ln0, lnn, lt)
- class gmsh_scripts.transform.transform.AnyAsSome(cs_to, **kwargs)
Bases:
TransformTreat any coordinate system as some coordinate system without coordinates transformation
- Параметры:
cs_to (CoordinateSystem) – some coordinate system
- class gmsh_scripts.transform.transform.TransformationMatrix(matrix, **kwargs)
Bases:
TransformAffine transformation matrix
Matrix could describe translation, rotation, reflection and dilation
- Параметры:
matrix (list or list of list or np.ndarray) – transformation matrix
- gmsh_scripts.transform.transform.str2obj