Skip to main content

A collision detection package

Project description

The Group and Collide classes form a modular 2D collision detection system with clear separation of concerns. Group serves as a data container managing coordinate points and geometric shape creation. It supports rectangle, circle, triangle, and polygon generation through the create_shape() method, handling vertex storage, validation, and basic point operations (add/clear/get). For circular shapes, the num_vertices parameter controls polygon approximation precision (typically 8-32 vertices). Collide acts as a stateless utility class providing five core static methods: is_colliding_with() uses the Separating Axis Theorem to detect shape intersections; contains_point() implements ray-casting algorithm for point-in-polygon tests; get_bounding_box() computes axis-aligned bounding boxes; get_collision_points() identifies intersection coordinates between shapes; And contains_shape() verifies full containment of one shape within another. This architecture enables flexible integration into games, simulations, and interactive applications, balancing computational efficiency with geometric accuracy through robust floating-point tolerance handling and optimized projection calculations.

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

collide-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

collide-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file collide-0.1.0.tar.gz.

File metadata

  • Download URL: collide-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for collide-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1feccae1eb81ec0df042a19972ae4348d2c2aecd57de0d5defb811b7cef8e134
MD5 70b4575e119b104ca83ebe3ebd11108b
BLAKE2b-256 016dd9cdb30451ae370db448d7426213b7e2f6a657306a0c1ef5acae5b4eedc7

See more details on using hashes here.

File details

Details for the file collide-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: collide-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for collide-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2709065da387ed61735d99203b46b9ede461ad6ea9ab9c9f57a9b0acb18cfa50
MD5 8bc766f62e3cc4f27c45f99cf41ab30a
BLAKE2b-256 62f09d6cfd40020dacbb2fafeb793f9a7f60686872573a6397e242295f89c346

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