Skip to main content

Do Pixel Graphics with ascii charecters

Project description

ascii-graphics

Note to check the code goto src/asciianim.py on running code goes into full screen u can get out of the full screen by pressing f11

this is only available for windows operating systems right now (best used on windows 10)(could work on other operating systems - not tested)

we need to configure our command prompt to show us square texts or else program will give us a wroped in y direction result to do this *open command prompt *right click on top and goto defaults __goto fonts and select Raster Fonts and of font size 88 and save it__ (take a note of your previous settings cause its highly probabable that you wont like this font

install the software by using python -m pip install asciigraphics or in some systems py -m pip install asciigraphics or pip install asciigraphics

Usage :

Note: variable implies it has a default vaule

create a new python file

then first we need to import the module import asciigraphics as a

then we need to create canvas we can do that with function a.createcanvas() this creates a full screen canvas if u want to edit size and fulscreeness the arguments are a.createcanvas(width,height,bool_fullscreen)

a.draw() updates the screen a.clearbg() clear the screen

2d

a.point(x,y,color,intensity) places a point with given color and intensity at a given position

Note : intensity ranges from 0 to 68 int values color ranges from [0,0] to [15,15] int array values

a.line_2d(x1,y1,x2,y2,color,intensity,key) draws a line for given points,if key is set to true updates after drawing the line automatically if set to false we need to update it manually usefull for speed when u draw multiple lines u can update all of them at once

a.rect_2d(x1,y1,width,height,color,intensity,key) draws a rectangle with given width and height @ position x,y

a.ellipse_2d(xc, yc,rx, ry,color,intensity,key) draws a ellipse at xc,yc with radius rx,ry

a.arc_2d(x,y,r,a,color,intensity,key) draws an arc

a.scale_2d(s,color,intensity,key) scales the whole 2d space

a.transform_2d(x,y,color,intensity,key) transform the whole 2d space

a.rotate_at_2d(x,y,a,color,intensity,key) rotates the whole 2d space

a.fill(x,y,Nc,fillc,intensity,key,Pc) Nc is boder color and fillc is the fillcolor

a.text(x,y,string,color,key) puts a text at given location with warping

3d

make a 3d object in blender export it as an obj file and while exporting only tick the option triangulate faces and untick anything else to make sure this can import it

to import the obj file u can use the the function

obj = a.import_obj("(file location)..../objfile.obj")

u can draw this object with the function

a.Draw_Object(obj,at,showmesh,fillkey,key,light,camera)

this will draw the object at distance at if showmesh is set to true it will showmesh and fillkey is set to true it will fill the mesh

Note : here light and camera are of type vector3d created a by dataclass ie to change the light direction make a variable l = a.vector3d((float),(float),(float))

and hence this will draw the object

to rotate the points array we have function

a.rxa(angle,points) a.rya(angle,points) a.rza(angle,points)

to rotate points in obj variable

p = obj.p rxa(angle,p) or a.rya(angle,p) or a.rza(angle,p) obj.p = p

this will rotate points by a given angle

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asciigraphics-0.1.1.tar.gz (81.7 kB view details)

Uploaded Source

Built Distribution

asciigraphics-0.1.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file asciigraphics-0.1.1.tar.gz.

File metadata

  • Download URL: asciigraphics-0.1.1.tar.gz
  • Upload date:
  • Size: 81.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0

File hashes

Hashes for asciigraphics-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc5aedbc83c5040971775b2efbdd7de309d1325489875d34f6f3785c15e1ff42
MD5 d62b2adaab13051a32a9fc8ca3f68faf
BLAKE2b-256 122d8382bcb08bb7d46e65bb4e555ae39af467380ef199a0763930dc529eae3b

See more details on using hashes here.

File details

Details for the file asciigraphics-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: asciigraphics-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0

File hashes

Hashes for asciigraphics-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e36eebd354b3f96ec8ce116b03fb11b16cbfb16f91f81bd9acf87256a13c04
MD5 55ae96909c449fbb2d1286f26f290bfa
BLAKE2b-256 3d0ee420de5c574efb49ce3afc4a98444fcf9c51257cf2a70cca26924c6eba59

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page