2D and 3D computational geometry library which scales from prototyping to production
Project description
polliwog
2D and 3D computational geometry library which scales from prototyping to production.
Includes vectorized geometric operations, transforms, and primitives like planes, polygonal chains, and axis-aligned bounding boxes. Implemented in pure Python/NumPy. Lightweight and fast.
The goals of this project are:
- Keep dependencies light and deployment flexible.
- Keep the library working in current versions of Python and other tools.
- Respond to community contributoions.
- Eventually provide a complete set of functionality for this problem domain.
Features
Geometric operations, transforms, and primitives, in 2D and 3D.
The most commonly used of these are directly imported into
polliwog
.
- polliwog.Box represents an axis-aligned cuboid.
- polliwog.Plane represents a 2-D plane in 3-space (not a hyperplane).
- polliwog.Polyline represents an unconstrained polygonal chain in 3-space.
polliwog.transform
includes code for 3D transforms.
- polliwog.transform.CompositeTransform represents a composite transform using homogeneous coordinates. (Thanks avd!)
- polliwog.transform.CoordinateManager provides a convenient interface for named reference frames within a stack of transforms and projecting points from one reference frame to another.
- polliwog.transform.find_rigid_transform
finds a rotation and translation that closely transforms one set of points to
another. Its cousin
find_rigid_rotation
does the same, but only allows rotation, not translation. - polliwog.transform.rotation.rotation_from_up_and_look produces a rotation matrix that gets a mesh into the canonical reference frame from "up" and "look" vectors.
Other modules:
- polliwog.tri.barycentric provides a function for projecting a point to a triangle using barycentric coordinates.
- polliwog.segment provides functions for working with line segments in n-space.
Installation
pip install polliwog
Usage
import numpy as np
from polliwog import Polyline
# ...
Contribute
- Issue Tracker: https://github.com/lace/polliwog/issues
- Source Code: https://github.com/lace/polliwog
Pull requests welcome!
Support
If you are having issues, please let us know.
Acknowledgements
This collection was developed at Body Labs and includes a combination of code developed at Body Labs, from legacy code and significant new portions by Eric Rachlin, Alex Weiss, and Paul Melnikow. It was extracted from the Body Labs codebase and open-sourced by Alex Weiss into a library called blmath, which was subsequently forked by Paul Melnikow. This library and the 3D geometry and linear-algebra toolbelt vg were later extracted.
License
The project is licensed under the two-clause BSD license.
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 Distributions
File details
Details for the file polliwog-1.0.0b1.tar.gz
.
File metadata
- Download URL: polliwog-1.0.0b1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02ba559f188661dfe9bba9cbdfc9c85dc46ecd24eb18ccfdc00e34a558a89d2c |
|
MD5 | e75b630e9ac4aad796bb4dbb9a11bae3 |
|
BLAKE2b-256 | d471ae89d2fa91b637de0722eae7df1f323b278661b4270a8f4a0f5b1c49f07b |
File details
Details for the file polliwog-1.0.0b1-py3-none-any.whl
.
File metadata
- Download URL: polliwog-1.0.0b1-py3-none-any.whl
- Upload date:
- Size: 57.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f407aa0faef9bcdf454d53517581aa54d06bef284a796dbb415d37ad6d928a2 |
|
MD5 | 260d46b882cd22ed81efb6c149dc471c |
|
BLAKE2b-256 | 79f88a8cbca37e82099b0c2b31fc964e0fbbbe1f2ba6d20f62b51ca836d73178 |
File details
Details for the file polliwog-1.0.0b1-py2-none-any.whl
.
File metadata
- Download URL: polliwog-1.0.0b1-py2-none-any.whl
- Upload date:
- Size: 57.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c48fd7e0a16cc8dc3d5d577f5c19e39970a2330f2336055c42913d2bd4c6daf5 |
|
MD5 | 842ae83f5a6828a75bf5aa41670ab697 |
|
BLAKE2b-256 | b645f99057db4af8f1a68c83b6a6a6144c088bfd74b0b58279be10f065dcd48c |