draw_v3.1 - a script to precisely draw on the screen with the turtle module
Usage
Basic
Execute the main() function and it opens the interface.
Every action is sent to the program thanks to key presses.
- Movements
- Move on the cardinal axes with the great arrow key.
- Move relative to your position with
alpha,lnfor/backwards andexp,logleft/right. - Change the scale of relative movements with keys 7, 4, 1 (length) and 8, 5, 2 (angle).
- Enter absolute coordinates and angles with
piandsquare-root.
- Pen management
- Toggle pen with
sin. - Change the line’s color with
cos(presets) andtan(rgb). - Change the size with
left parenthesis,plusandmultiply. - Clear the screen and with
backspace.
- Toggle pen with
- Miscellanous
- Change ticking speed with
right parenthesis,minusanddivide. - Toggle turtle with
square(x²). - Switch prompt with
var(interface).
- Change ticking speed with
Note that turtle doesn’t use the ion coordinate system: the origin (0,0) is in the very center of the screen. When dealing with angles, turtle uses degrees and describes 0° as “looking to the right”.
Interface
The drawing area starts blank and fills up 90% of the screen (ion coordinates 0,0 to 320,202).
There is a status bar, called the prompt, at the bottom which shows all the user values.
There are 3 prompt modes ; switch the shown mode with var.
- The position prompt logs the absolute coordinates (with turtle origin) and the heading/orientation.
- The settings prompt logs the relative gaps (pixgap and deggap) alongside the tick speed.
- The pen prompt logs the current color, the pen state (up/down) and its size/weight.
When you need to enter a value, a specific input-prompt gets showed.
You can use the digits, minus and backspace to indicate the value and exe or ok to send.
Escape it without making changes to any program-value with divide.