Skip to main content

pyGeom2D

Python package to create 2D geometries.

Getting Started

Installation

pip install pyGeom2D

Usage Examples

Cartesian coordinate axes + points

from pygeom import Axes, Point

# Create the cartesian axis
axes = Axes(xlim=(-1,8), ylim=(-1,18), figsize=(9,7))

# Create two points
p1 = Point(2,  5, color='#ffa500')
p2 = Point(7, 17, color='#0000ff')

axes.addMany([p1, p2])
axes.draw()

Line Demo

from pygeom import Axes, Point, Line

# Create the cartesian axis
axes = Axes(xlim=(-1,7), ylim=(-1,7), figsize=(7,6))

# Points
p1 = Point(1, 1, color='red')
p2 = Point(5, 4, color='green')

l = Line(p1=p1, p2=p2)

axes.addMany([p1, p2, l])
axes.draw("line_demo.png")

Triangle Demo

from pygeom import Axes, Point, Triangle

# Create the cartesian axis
axes = Axes(xlim=(-1,10), ylim=(-1,10), figsize=(12,10))

# Points
p1 = Point(1, 1, color='grey')
p2 = Point(5, 5, color='grey')
p3 = Point(8, 5, color='grey')

tr = Triangle(p1, p2, p3, alpha=0.5)

axes.addMany([p1, p2, p3])
axes.add(tr)
axes.draw()

Rectangle Demo

from pygeom import Axes, Point, Rectangle

# Create the cartesian axis
axes = Axes(xlim=(-1,7), ylim=(-1,7), figsize=(12,10))

# Points
bottomLeft = Point(1, 1, color='red')
topRight = Point(5, 4, color='green')

shape = Rectangle(bottomLeft, topRight, alpha=0.5)

axes.addMany([bottomLeft, topRight])
axes.add(shape)
axes.draw()

Polygon Demo

from pygeom import Axes, Point, Polygon

# Create the cartesian axis
axes = Axes(xlim=(-1,10), ylim=(-1,10), figsize=(12,10))

# Points
p1 = Point(1, 1, color='red')
p2 = Point(1, 2, color='green')
p3 = Point(4, 7, color='red')
p4 = Point(9, 1, color='green')


shape = Polygon([p1, p2, p3, p4], alpha=0.5)

axes.addMany([p1, p2, p3, p4])
axes.add(shape)
axes.draw()

Release files for pyGeom2D 0.1.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 pyGeom2D 0.1.2
File Size Uploaded
pyGeom2D-0.1.2.tar.gz 66.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyGeom2D 0.1.2
File Interpreter ABI Platform
pyGeom2D-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 77.8 kB

Release files / pyGeom2D-0.1.2.tar.gz

Download URL pyGeom2D-0.1.2.tar.gz
Size 66.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9ac5c8622b72e48592b7bcc574867f348d771b3638527637531b30532fc009e2
BLAKE2b-256 checksum
How to use checksums
51107dfb221fcb50b3442d3b9301891ec9e1d043c21a035b55323f914e003eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.9

Release files / pyGeom2D-0.1.2-py3-none-any.whl

Download URL pyGeom2D-0.1.2-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ac569917fb6dec50a791ad071c34c77f587d257d5cce0c3758931342ac3a128
BLAKE2b-256 checksum
How to use checksums
6c5cff31b203bb8bfc4ee709442e5bc8acf739dfe8f8c9064c32d0cce4ee14fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

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