Allows you to draw beautiful matrices.
Project description
Drawing on a matrix
What is this?
The module allows you to create a symbolic matrix and draw different lines on it, after which you can convert the drawn lines into a beautiful structure.
Quick Guide
Drawing a simple, beautiful line:
my_picture = РЎanvas_matrix(10,10)
my_picture.makeline(1, 1, 8, 9)
my_picture.beautify()
my_picture.pt()
Using
Using the library is as simple and convenient as possible:
Let's import it first:
First, import everything from the library (use the from
... import *
construct).
To start working with the module, you need to create an object with the class Canvas_matrix
, in this case we are creating a 10 by 10 matrix filled with spaces:
my_picture = РЎanvas_matrix(10,10," ")
This class has several methods that will help you master this library:
.pt()
- prints the entire matrix, if pt = True, the garden will be printed after printing for the next print:
my_picture.pt(pt = False)
.makeline(x1, y1, x2, y2)
- draws a line at two points, the coordinates start at 1, that is, the coordinate at the upper left point will be [0,0]
my_picture.makeline(1, 1, 8, 9)
.point(x, y, r)
- draws a point in x, y coordinates with the same width and height r:
my_picture.point(5, 7, 2)
.local_draw
- stores the coordinates of the local drawing, you no longer need to count the coordinates from the origin, but only from the beginning of the local coordinates:
my_picture.local_draw = [x, y]
.beautify()
- Transforms a boring picture from identical symbols into a beautiful picture with different symbols:
my_picture.beautify()
an example of drawing a simple picture:
t = РЎanvas_matrix(10,25)
t.local_draw = [7,0]
t.makeline(0, 0, 4, 2)
t.makeline(20, 2)
t.makeline(25, -1)
t.local_draw = [2,4]
t.point(0,0)
t.point(10,-1)
t.beautify()
t.pt(False)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for matrixdraw-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1dd56c5537ca78603b2b0a495f3271eee6004009ec72b281ba118a1f01395b |
|
MD5 | 51bb67a8f7894aeddb7a5d29daeb45ec |
|
BLAKE2b-256 | 15466eb3ab870a978b59bfa361763e584094808104d6a6560fd857dafbc6a36b |