Vectr is a simple vector-graphic program, based on a model-view architecture. Created as an exercise of programming patterns, some notable uses are:
- Command: transforming keyboard and mouse events into actions
- Composite: shapes can be grouped and ungrouped, rendered by layer and edited simultaneously
- Listener: each graphical object offers a listener interface, allowing tools to operate on several objects at once
- State: interpretation of user inputs is based on which tool is selected
- Prototype: shapes decoupled from the tool that creates them
- Bridge: shapes decoupled from renderers that draw and serialize them
- Decorator: used to model GUI style sheets
-
shape select&edit tool
- drag with
mouseor usearrow keys- move selected object- +
shiftfor faster movement
- +
ctrl+mouse click- select multiple objectsgandu- group and ungroup+and-- layer up and down
- drag with
-
shape delete tool controls
- Use
mouseas a pen to draw a shape around or through the objects you want to delete
- Use
-
General
esc- deselect toolend- exit program
The program supports saving and loading your work in a simple text format. After drawing elements on the canvas, press the "Pohrani" button and a use the File Explorer pop-up to select a name and destination for your file.
smiley.txt
@OVAL 259 152 231 179
@OVAL 366 158 337 186
@LINE 196 219 301 262
@LINE 300 262 360 237
Serialized files can be loaded back into the program, allowing you to resume editing.
The program also supports exporting to .SVG, so you can view and edit your masterpieces in any other vector editing software.
Vectr depends on numpy and multipledispatch, so grab those in your local package manager
pip install numpy
pip install multipledispatch
After that, simply run the main.py in your favorite python-supporting console
python main.py

