Skip to content

Commit

Permalink
Simplify presentation of Transformation for improved clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Dec 18, 2022
1 parent 2138cec commit cbef87d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions chapters/annotations.tex
Expand Up @@ -731,20 +731,21 @@ \subsection{Component Instance}\label{component-instance}
Placements are defined in terms of coordinate system transformations:
\begin{lstlisting}[language=modelica]
record Transformation
Point origin = {0, 0};
Extent extent;
Real rotation(quantity = "angle", unit = "deg") = 0;
Point origin = {0, 0};
end Transformation;
\end{lstlisting}%
\annotationindex{Transformation}
The origin attribute defines the position of the component in the coordinate system of the enclosing class.
The \lstinline!extent! defines the position, size and flipping of the component, relative to the \lstinline!origin! attribute.
The \lstinline!extent! is defined relative to the \lstinline!origin! attribute of the component instance.
Given an extent \lstinline!{{$x_{1}$, $y_{1}$}, {$x_{2}$, $y_{2}$}}!, $x_{2} < x_{1}$ defines horizontal flipping and $y_{2} < y_{1}$ defines vertical flipping around the center of the object.

The \lstinline!rotation! attribute specifies rotation of the extent around the point defined by the \lstinline!origin! attribute.

The graphical operations are applied in the order: scaling, flipping and rotation.
The attributes are applied in the order \lstinline!extent!, \lstinline!rotation!, \lstinline!origin!, as follows:
\begin{enumerate}
\item
The \lstinline!extent! of the component icon is mapped to the \lstinline!extent! rectangle (possibly shifting, scaling, and flipping contents).
\item
The \lstinline!rotation! specifies counter-clockwise rotation around the origin (that is \lstinline!{0, 0}!, not the \lstinline!origin! attribute).
\item
The \lstinline!origin! specifies a shift (moving \lstinline!{0, 0}! to \lstinline!origin!).
\end{enumerate}

\begin{lstlisting}[language=modelica]
record Placement
Expand Down

0 comments on commit cbef87d

Please sign in to comment.