Quickstart

Main idea

The main idea of Line Track Designer is to build tracks easily that you can edit, save, share and print with a printer.

To do that, different tiles are used and can be associated like a puzzle. This tiles originate from a PDF file and can be printed in A4 format (or US letter paper). They are squares of 200 mm, and are represented by a number between 2 and 33 which corresponds to the page number in the PDF file.

You can see all the tiles here: linefollowtiles.pdf

A track is represented by two matrix \(T\) and \(O\):

  • \(T\) contains the number of each tile of the track

  • \(O\) indicates the orientation of each tile

A correct orientation is 0, 1, 2 or 3 which corresponds to the number of times the tile is rotated by 90 degrees.

For example, we consider the following matrix:

\[\begin{split}T = \begin{pmatrix} 3 & 2 & 3 \\ 2 & 11 & 2 \\ 3 & 2 & 3 \end{pmatrix}\end{split}\]
\[\begin{split}O = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 0 & 0 \\ 2 & 1 & 3 \end{pmatrix}\end{split}\]

The track associated to this two matrix is:

_images/track.png

Tracks are stocked in text files. The two matrix are “superposed” like this:

3;1 2;1 3;0
2;0 11;0 2;0
3;2 2;1 3;3

Create your first track

This is how to build the track above with Line Track Designer:

  1. Create en empty track track.txt with 3 rows and 3 columns using this command:

linetrack create track.txt 3 3

You will arrive in your default text editor with this content:

0;0 0;0 0;0
0;0 0;0 0;0
0;0 0;0 0;0
  1. Change the numbers so that it looks like this:

3;1 2;1 3;0
2;0 11;0 2;0
3;2 2;1 3;3
  1. Save the modifications and quit the text editor.

  2. You can show the track as image using:

linetrack show track.txt

It will display the track in your picture reader.

  1. Generate the markdown file associated to the track with:

linetrack savemd track.txt

The program asks the name of the track and its description. The files track.png and track.md will be created. You can convert the markdown file into PDF or HTML. This is the result: track.pdf

You can also create exactly the same files using a Python script with the API of Line Track Designer:

import numpy as np
from line_track_designer.track import Track


# Arrays for the track
tiles = np.array([
    [3, 2, 3],
    [2, 11, 2],
    [3, 2, 3]
])
orient = np.array([
    [1, 1, 0],
    [0, 0, 0],
    [2, 1, 3]
])

# Creation of the track
track = Track(tiles, orient, 'Test track')

# Save the track
track.save_txt('track.txt')
# Make png file
track.save_img('track.png')
# Make markdown file
track.save_md('track.md', 'Easy track')