2018-11-22 15:28:16 +01:00
%!TEX TS-program = pdflatexmk
%!TEX root = sketch.tex
2018-11-27 09:09:49 +01:00
% Copyright 2018 RailToolKit (Attribution 4.0 International, CC-BY 4.0)
% You are free to copy and redistribute the material in any medium or format. You are free to remix, transform, and build upon the material for any purpose, even commercially. You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. No warranties are given.
2018-11-22 15:28:16 +01:00
% dimensons for signal construction
\def\length{2.0}
\def\height{1.5}
\def\thick{0.4}
\def\gap{0.05}
\def\depth{2.0}
\tikzset{
block_signal/.pic={
% frame
\draw [thick] ( -1.5,-2.0) -- ( 1.5,-2.0) -- (1.5,-4.0) -- (-1.5,-4.0) --cycle;
};
}
\tikzset{
block_signal_cross_section/.pic={
% lever
\draw [thick] (0,0) -- ++( 0,\height) -- ++(\thick,0) -- ++(0,-\height)
-- ++(\length,0) -- ++(0,-\thick) -- ++(-\length,0) -- ++(-\thick,0) -- ++(-\length,0)
-- ++(0,\thick,0) -- cycle;
% frame
\draw [thick] (-\gap,\gap) -- ++(-\length,0)
-- ++(0,-\gap) -- ++(0,-\thick) -- ++(0,-\gap) % inner height
-- ++(\gap,0) -- ++(\length,0) -- ++(\length,0) -- ++(\length,0) -- ++(\gap,0) % inner bottom
-- ++(0,\gap) -- ++(0,\thick) -- ++(0,\gap) % inner height
-- ++(-\length,0)
-- ++(0,\thick)
-- ++(\length,0) -- ++(\thick,0)
-- ++(0,-\thick) -- ++(0,-\gap) -- ++(0,-\thick) -- ++(0,-\gap) -- ++(0,-\thick) % outer height
-- ++(-\thick,0) -- ++(-\gap,0) -- ++(-\length,0) -- ++(-\length,0) -- ++(-\length,0) -- ++(-\gap,0) -- ++(-\thick,0) % outer bottom
-- ++(0,\thick) -- ++(0,\gap) -- ++(0,\thick) -- ++(0,\gap) -- ++(0,\thick) % outer height
-- ++(\length,0) -- ++(\thick,0)
-- cycle;
};
}
\tikzset{
block_signal_top_view/.pic={
% lever
\draw [thick] (0,0) rectangle ++(\thick,\depth);
% frame
\draw [thick] (-\gap,0) -- ++(-\length,0) -- ++(-\thick,0)
-- ++(0,\depth)
-- ++(\length,0) -- ++(\thick,0)
-- cycle;
\draw [thick] (\length,0) -- ++(\length,0) -- ++(\thick,0)
-- ++(0,\depth)
-- ++(-\length,0) -- ++(-\thick,0)
-- cycle;
};
}
\tikzset{
track_straight/.pic={
% rails
\filldraw [base1!60] (0, 1.0) rectangle ++ (14.5, 0.5);
\filldraw [base1!60] (0,-1.0) rectangle ++ (14.5,-0.5);
% frame
\draw [thick] ( 0.0,-2.0) -- ( 0.0,-0.3) --
( 0.7,-0.3) arc[start angle=36.6, end angle=323.4, radius=-0.5] --
( 0.0,0.3) -- ( 0.0,2.0) --
(14.5,2.0) -- (14.5,0.3) --
(15.2,0.3) arc[start angle=323.4, end angle=36.6, radius=-0.5] --
(14.5,-0.3) -- (14.5,-2.0) -- cycle;
};
}
\tikzset{
track_curved/.pic={
% % rails
% \filldraw [base1!60] (0,3.0) rectangle ++ (14.5,0.5);
% \filldraw [base1!60] (0,0.5) rectangle ++ (14.5,0.5);
% % frame: radius (center) 20,5 cm
% \draw [thick] ( 0.0,0.0) -- ( 0.0,1.7) --
% ( 0.7,1.7) arc[start angle=36.6, end angle=323.4, radius=-0.5] --
% ( 0.0,2.3) -- ( 0.0,4.0) --
% (14.5,4.0) -- (14.5,2.3) --
% (15.2,2.3) arc[start angle=323.4, end angle=36.6, radius=-0.5] --
% (14.5,1.7) -- (14.5,0.0) -- cycle;
};
}
\begin{tikzpicture}
% \pic at ( 0.0,0) {track_straight};
% \pic at (14.5,0) {track_straight};
% \pic at (14.5,0) {block_signal};
\pic at (14.5,4) {block_signal_cross_section};
\pic at (14.5,0) {block_signal_top_view};
\end{tikzpicture}