Skip to main content

2D planar geometry library for Python.

Project description

Planar is a 2D geometry library for Python. It is intended for use by games and interactive real-time applications, but is designed to be useful for most any program that needs a convenient, high-performance geometry API.

Planar is being developed as part of the larger Grease game framework. However, it is a standalone library and has no external dependencies besides Python, and optionally a C compiler.

Planar is purely a math library, presentation, graphical or otherwise is left up to the application.

Project Goals

  • Do one thing, 2D geometry, and do it well.

  • Provide a high-level, clean, Pythonic API.

  • All APIs have both a Python reference implementation and a high performance implementation in C with the same interface.

  • Compatibility with Python 2.6+, and Python 3.1+

  • 100% test coverage.

  • Full narrative and API reference documentation.

  • Platform-independent.

  • Release early and often.

  • Be responsive to community input.

  • Don’t take ourselves too seriously.

License

Planar is distributed under the terms of the new BSD license. You are free to use it for commercial or non-commercial projects with little or no restriction, all we ask is that:

  • Redistributions of the code, in whole or part, retain the original copyright notice and license text.

  • You do not claim our endorsement of any derived product.

For a complete text of the license see the LICENSE.txt file in the source distrbution.

Acknowledgements

The API for planar, and some of the code is derived from the excellent work done by the Super Effective Team, thanks guys!

Requirements

Planar requires Python 2.6, 2.7, 3.1, or better.

To experience the exhilaration of native-code performance, a C compiler is required. If someone volunteers, binary releases for platforms where this is not common (you know who you are) will be happily made available.

Downloading Planar

Planar releases can be downloaded from the python package index (pypi):

You can get the latest code in development from the planar mercurial repository on bitbucket:

Installation

To build and install Planar from the source distribution or repository use:

python setup.py install

To install only the pure-Python modules without compiling, use:

python setup.py build_py install --skip-build

Only performance is sacrificed without the C extensions, all functionality is still available when using only the pure-Python modules.

Tests

Planar requires nose for testing. You can install it for Python 2.x using easy_install:

easy_install nose

For Python 3.x, you can download and install distribute from here:

For now, you can get a copy of nose3 for Python 3.x, patched to install properly on Python 3.1 here:

Once nose is installed you can run the tests from the source directory using nosetests, first building the C extensions, like so (on Unix):

python setup.py build && nosetests -d -w build/lib.*/planar/

This runs the tests inside the build directory so that the C extensions can be tested. You can put a 3 suffix on the python and nosetests commands above for Python 3.x.

Documentation

You can browse the documentation online here:

The same documentation is also available for offline browsing in the doc/build/html subdirectory of the source distribution.

Contributing and Getting Support

Come visit us at the Grease users google group to get help, moral support, lavish praise, complain bitterly, report a bug, or contribute ideas:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

planar-0.2.1.zip (252.3 kB view details)

Uploaded Source

planar-0.2.1.tar.gz (222.1 kB view details)

Uploaded Source

File details

Details for the file planar-0.2.1.zip.

File metadata

  • Download URL: planar-0.2.1.zip
  • Upload date:
  • Size: 252.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for planar-0.2.1.zip
Algorithm Hash digest
SHA256 c03259c2215cc4dc05cafb53cd40fe90c4d69198b93c9d505f0d71c041009a85
MD5 1f3fa126d9908d48eae2c62a59b00080
BLAKE2b-256 4985fed4b1dde38aafa0b583732f41df33e3c21d203ca2cfa5c509e4a3d2122c

See more details on using hashes here.

File details

Details for the file planar-0.2.1.tar.gz.

File metadata

  • Download URL: planar-0.2.1.tar.gz
  • Upload date:
  • Size: 222.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for planar-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7b270eb0c6d395a9239836c5cece2dbb2fcc3e3a7d574507673a600c83b85f03
MD5 c8a3155b0e6738021387ae19fca049ac
BLAKE2b-256 14f48f097ca424501195f5d19be049520d50c1126359260374a502a78d3675e8

See more details on using hashes here.

Supported by

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