Skip to content

mholik301/vectr

Repository files navigation

Vectr - vector drawing program

Vectr interface

Purpose

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

Tools and usage

  1. shape select&edit tool

    1. drag with mouse or use arrow keys - move selected object
      1. +shift for faster movement
    2. ctrl + mouse click - select multiple objects
      1. g and u - group and ungroup
      2. + and - - layer up and down
  2. shape delete tool controls

    1. Use mouse as a pen to draw a shape around or through the objects you want to delete
  3. General

    1. esc - deselect tool
    2. end - exit program

Usage

Serialization

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.

Installation and running

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

About

Simple vector-graphic program, based on a model-view architecture, written in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages