Skip to content

geometry module #2267

Open
Open
@itzpr3d4t0r

Description

@itzpr3d4t0r

I'm pleased to inform you that the pygame-geometry library has started being ported to the pygame-ce repository.

The primary goal is to enhance the functionality of the library by introducing several new types of shapes, while retaining the familiar features found in pygame's Rect or Frect classes.

The main portion of the functionality consists of the following shape classes:

  • Circle
  • Line
  • Polygon

Each shape includes the following:

  • Transformation functions such as scale, rotate, move, and update.
  • Collision functions, allowing each shape to collide with other shapes, as well as points, Rects, and Frects.
  • A variety of utility and situational methods.

Please note that the current pygame-geometry codebase may contain functionality that will not be included in the port or may undergo significant modifications.

If you are interested in exploring the complete codebase for the project or help with the port, you can find it here:

Integration Progress

The integration is happening in phases, starting with Circle and later Line and Polygon. Each shape will then be slowly built upon piece by piece.

At the moment the Line object is being actively ported

Circle

Attributes

Methods


Line

Attributes

Methods


Polygon

  • Polygon object

Attributes

  • vertices
  • verts_num
  • center
  • centerx, centery
  • perimeter
  • area

Methods

  • move / move_ip
  • copy
  • collidepoint
  • collideline
  • collidecircle
  • insert_vertex
  • remove_vertex
  • pop_vertex
  • is_convex
  • scale / scale_ip
  • as_segments
  • as_rect
  • rotate / rotate_ip
  • collidelist / collidelistall
  • intersect

Rect & Frect

Methods


Other

  • regular_polygon
  • raycast
  • multiraycast
  • Integrate Circle into draw.circle
  • Integrate Line into draw.line
  • Integrate Polygon into draw.polygon

Metadata

Metadata

Assignees

No one assigned

    Labels

    New APIThis pull request may need extra debate as it adds a new class or function to pygameenhancementgeometrypygame.geometry

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions