tikz-trackschematic/test/crossing.tikz

59 lines
2.2 KiB
Plaintext
Raw Normal View History

%!TEX TS-program = pdflatexmk
%!TEX root = test.tex
% Copyright (c) 2018 - 2020, Martin Scheidt (ISC license)
% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
\node[blue] at (4,0) {\large test crossings};
\foreach \i in {1,2}{% base coordinate
\coordinate (A\i) at ($(0,0) + 2*(0,-\i)$);% base coordinate
\coordinate (B\i) at ($(8,0) + 2*(0,-\i)$);% base coordinate
}
\foreach \i in {1}{% draw main tracks on base coordinate
\maintrack (A\i) -- (B\i);
}
\foreach \i in {2}{% draw secondary tracks on base coordinate
\secondarytrack (A\i) -- (B\i);
}
\foreach \i in {1,2}{% coordinates for testing symbols
\coordinate (X\i-1) at ($(1,0) + 2*(0,-\i)$);
\coordinate (X\i-2) at ($(3,0) + 2*(0,-\i)$);
\coordinate (X\i-3) at ($(5,0) + 2*(0,-\i)$);
\coordinate (X\i-4) at ($(7,0) + 2*(0,-\i)$);
}
\foreach \i in {1}{% coordinates for testing symbols
\maintrack (X\i-1) -- ++( 0.75,-0.75);
\maintrack (X\i-1) -- ++(-0.75, 0.75);
\maintrack (X\i-2) -- ++( 0.75, 0.75);
\maintrack (X\i-2) -- ++(-0.75,-0.75);
\maintrack (X\i-3) -- ++( 0.75,-0.75);
\maintrack (X\i-3) -- ++(-0.75, 0.75);
\maintrack (X\i-4) -- ++( 0.75, 0.75);
\maintrack (X\i-4) -- ++(-0.75,-0.75);
}
\foreach \i in {2}{% coordinates for testing symbols
\secondarytrack (X\i-1) -- ++( 0.75,-0.75);
\secondarytrack (X\i-1) -- ++(-0.75, 0.75);
\secondarytrack (X\i-2) -- ++( 0.75, 0.75);
\secondarytrack (X\i-2) -- ++(-0.75,-0.75);
\secondarytrack (X\i-3) -- ++( 0.75,-0.75);
\secondarytrack (X\i-3) -- ++(-0.75, 0.75);
\secondarytrack (X\i-4) -- ++( 0.75, 0.75);
\secondarytrack (X\i-4) -- ++(-0.75,-0.75);
}
\crossing[branch=right] at (X1-1) label (X1-1);
\crossing[branch=left ] at (X1-2) label (X1-2);
\crossing[branch=right,fouling point] at (X1-3) label (X1-3);
\crossing[branch=left ,fouling point] at (X1-4) label (X1-4);
\crossing[branch=right] at (X2-1) label (X2-1);
\crossing[branch=left ] at (X2-2) label (X2-2);
\crossing[branch=right,fouling point] at (X2-3) label (X2-3);
\crossing[branch=left ,fouling point] at (X2-4) label (X2-4);