Rigid transformations

To describe a transformation of the position of a solid physical entity on a 2-dimensional plane - such a part placed on a sheet - a standardized representation of a Rigid Transformation is used in different objects in this API.

While a Transformation Matrix is typically in implementations to represent transformations from one coordinate system into another, such a matrix is too generic for our purposes: Besides translations, rotations and reflections, it can also do scaling an shearing which makes no sense when describing a position of a solid object. Besides that, transformation matrixes good to process but hard to read - especially with respect to rotations.

Therefore we use the following representation:

"x": <number>, // required
"y": <number>, // required
"angle": <number>, // required
"mirrored": <boolean> // optional, default to false

angle is specified in degrees counterclockwise. Any number is valid, including negative angles and angles >360°. Implementations SHOULD normalize angles to the half-open range [0°,360°[.

The individual transformations have to be applied in the following order:

  • Apply mirroring if `mirrored' is true by mirroring at the y-axis (x’=-x)

  • Apply rotation (angle)

  • Apply the translation (x/y)