Skip to main content

GImpact-Python

An unofficial python extension for the GImpact collision library. This extension integrates directly with GImpact's C++ API using Cython.

Features

  • Create trimesh object from numpy array
  • Mesh decimation using Sven Forstmann's C++ mesh simplification code
  • Axis Aligned Bounding Box (AABB)
  • AABB set for box prunning
  • Collision of triangle mesh with the following
    • triangle mesh
    • sphere
    • capsule
    • plane
    • ray
  • Supports "first contact" or "all contacts" modes

Build Wheel

pip install -q build
python -m build

Installation

Build requires numpy and cython (tested on Linux and Windows).

pip install gimpact

Example Usage

AABB

import gimpact


aabb1 = gimpact.AABB(-1, 1, -1, 1, -1, 1)
aabb2 = gimpact.AABB(-1, 1, -1, 1, 1.5, 2)

print(aabb1.intersects(aabb2))
print(aabb1.intersection(aabb2))

aabb1.merge(aabb2)
print(aabb1)

Box Prunning

import gimpact

aabb_set = gimpact.AABBSet(10)
print(len(aabb_set))
print(aabb_set.global_bounds)
for aabb in aabb_set:
    aabb.bounds = (0., 0., 0., 0., 0., 0.)

for aabb in aabb_set:
    print(aabb)

print(aabb_set.global_bounds)
pairs = aabb_set.find_intersections(aabb_set)
print(pairs)

del aabb_set
print(aabb.bounds)

Collision

import gimpact
import numpy as np

contacts = gimpact.trimesh_trimesh_collision(trimesh1, trimesh2)
contacts = gimpact.trimesh_sphere_collision(trimesh1, [0., 0., 0.], 1, True)
contacts = gimpact.trimesh_capsule_collision(trimesh1, np.array([0., 0., 0.]), np.array([1., 0., 0.]), 1, True)
contacts = gimpact.trimesh_plane_collision(trimesh1, [0., 0., 1., 0.], True)

Metadata

Release files for gimpact 1.0.2

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

Source distribution (sdist)

Source distribution for gimpact 1.0.2
File Size Uploaded
gimpact-1.0.2.tar.gz 66.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for gimpact 1.0.2
File
gimpact-1.0.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
gimpact-1.0.2-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details
gimpact-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
gimpact-1.0.2-cp313-cp313-macosx_10_13_universal2.whl CPython 3.13 CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) Details
gimpact-1.0.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
gimpact-1.0.2-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details
gimpact-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
gimpact-1.0.2-cp312-cp312-macosx_10_13_universal2.whl CPython 3.12 CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) Details
gimpact-1.0.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
gimpact-1.0.2-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details
gimpact-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
gimpact-1.0.2-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 10.3 MB

Release files / gimpact-1.0.2.tar.gz

Download URL gimpact-1.0.2.tar.gz
Size 66.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2992b1936c76d9c112364beef0dc42756e10f4367352245e26bde21677ecb3fc
BLAKE2b-256 checksum
How to use checksums
d2dd575aeaa958d78dbd1c0c8f5be666405e1ebea7a092e288b577207d33661a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp313-cp313-win_amd64.whl

Download URL gimpact-1.0.2-cp313-cp313-win_amd64.whl
Size 142.1 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
48a093c6bf1fa7eae368c155c4a0c22966c7b05cf374248ca9a5288a72ee71c7
BLAKE2b-256 checksum
How to use checksums
f1e99b772b7f22ff2b0832be96d825a801f9a8b8cf66120f1dc237648142d0b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL gimpact-1.0.2-cp313-cp313-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
3ab270db8ac2c390309ef89efd636fa1d54b2cebefa66948025647d6f50bf874
BLAKE2b-256 checksum
How to use checksums
b897318f8afc5b956dfc34c8ae7df697c2d4c24517591bdf0c10d82c3e25c805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gimpact-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 991.8 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
39f0f96a6ba538a2ed7d9514a7da1bd5803de4e1d4c99a06b2998d13609a7202
BLAKE2b-256 checksum
How to use checksums
8c9e66d7ee964b4c9596325e5f27fe35370fc2b3bed063f92f69a2c25cf8ea7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp313-cp313-macosx_10_13_universal2.whl

