https://github.com/timfi/dotmatrix Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} timfi / dotmatrix * Notifications * Star 10 * Fork 0 A dot matrix rendered using braille characters. pypi.org/project/dotmatrix/ GPL-2.0 License 10 stars 0 forks Star Notifications * Code * Issues 3 * Pull requests 0 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights root Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 2 tags Code * Clone HTTPS GitHub CLI [https://github.com/t] Use Git or checkout with SVN using the web URL. [gh repo clone timfi/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @timfi timfi fixed issue template renders ... 01bef93 Aug 16, 2021 fixed issue template renders 01bef93 Git stats * 23 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github fixed issue template renders Aug 16, 2021 .vscode Cleaned things up and added bezier curves Aug 16, 2021 dotmatrix spiced up readme some more Aug 16, 2021 .gitignore Add initial project setup Aug 12, 2021 .pre-commit-config.yaml Cleaned things up and added bezier curves Aug 16, 2021 LICENSE Added some publishing stuff Aug 16, 2021 README.md Cleaned up badges in readme a bit more Aug 16, 2021 poetry.lock Fixed isort install for dev setup Aug 16, 2021 pyproject.toml Fixed isort install for dev setup Aug 16, 2021 View code [ ] [d12345678] dotmatrix Description Install Example Drawing functions More examples Bezier curves Function plotting Development README.md [d12345678] dotmatrix A dot matrix rendered using braille characters. PyPI PyPI - Python Version PyPI - License Checked with mypy Code style: black Description This library provides class called Matrix which represents a dot matrix that can be rendered to a string of Braille characters. In addition the class also provides some usefull functions for drawing all kinds of things onto said matrix. Install Use can install this library from PyPI: pip install dotmatrix Example Code from dotmatrix import Matrix m = Matrix(64, 64) m.rectangle((0, 0), (63, 63)) m.circle((31, 31), 31) print(m.render()) Output [d12347]ccccccc[d148][d1467]xggcccccdg$x[d1478]cccccccc[d14568] [d1237] [d8][d67]ia c5[d78] [d4568] [d1237] [d8]9a e[d38] [d4568] [d1237] [d67]i @5[d7] [d4568] [d1237][d567]a :[d7][d4568] [d123678]b [d1268][d4568] [d123457] ^[d345678] [d1237] [d12345678] [d1237] [d12345678] [d1235678] [d568][d14568] [d12347][d237] [d2347][d4568] [d1237]^[d37] [d3457] [d4568] [d1237] @[d268] [d68]i [d4568] [d1237] e[d38][d7] [d78]9a [d4568] [d1237] @5[d38][d7] [d78]-i [d4568] [d12378][d78][d78][d78][d78][d78][d78][d78][d78][d478][d1478][d2578][d2578][d3678][d3678][d3678][d3678][d3678][d3578][d2578][d2478][d1478][d78][d78][d78][d78][d78][d78][d78][d78][d78][d45678] Drawing functions As of now this library contains the following drawing functions: * scatter - Scatters some points. * show - Draws an object implementing the Dotted protocol. * line - Draws a line. * chain - Draws a chain of segments. * polygon - Draws a polygon. * rectangle - Draws an axis aligned rectangle. (from a simplified representation, i.e. from two opposing corners) * cricle - Draws a circle. * ellipse - Draws an axis aligned ellipse. * plot - Plots a series of XY-coordinates. (matplotlib.pyplot style) * plotf - Plots a function. * curve - Draws a Bezier curve. Implementing the Dotted protocol for any class comes down to adding a __dots__ function to your class: def __dots__(self) -> Iterable[Tuple[int, int]]: """Generate the pixel positions representing this object.""" [?][?] The origin or the coordinate system, i.e. (0, 0), is at the top left corner! More examples Bezier curves Code from dotmatrix import Matrix m = Matrix(64, 64) m.curve((0, 0), (63, 0), (0, 63), (63, 63)) m.curve((0, 0), (0, 63), (63, 0), (63, 63)) m.curve((63, 0), (0, 0), (63, 63), (0, 63)) m.curve((63, 0), (63, 63), (0, 0), (0, 63)) print(m.render()) Output [d12347]cccc33--[d78][d7] [d8][d78]--33cccc[d14568] [d1237] @3[d38] [d67]3a [d4568] [d1268] e[d37] [d68]i [d3457] ^[d37] @[d237][d568]a [d68]b [d1268] [d1568][d2347] [d3457] @[d268] [d4568][d1237] [d357]a e[d38] [d4568][d1237] [d67]i c5-[d38][d78][d78][d78][d78][d78][d78][d45678][d12378][d78][d78][d78][d78][d78][d78][d67]-9c [d78]-33cccccc[d14568][d12347]cccccc33-[d78] [d67]i [d4568][d1237] e[d38] [d8]s [d4568][d1237] :[d7] [d3457] [d3457][d1268] [d1268] [d568]a [d68]b^[d37] @[d237] [d3457] [d67]b ^[d38] [d1268] [d1237] [d8][d67]i e[d38][d7] [d4568] [d12378][d78][d78][d78][d78]--93ca @c35--[d78][d78][d78][d78][d45678] Function plotting Code from dotmatrix import Matrix m = Matrix(64, 64) m.plotf( lambda x: 0.005 * x ** 3, range(-31, 31), origin=(31,31), ) print(m.render()) Output [d4568] [d1237] [d1568] @[d237] _[d7] :[d7] :[d7] @5[d38][d78][d78][d78][d78] c5[d7] @[d238] @[d237] _[d7] [d1268] ^[d37] [d1268] _[d7] Development In case you want to add some code to this project your need to first make sure you have poetry installed. Afterwards you can run the following commands to get your setup up and running: poetry install poetry shell pre-commit install Due note that you will have to commit from inside the virtual environment or you need to have the dev-tools installed in your local python installation. All PRs will be style checked with isort, pydocstyle and black as well as type checked with mypy. About A dot matrix rendered using braille characters. pypi.org/project/dotmatrix/ Topics python braille dotmatrix Resources Readme License GPL-2.0 License Releases 2 tags Languages * Python 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.