An ergonomic and programmatic drawing library for python.
Project description
robodraw is an ergonomic and programmatic drawing library for python. It is a
wrapper around matplotlib that provides a more intuitive way to specifically
create drawings and diagrams, including in pseudo-3d. It provides the backend
for the drawing functionality in quimb and
cotengra.
Some useful features include:
- no boilerplate to get a simple drawing.
- plot limits automatially expand to fit all drawn elements.
- style presets: reuse style across elements.
- diagram primitives like
zigzag,curve(draw a smooth line through an arbitrary set of points exactly), andpatch_around(draw a smooth shape highlighting an arbitrary set of points). - pseudo-3d drawing, with automatic perspective and occlusion handling.
- squared paper grid to help you with placement.
- output or use existing matplotlib figure and axis.
- basic colors tools
- ... and more!
A quick example:
import robodraw
d = robodraw.Drawing(
presets={
"node": {"radius": 0.2, "linewidth": 0.5},
"edge": {"color": (0, 0.3, 1, .8), "width": 0.04, "shorten": 0.2}
},
projection=(25, 25),
)
center = (0, 0, 0)
corners = [(1, 1, 1), (1, -1, -1), (-1, 1, -1), (-1, -1, 1)]
# nodes
for c in corners:
color = robodraw.hash_to_color(str(c))
d.circle(c, preset='node', color=color)
# center
d.circle(center, preset='node', radius=0.15, color="black")
d.text(center, "$\\psi$", color="yellow")
# edges to center
for c in corners:
d.zigzag(c, center, preset="edge")
d.patch_around(corners, radius=0.5)
d.grid3d()
The full documentation can be found at: robodraw.readthedocs.io. Contributions of any sort are very welcome - please see the contributing guide. Issues and pull requests are hosted on github. For other questions and suggestions, please use the discussions page.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robodraw-0.1.0.tar.gz.
File metadata
- Download URL: robodraw-0.1.0.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f022fe98f055cc20488cf05177f1649e98d8c9383a5ff900649ce0f13a9acd1b
|
|
| MD5 |
fdb349464747a9f9b292b0e8d778d172
|
|
| BLAKE2b-256 |
4ab9cf6a4c4c5ab62d6c920f5ad3502ab646e22375ea5ccf8a2460f5f5432e91
|
Provenance
The following attestation bundles were made for robodraw-0.1.0.tar.gz:
Publisher:
pypi-release.yml on jcmgray/robodraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
robodraw-0.1.0.tar.gz -
Subject digest:
f022fe98f055cc20488cf05177f1649e98d8c9383a5ff900649ce0f13a9acd1b - Sigstore transparency entry: 1551574547
- Sigstore integration time:
-
Permalink:
jcmgray/robodraw@89ab2b34e3bd9952c5cc009e0cc6df6311c2b494 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jcmgray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@89ab2b34e3bd9952c5cc009e0cc6df6311c2b494 -
Trigger Event:
release
-
Statement type:
File details
Details for the file robodraw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: robodraw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf9024b9773a5f04f507e44f234cb6d5769bb756afae5adcdb246241522b0b6c
|
|
| MD5 |
797e19028a078392436a113cd2507128
|
|
| BLAKE2b-256 |
a64efdf7754444233dd5100ee30d6741025da0f112bdb9ee852f299ded51cda0
|
Provenance
The following attestation bundles were made for robodraw-0.1.0-py3-none-any.whl:
Publisher:
pypi-release.yml on jcmgray/robodraw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
robodraw-0.1.0-py3-none-any.whl -
Subject digest:
cf9024b9773a5f04f507e44f234cb6d5769bb756afae5adcdb246241522b0b6c - Sigstore transparency entry: 1551574560
- Sigstore integration time:
-
Permalink:
jcmgray/robodraw@89ab2b34e3bd9952c5cc009e0cc6df6311c2b494 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jcmgray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@89ab2b34e3bd9952c5cc009e0cc6df6311c2b494 -
Trigger Event:
release
-
Statement type: