A simple drawing program to replicate construction with a compass and straightedge.
This project is under development, nothing is final. These are notes I've made for myself. By using any executables herein, you understand it is in an unfinished state, and may break your computer or eat your cat.
Download working prototype here
LMB-drag
- set length/radiusAlt-LMB
- quick draw point-drag
- quick draw segment
Alt+drawing input
- only draw points, not shapesLMB
- start drawing a shape:
LMB
- circleLMB-drag
- arc
RMB
- lineRMB-drag
- extend line-from the initial point
- set perpendicular
RMB
- add point(s) to selectiondrag
- box select
Alt+^^^
- remove point(s) from selectionDelete
- delete selected points (+shapes)Ctrl+A
- select all on current layer
Esc
- cancelCtrl
- snap to shapesShift
- no snapping (by default the cursor will snap to points and intersections)Alt
- general modifier (number store...)Space
- canvas modifier (pan, basis)
MMB-drag
- pan viewport around canvasArrow keys
- pan viewport around canvasSpace+LMB-drag
- pan viewport around canvasSpace+RMB-drag
- set horizontal (right-facing) axis of viewport (rotate the canvas)Scroll
- zoom to cursorPgUp/PgDn
- zoom to centreHome
- return to starting pointBackspace
- reset canvas drawingAlt+Enter
- toggle fullscreenCtrl+Tab
- up a layerCtrl+Shift+Tab
- down a layerCtrl+T
- toggle layer thumbnails (likely to change soon)
2-0
- divide length by 2-10Alt+2-0
- multiply length by 2-10a-z,A-Z
- get stored length/radiusAlt+a-Z
- set stored length/radiusTab
- swap to previously used length
Ctrl+Z
- undoCtrl+Y
- redoCtrl+Sh+Z
- redoCtrl+S
- save fileCtrl+Sh+S
- save file as...Ctrl+O
- open fileCtrl+Sh+O
- open file in new windowCtrl+N
- new fileCtrl+Sh+N
- new file in new window
My input handling is not yet dialled in. Sometimes it seems as though keys are 'stuck' down. If you press and release the key again, this sorts out the issue. For example, if you Alt + Tab
into/out of the program it thinks Alt
is held down, so the canvas may rotate when you mean to draw lines.
Learning some woodworking a few months ago, I got into some design using a compass and straightedge. The tools required for this are very simple, and as such have been around for thousands of years, used for physical design from fine cabinet-making to large-scale architecture. Despite their simplicity, combinations of arcs and straight lines allow for a very powerful method for design and encourage in the designer an understanding of proportion and rhythms.
I was impressed when I came across https://sciencevsmagic.net/geo/ a little while ago, and after gaining a better understanding of the fundamentals of compass/straightedge construction with By Hound and Eye (Geo Walker and Jim Tolpin), I decided I should try to make a more complete desktop application to emulate this geometrical method of construction.
This is the first 'proper' desktop application I have attempted to build, so I'm likely to have overlooked some key/time-consuming features. With that said, these are the main goals for the project:
- UI that emphasises drawing ease and speed with minimal input (primarily mouse-based)
- Draw points, circles, arcs and lines
- Drawing between intersections (and along lines) maintained as a central concept as with manual construction
- Scalable, movable, rotatable canvas
- Multiple layers
- Export drawings in useful formats (.svg, .png...)
- Ability to create 'large' (more precise size TBD) drawings without slowdown
- Programmed in C with minimal library usage (e.g. drawing functions all created 'by hand')
- Support Windows from the start, probably support Linux and Mac OS as well
- Write blog entries describing/explaining the design and implementation of major features (being fairly new to this, these will probably focus on overcoming the various problems I encounter along the way).
- Provide access to most, if not all, source code (all the project-specific stuff is currently on GitHub).
- Provide at least the basic program free. I haven't decided whether a paid, 'advanced' version would be appropriate.
- Target user personas: woodworker designing furniture, mathematician demonstrating various geometric constructions.
There are also a number of other ideas that I've been playing around with, but haven't yet decided upon whether they are worth including in the project. I'm sure these will be the topic of future blog posts.
In roughly implementation order:
- Draw lines
- Draw circles
- Index circles & lines on points
- Snap to points (optional but on by default)
- Line-line intersection
- Line-circle intersection
- Circle-circle intersection
- Delete points
- Move points
- Undo function
- Draw and intersect arcs
- Panning
- Zooming and rotation
- Animate between changes in basis
- Unlimited points/shapes
- File saves/loading
- Faster way to implement multiple arcs/circles of the same radius
- Add layers and decide on how they can interact
- Basic .png exports
- Add text labels for points
- Improved exports
- Improve graphical representation (anti-aliasing, experiment with sweeps when moving the mouse quickly...)
- Consider hardware rasterizer
- Decide on and use a spatial partitioning method
- More advanced undo system?
- Rays and/or lines
- New and exciting features... (parametric editing? animation between states?! Who knows? Only time will tell...)