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(as shown below)

right_click_image

__goto fonts and select Raster Fonts and of font size 88 and save it__ (as shown below)(take a note of your previous settings cause its highly probabable that you wont like this font)

fontsize

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 start

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

2d end

3d start

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

3d end

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.0.1.tar.gz (81.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asciigraphics-0.0.1-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asciigraphics-0.0.1.tar.gz
  • Upload date:
  • Size: 81.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for asciigraphics-0.0.1.tar.gz
Algorithm Hash digest
SHA256 07e34777e788f397b4c29ef61418e774cb3b430aacb80ac4d3a8e570a97b280a
MD5 f6895ace6541b22991c18a42cf675c18
BLAKE2b-256 6642e0ee1a220d520c1ede5b2fbe4af77cade988eeb02429ffb92daa740bd404

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asciigraphics-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for asciigraphics-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa14238a7a8fe96a9ecda93ae95d0785379cb7c94257cb745ab930acd29ec7db
MD5 d25751f3b39645a6a792b8d5466998c3
BLAKE2b-256 9959a78b8c86268471ee50b9f65eaec62825b1f4bd81d976bddb009cbd2eaa26

See more details on using hashes here.

Supported by

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