Download URL gimpact-1.0.2-cp313-cp313-macosx_10_13_universal2.whl
Size 308.2 kB
Tags CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
44e7295fc2f7efc1e5015edd73250725cf04df6d9b545483d1b06ac50c092e27
BLAKE2b-256 checksum
How to use checksums
428f075ce6595615eee756395666c1874468e00ba09a6edfe712b2fe27e5ed5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp312-cp312-win_amd64.whl

Download URL gimpact-1.0.2-cp312-cp312-win_amd64.whl
Size 142.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
87b2898b10bcb9aa5d605a2b282be3929a46cfd4777ad17b75788901a8cfddc9
BLAKE2b-256 checksum
How to use checksums
883ee290e04137e5cd92b234f6025d129846f0c8d2d55dee81023895e4469211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL gimpact-1.0.2-cp312-cp312-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
417207bced543ad3fe64395da8f8417bc81d75ec6711bbdfe27e9ba10d2ac089
BLAKE2b-256 checksum
How to use checksums
c68ee429830d623eaa1c55ee3973d8a26ae64a6c96ddff936e304a402ce9118c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gimpact-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 994.8 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
07241e25e7f87c9c2dd566d4cc17b2d40202725c1a956251baca93f24a5cec0d
BLAKE2b-256 checksum
How to use checksums
4dfbc7a934ece365bf7c359974b9d36241289bea4da07ada17cf95981add6c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp312-cp312-macosx_10_13_universal2.whl

Download URL gimpact-1.0.2-cp312-cp312-macosx_10_13_universal2.whl
Size 309.6 kB
Tags CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
e27df1b43014b45d505bfc11b5bc08d6ca9e73c317cd903d2c2fe14cb6d77fbc
BLAKE2b-256 checksum
How to use checksums
f07dcd05ff4793daf28e45be9639b1969d639cc0b6c846b8d60db0c6f61c089f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp311-cp311-win_amd64.whl

Download URL gimpact-1.0.2-cp311-cp311-win_amd64.whl
Size 141.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c5ddbe56f20647dc8cd713251790de6e909f2ea421a6eab7dbca8a5f8cd41168
BLAKE2b-256 checksum
How to use checksums
e6c0a354ae609ed8ab3b850686e5559ba0678e8f3b4ccbd1fb878ce627668a1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL gimpact-1.0.2-cp311-cp311-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
a49e85a0dfa498b26f8eb7aac565f3b9f6f67478a257bb3ac9344c5a080e0d52
BLAKE2b-256 checksum
How to use checksums
c673693a2c1668543a9126627ae30a492732cd2a9b41733dcfe017e3fb91cce5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gimpact-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 940.0 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4cc34d9a42ac243ed2727ac5606bb625ac385de75564f890db46bb0487c80da9
BLAKE2b-256 checksum
How to use checksums
29b212cf153a72be02196fc621c1472d5722b074dd6db78fefdee9331c2d9ee4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / gimpact-1.0.2-cp311-cp311-macosx_10_9_universal2.whl

Download URL gimpact-1.0.2-cp311-cp311-macosx_10_9_universal2.whl
Size 308.3 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
2b358ba0c8166e40bbf80ad18a2ce886f6f2f157e61f529234c4cc7ffaa9d837
BLAKE2b-256 checksum
How to use checksums
6437bea951397dae8d7398e0b74a8dd2f80a20593a297d1dce195cfcf3ad43fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

1.0.2 This release

13 release files

1.0.1

17 release files

1.0.0

3 release files

0.1.2

3 release files

0.1.1

1 release file

0.1.0

1 release file

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