module: ‘transformation.py’

class gwa.code.transformation.Transformation(x_arg, y_arg, z_arg, angle_arg)[source]
The transformation module allow to calculate global or local coordinates while an XML export. Let’s define a matrix representing the transformation (translation and rotation) of a location in an environment or building.
arguments:
  • x (type integer)

  • y (type integer)

  • z (type integer)

  • angle (type float)

    rotation between local and global coordinates

exemple

>>> x = 20
>>> y = 12
>>> z = 3
>>> angle = 90
>>> T = Transformation(x,y,z,angle)"
To calculate global coordinates, the local ones are multiplicated by the transformation matrix.Pour calculer les coordonnées (X’, Y’, Z’) dans le repère global, on multiplie les coordonées (X, Y, Z) dans le repère local par la matrice de transformation associée.
cos a -sin a 0 x X X’ sin a cos a 0 y * Y = Y’ 0 0 1 z Z Z’ 0 0 0 1 1 1

x, y, z are the global coordinates of the location and a the angle of the rotation.

For a local point (a, b, c) the global transformation function is called that way : >>> coor_globales = T.trans(a,b,c)
globalToLocal(x_coor_area, y_coor_area, z_coor_area)[source]

The function ‘globaleVersLocale’ enables to get local coordinates from global coordinates. the “coor_area” arguments are global coordinates of the place. It returns a 3x1 vector, local coordinates of the point.

localToGlobal(x_coor_place, y_coor_place, z_coor_place)[source]

The function ‘localeVersGlobale’ enables to get global coordinates from local coordinates. the “coor_place” arguments are global coordinates of the place. It returns a 3x1 vector, global coordinates of the point.

Previous topic

module: ‘code_measure.py’

Next topic

module: ‘DBA.py’

This Page