Skip to content

Commit

Permalink
Cleanup related to 'arrowSize', 'lineThickness', 'borderPattern', 'Ar…
Browse files Browse the repository at this point in the history
…row'
  • Loading branch information
henrikt-ma committed Oct 14, 2020
1 parent 2d11561 commit 8087e0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
30 changes: 11 additions & 19 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,14 @@ \subsubsection{Coordinate Systems}\label{coordinate-systems}

\subsubsection{Graphical Properties}\label{graphical-properties}

Properties of graphical objects and connection lines are described using
the following attribute types.
Properties of graphical objects and connection lines are described using the following attribute types.
\begin{lstlisting}[language=modelica]
type Color = Integer[3](min=0, max=255) "RGB representation";

type Color = Integer[3](min = 0, max = 255) "RGB representation";
constant Color Black = zeros(3);
type LinePattern = enumeration(None, Solid, Dash, Dot, DashDot, DashDotDot);
type FillPattern = enumeration(None, Solid, Horizontal, Vertical,
Cross, Forward, Backward, CrossDiag, HorizontalCylinder, VerticalCylinder, Sphere);
Cross, Forward, Backward, CrossDiag,
HorizontalCylinder, VerticalCylinder, Sphere);
type BorderPattern = enumeration(None, Raised, Sunken, Engraved);
type Smooth = enumeration(None, Bezier);
type EllipseClosure = enumeration(None, Chord, Radial);
Expand All @@ -459,9 +458,7 @@ \subsubsection{Graphical Properties}\label{graphical-properties}
\caption{Line with \lstinline!smooth = Bezier!. The four line points $P_{1}$, \ldots{}, $P_{4}$ result in two quadratic splines and two straight line segments.}\label{fig:smooth-bezier}
\end{figure}

The \lstinline!smooth! attribute specifies that a line can be drawn as straight line
segments (\lstinline!None!) or using a spline (\lstinline!Bezier!), where the line's points
specify control points of a quadratic Bezier curve, see \cref{fig:smooth-bezier}.
The \lstinline!smooth! attribute specifies that a line can be drawn as straight line segments (\lstinline!None!) or using a spline (\lstinline!Bezier!), where the line's points specify control points of a quadratic Bezier curve, see \cref{fig:smooth-bezier}.

For lines with only two points, the \lstinline!smooth! attribute has no effect.

Expand All @@ -474,16 +471,15 @@ \subsubsection{Graphical Properties}\label{graphical-properties}
calculated middle points of each line segment. Points $P_{12}$, $P_{2}$, and $P_{23}$ define the first quadratic Bezier curve, and the points $P_{23}$, $P_{3}$, and $P_{34}$ define the second
quadratic Bezier curve. Finally a straight line is drawn between points $P_{1}$ and $P_{12}$ as well as between $P_{34}$ and $P_{4}$.

The values of the \lstinline!EllipseClosure! enumeration specify if and how the
endpoints of an elliptical arc are to be joined (see \cref{ellipse}).
The values of the \lstinline!EllipseClosure! enumeration specify if and how the endpoints of an elliptical arc are to be joined (see \cref{ellipse}).

\begin{lstlisting}[language=modelica]
type Arrow = enumeration(None, Open, Filled, Half);
type TextStyle = enumeration(Bold, Italic, UnderLine);
type TextAlignment = enumeration(Left, Center, Right);
\end{lstlisting}
Filled shapes have the following attributes for the border and interior.

Filled shapes have the following attributes for the border and interior.
\begin{lstlisting}[language=modelica]
record FilledShape "Style attributes for filled shapes"
Color lineColor = Black "Color of border line";
Expand Down Expand Up @@ -667,7 +663,7 @@ \subsubsection{Line}\label{line}
LinePattern pattern = LinePattern.Solid;
DrawingUnit thickness = 0.25;
Arrow arrow[2] = {Arrow.None, Arrow.None} "{start arrow, end arrow}";
DrawingUnit arrowSize=3;
DrawingUnit arrowSize = 3;
Smooth smooth = Smooth.None "Spline";
end Line;
\end{lstlisting}
Expand All @@ -677,17 +673,13 @@ \subsubsection{Line}\label{line}
For arrows:
\begin{itemize}
\item
The arrow is drawn with an aspect ratio of 1/3 for each arrow half, i.e.,
if the arrow-head is 3~mm long an arrow with Half will extend 1~mm from the
mid-line and with Open or Filled extend 1~mm to each side, in total making the base 2~mm wide.
The arrow is drawn with an aspect ratio of 1/3 for each arrow half, i.e., if the arrow-head is 3~mm long an arrow with \lstinline!Half! will extend 1~mm from the mid-line and with \lstinline!Open! or \lstinline!Filled! extend 1~mm to each side, in total making the base 2~mm wide.
\item
The arrowSize gives the width of the arrow (including the imagined
other half for Half) so that lineThickness=10 and arrowSize=10 will
touch at the outer parts.
The \lstinline!arrowSize! gives the width of the arrow (including the imagined other half for \lstinline!Half!) so that \lstinline!lineThickness = 10! and \lstinline!arrowSize = 10! will touch at the outer parts.
\item
All arrow variants overlap for overlapping lines.
\item
The lines for the Open and Half variants are drawn with lineThickness.
The lines for the \lstinline!Open! and \lstinline!Half! variants are drawn with \lstinline!lineThickness!.
\end{itemize}

\subsubsection{Polygon}\label{polygon}
Expand Down
2 changes: 1 addition & 1 deletion chapters/revisions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4}
\cref{coordinate-systems} and \cref{extends-clause}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1978}{\#1978}.
\item
Clarified lineThickness and borderPattern, \cref{graphical-primitives} \cref{graphical-properties}.
Clarified \lstinline!lineThickness! and \lstinline!borderPattern!, \cref{graphical-primitives} \cref{graphical-properties}.
Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1896}{\#1896}.
\item
Corrected formatting, \cref{graphical-properties}. Ticket
Expand Down

0 comments on commit 8087e0d

Please sign in to comment.