Skip to main content

zinglplotter

Zingl-Bresenham plotting algorithms.

The Zingl-Bresenham plotting algorithms are from Alois Zingl's "The Beauty of Bresenham's Algorithm" ( http://members.chello.at/easyfilter/bresenham.html ). They are all MIT Licensed and this library is also MIT licensed. In the case of Zingl's work this isn't explicit from his website, however from personal correspondence "'Free and open source' means you can do anything with it like the MIT licence[sic]."

These algorithms are error-carry-forward algorithms such that they use only integer math to plot pixel positions, and curves like quadratic and cubic beziers do not need to be turned into tiny lines or checked for how small a line should be used. They merely travel from one pixel to the next pixel carrying the error forward.

Functions

This library is a series of plot line generators converted from C++.

  • plot_line(x0, y0, x1, y1)
  • plot_quad_bezier_seg(x0, y0, x1, y1, x2, y2)
  • plot_quad_bezier(x0, y0, x1, y1, x2, y2)
  • plot_cubic_bezier_seg(x0, y0, x1, y1, x2, y2, x3, y3)
  • plot_cubic_bezier(x0, y0, x1, y1, x2, y2, x3, y3)
  • plot_line_aa(x0, y0, x1, y1)
  • plot_line_width(x0: int, y0: int, x1: int, y1: int, wd: float)

These do Zingl-Bresenham algorithms for line, quad, cubic. The _seg function perform the draw but only for rational segments (no inversion points). The _aa function performs the same thing but in an anti-alias manner.

from zinglplotter import plot_line
for x, y in plot_line(0, 0, 5, 8):
    print(f"({x},{y})")

Will result in: python (0,0) (1,1) (1,2) (2,3) (3,4) (3,5) (4,6) (4,7) (5,8)

from zinglplotter import plot_quad_bezier
for x, y in plot_quad_bezier(0, 0, 9, 4, 0, 10):
    print(f"({x},{y})")

Will result in: (0,0) (1,0) (2,1) (3,2) (4,3) (5,4) (5,5) (5,5) (5,6) (4,7) (3,8) (2,9) (1,9) (0,10)

Metadata

Release files for zinglplotter 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zinglplotter 1.0.0
File Size Uploaded Provenance Actions
zinglplotter-1.0.0.tar.gz 9.0 kB Without provenance Details for zinglplotter-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zinglplotter 1.0.0
File Interpreter ABI Platform Actions
zinglplotter-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for zinglplotter-1.0.0-py2.py3-none-any.whl

Total release size: 18.1 kB

Release files / zinglplotter-1.0.0.tar.gz

Download URL zinglplotter-1.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
49b6e137f2f1fdebf1c8dda3f8265aa0a1db2ca1f91eb27ebaa8929dda2a4673
BLAKE2b-256 checksum
How to use checksums
57a24938988abb6da05033a00c87b97062c825d5f729b52ac862626897664a40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / zinglplotter-1.0.0-py2.py3-none-any.whl

Download URL zinglplotter-1.0.0-py2.py3-none-any.whl
Size 9.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ece471de6e8d6aacb7c6c55b31f8a43c41af842f4e172291d01a4d726e44b1b6
BLAKE2b-256 checksum
How to use checksums
ab4325bd09590dc20b72e53e027fccebac1665eb62e6f09242bcc443f4e4dc58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Security for zinglplotter 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page