simple Python script for generating an analogue clock timer template given two circle diameters and the number of hours on the dial
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.
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.
-
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.
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.
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:
- Fork it
- Create your feature branch:
git checkout -b my-new-feature
- Commit all your changes:
git commit -am 'add some feature'
- Push to your feature branch:
git push origin my-new-feature
- Submit a pull request
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.
You can get the newest version from the project's website.