2D and 3D computational geometry library which scales from prototyping to production
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.
Geometric operations, transforms, and primitives, in 2D and 3D.
The most commonly used of these are directly imported into
- 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.
finds a rotation and translation that closely transforms one set of points to
another. Its cousin
find_rigid_rotationdoes 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.
- 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.
pip install polliwog
import numpy as np from polliwog import Polyline # ...
- Issue Tracker: https://github.com/lace/polliwog/issues
- Source Code: https://github.com/lace/polliwog
Pull requests welcome!
If you are having issues, please let us know.
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.
The project is licensed under the two-clause BSD license.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size polliwog-0.12.0-py2-none-any.whl (56.5 kB)||File type Wheel||Python version py2||Upload date||Hashes View|
|Filename, size polliwog-0.12.0-py3-none-any.whl (56.5 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size polliwog-0.12.0.tar.gz (28.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for polliwog-0.12.0-py2-none-any.whl
Hashes for polliwog-0.12.0-py3-none-any.whl