This Python 3 application helps generate complete slide rule patterns.
This is via:
To run the program, you can download the one file as:
- Download
SlideRule.py
- Install PIL via:
python3 -m pip install Pillow
- Install TOML via:
python3 -m pip install toml
Or clone this git repository locally and install per the requirements file as:
python3 -m pip install -r requirements.txt
An installation of two fonts: cmuntt.ttf
and cmunit.ttf
(part of the infamous LaTeX fonts)
- These can be found at: https://www.freebestfonts.com/computer-modern-font
- Install all of them if you want different typesetting options.
usage: SlideRule.py [-h] [--mode {render,diagnostic,stickerprint}]
[--model {Demo,MannheimOriginal,Ruler,MannheimWithRuler,Aristo868,Aristo965,PickettN515T,FaberCastell283,FaberCastell283N,Graphoplex621,Hemmi153,UltraLog}]
[--suffix SUFFIX] [--test] [--cutoffs] [--debug]
optional arguments:
-h, --help show this help message and exit
--mode {render,diagnostic,stickerprint}
What to render
--model {Demo,MannheimOriginal,Ruler,MannheimWithRuler,Aristo868,Aristo965,PickettN515T,FaberCastell283,FaberCastell283N,Graphoplex621,Hemmi153,UltraLog}
Which sliderule model
--suffix SUFFIX Output filename suffix for variations
--test Output filename for test comparisons
--cutoffs Render the metal cutoffs
--debug Render debug indications (corners and bounding boxes)
The program has 3 rendering modes for any of the slide rule models defined:
render
: Prints a rendering of the full size scales in their correct positionsdiagnostic
: Prints a rendering containing each available scale arranged in rowsstickerprint
: Prints an image which can be scaled to 677.33 ppi in Gimp and then Print+Cut in Silhouette Studio
There are multiple slide rule models available, mostly defined in TOML:
- Demo is the original slide rule made for instruction.
- MannheimOriginal is the simplest model, with just 4 scales along the edges.
Ruler
andMannheimWithRuler
show the ruler scales, which can be set along the edge of a slide rule.- PickettN515T is made for electronics engineering calculations.
- Aristo868 and Graphoplex621 are European slide rules with a moderate number of compact scales.
- FaberCastell283 and FaberCastell283N have the large number of scales.
The produced images are also saved. The images in examples are refreshed by generate_example_outputs.py, a wrapper script you can run on new models, or to check for changes after making source code updates.
- If you have trouble finding them, look in the location where your program is (that seemed to work for me)
render
anddiagnostic
modes takes around 2 seconds to run, but thestickerprint
mode usually takes 3 seconds to run.- If you run across issues, comment on Javier Lopez Instructables article or here, and I will attempt to explain myself.
To understand changes, the imgdiff tool can highlight differences in image outputs (ignoring color changes with -t 0.6
):
imgdiff -t 0.6 <original_image>.png <updated_image>.png <original_image>.diff.png
The included Excel file can help convert between pixels, inches, and millimeters when the slide rule is being built out of physical material.
Enjoy!