Skip to main content

No project description provided

Project description

geomanpy

Python bindings for glam and wreck — fast geometric/linear-algebra primitives and collision detection, backed by Rust.

geomanpy exposes glam's vectors, quaternions, matrices and affine transforms, plus wreck's collision shapes and broad/narrow-phase queries, as native Python classes. Every type integrates with NumPy and behaves like a dataclass for serialization frameworks.

Features

  • Linear algebraVec2, Vec3, Vec4, Quat, Mat3, Mat4, Affine3 with the full glam method surface (normalization, projection, interpolation, Euler conversions, projection/view matrices, …).
  • Collision shapesSphere, Capsule, Cuboid, Cylinder, ConvexPolytope, ConvexPolygon, Line, Ray, LineSegment, Plane, Pointcloud, plus SphereCollection and Collider aggregates.
  • Transform & query protocols — shared Scalable, Transformable, Bounded, Stretchable, and Collides interfaces across shapes (scaled, translated, rotated_quat, transformed, broadphase, obb, aabb, collides).
  • NumPy interopfrom_numpy/to_numpy and the __array__ protocol on every primitive.
  • Serialization — instances expose __dataclass_fields__ so orjson, msgspec, and pydantic treat them as dataclasses; pickling is supported via __getnewargs_ex__.
  • Fully typed — ships a py.typed marker and complete .pyi stubs.

Installation

pip install geomanpy

Usage

import numpy as np
from geomanpy import Vec3, Quat, Sphere, Cuboid, Collider

# Linear algebra
a = Vec3(1.0, 2.0, 3.0)
b = Vec3.from_numpy(np.array([4.0, 5.0, 6.0]))
print(a.dot(b), a.cross(b).to_numpy())

# Rotations
q = Quat.from_rotation_z(np.pi / 2)
print((q * Vec3.X).to_numpy())

# Collision detection
ball = Sphere(Vec3.ZERO, radius=1.0)
box = Cuboid.from_aabb(Vec3(0.5, 0.5, 0.5), Vec3(2.0, 2.0, 2.0))
print(ball.collides(box))

# Aggregate many shapes behind a single broad/narrow-phase query
scene = Collider()
scene.add(box)
print(scene.collides(ball))

Convenience aliases are provided for common names: Quaternion (Quat), Rotation3d (Mat3), Translation3d (Vec3), Transform3d (Affine3), Box3d (Cuboid), Sphere3d (Sphere), Cylinder3d (Cylinder), ObstacleUnion (Collider), and PointCloud (Pointcloud).

Backends

geomanpy can target two Python runtimes, selected at build time by Cargo feature:

  • pyo3-backend (default) — builds a CPython extension module via PyO3.
  • rustpython-backend — registers a geomanpy module inside an embedded RustPython VM, reusing the same wrapper types.

Exactly one backend must be active. The optional safe-locks feature switches mutable wrappers to RustPython's PyRwLock.

Building from source

The CPython wheel is built with maturin:

maturin develop   # build and install into the active virtualenv
maturin build --release

License

Licensed under the Apache License, Version 2.0.

Project details


Download files

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

Source Distribution

geomanpy-0.3.0.tar.gz (93.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

geomanpy-0.3.0-cp314-cp314t-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

geomanpy-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

geomanpy-0.3.0-cp37-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.7+Windows x86-64

geomanpy-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

geomanpy-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

geomanpy-0.3.0-cp37-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

File details

Details for the file geomanpy-0.3.0.tar.gz.

File metadata

  • Download URL: geomanpy-0.3.0.tar.gz
  • Upload date:
  • Size: 93.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6d75b70025b57304ad3876d41a4f00598631ec686c92fbe94f39ef29cf3b0436
MD5 8d379ddb8e3914a2392cb4ef9a96532a
BLAKE2b-256 bfcd43215e59e74dd9ac70504a7ff5c59bd647af9bb5e1890d33f270aaad2e83

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 11499fb9193c4e9efa6ca2038b18f19e8aa5cf4962e6d4d8bacd7181de424ef0
MD5 a9a4b1c633d440bba577848638251833
BLAKE2b-256 6d9dda3d4dd139ad13bd0dee2b843d321a9e1352aa0ba5b1f4e29e2c1da6005b

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.14t, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 044ba7e3b95df85cdfe0e1ff233dd2bf06f807e5c16ffdba2795a103a2378b3a
MD5 666a793f6672f79c153d54306f092a02
BLAKE2b-256 12e22a1dc3f632aee320f6572537412773f8f620c2f414cffb1f9d319292336f

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.14t, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6fc1f762c4f03ee6d65aac3a9de4044623d67821112c1be8ecc37ca7998ee88b
MD5 605f5affdc0e4413d2eaa6ed222c141a
BLAKE2b-256 f81d6d0d961633560901ddab667fc08f2e7942bee158a6a1ea6db71714110abd

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.14t, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d991fd7931f81dee5815de9cd40ab4d23ba695a1a93df541f1bd5dc91f336bd5
MD5 43c90185664684cbd5d27ca41a3f013c
BLAKE2b-256 ea6a1fb3097ec4e0e4a0a60f97b5e90ec49ffcc2abac55b76021601663a50bac

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6659d8f6811e748e63dd1bea077a2e955659bcd2e81ccb24ff8401c4a6226389
MD5 77149adb49092abfa1b5abfb1efed88d
BLAKE2b-256 f6a1b4f3634b1bb0f1eb771ffae070c3d903802cb0ee2eb949745f9354945282

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4974c8dfc1a22b9397d3a47d1e23b0cc3f28d311afcbfb5d337153b6b87668ac
MD5 b1ae7fbb05cf4b90dd20b7439d977f84
BLAKE2b-256 9873c4a18e8f7bba82aa833546b90cd2c0a7c22f290f8fdc75f4eecddb094167

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7+, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bee2f73d60834114bed4c8fbb92e067b7f48eff5e5ae38b973161da3f3142873
MD5 b5d9ff3b1af791b45f6eb3225a616742
BLAKE2b-256 6753ccf70ea53e734e067ff59ffc3450114de68c16e5c0f0da6079761e7b66e6

See more details on using hashes here.

File details

Details for the file geomanpy-0.3.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: geomanpy-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geomanpy-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca9f433a6e06fcba0d6b8ffaf851dde31b407051f620780c5a96869ceafff0b3
MD5 39f9908de86254f6e268801858e5a346
BLAKE2b-256 2f63672e6d587cdfb1a1b9bd5e3b9fd0a7eecc1d44c3e22668ab5a6ffd76becd

See more details on using hashes here.

Supported by

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