https://github.com/anteru/luna
https://github.com/anteru/luna
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anteru/luna
- Owner: Anteru
- License: bsd-2-clause
- Created: 2020-11-23T14:26:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-28T19:45:55.000Z (over 4 years ago)
- Last Synced: 2025-02-02T01:17:41.583Z (5 months ago)
- Language: Python
- Homepage: https://sh13.net/projects/Luna/
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Luna
====**Luna** is a tiny vector-based drawing library. It currently uses ``svgwrite`` to produce SVG output and Cairo for PNG and PDF.
License
-------**Luna** is licensed under the two-clause BSD license. See ``LICENSE.txt`` for details.
Installation
------------Install ``svgwrite`` and ``cairocffi`` using PIP:
pip install svgwrite cairocffi
You can now use **Luna** by using ``import luna``. If only SVG output is required, the ``cairocffi`` module can be omitted, and vice versa for PNG & PDF output. There are no further dependencies for **Luna**. However, the examples require ``numpy``.
Design goals
------------* Easy to use
* Efficient instancing: It should be possible to create prototype objects and distribute them in the scene
* Pure Python: It should be possible to run a pure-Python version with no external dependencies. This is particularly important for Windows.**Luna** is designed as a declarative, object-oriented drawing system. All primitives are represented as objects and assembled into a tree. This tree is eventually processed by the backends and converted into the target format. The abstraction is modeled after common 2D drawing libraries and standards. It should be possible to provide backends in every popular 2D drawing toolkit.
General usage
-------------The main class in Luna is ``Drawing``, which represents a drawing. Elements can be freely created and added to the drawing using ``Add``.