Skip to content

Python script for generating an analogue clock timer template

License

Notifications You must be signed in to change notification settings

makomi/timer_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

analogue timer template

simple Python script for generating an analogue clock timer template given two circle diameters and the number of hours on the dial

What it does

It simplifies the creation of geometrically accurate timer designs by providing you with a template that marks all relevant positions. To generate the template, you have to provide the circle diameters of day and hour circles as well as the number of hours on the dial---probably 12 or 24.

When executed, the script displays the resulting pixel graphic and saves a derived postscript document in the current working directory.

example window

A note on precisely placed elements
In the above image, one can see how a low image resolution can result in poorly placed circles and lines. The lower the image's overall resolution, the less accurate the lines are drawn/ the pixels are placed and the less accurate the objects of the derived postscript document are placed.
In order to achieve precisely drawn lines, a large scaling factor must be set. It scales the provided circle diameters and thereby the whole image. This allows one to keep the original circle diameters and create a larger image with higher resolution and therefore more precisely placed elements.

Key Features

  • Freely customizable design
    The template can be tailored to your exact needs. Merely set the diameters for the day and hour circles as well as the number of overall hour circles on the dial.

  • Additional half-hour markings
    Drawing a 24 hour timer will result in a total of 48 markings (24 for each hour and another 24 for each half-hour) providing you with additional positional information.

  • Vector output
    The output is automatically saved to a vector file format, currently a postscript document.

  • High precision
    In order to position elements with high accuracy, a large integer scaling factor can be chosen to create a larger image with higher resolution.

Getting started

Install the necessary modules and run the script:

$ sudo apt-get install python-tk python-sympy
$ ./timer_template.py

It requires Python v2.7 or later.

In order to modify the default settings, open the script and change the variable values listed in the section called settings.

Contributing

This script currently provides minimal functionality and is suitable for production use. Have a look at the open issues for ideas on how to contribute. Furthermore, if you have a neat idea for a new feature or some other improvement, I am looking forward to recieving a pull request from you:

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit all your changes: git commit -am 'add some feature'
  4. Push to your feature branch: git push origin my-new-feature
  5. Submit a pull request

License

GNU General Public License v3.0

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation.

See LICENSE for details.

Source

You can get the newest version from the project's website.