Skip to main content

Computational Geometry Library

Project description

PyPI GitHub

compute-geometry is a research-focused computational geometry library for Python. This library is designed to provide a set of tools and algorithms for solving geometric problems.

Installation

You can install the compute-geometry library using pip:

uv add compute-geometry

Getting Started

import cgeom

Here are some examples to demonstrate how to use the Geometry library:

# Example 1: Compute the convex hull of a set of points

from cgeom.algorithms import ConvexHull

# create a list of points
points = [(326, 237),(373, 209), (378, 265), (443, 241), (396, 231), (416, 270), (361, 335), (324, 297)]

# create a convex hull object with the list of points
convex_hull = ConvexHull(points)

# plot the convex hull
convex_hull.plot()

# print the indexes of the points that form the convex hull
print('Convex Hull: ', convex_hull.get_indexes())


# Example 2: Compute Voronoi diagram of a set of points

from cgeom.algorithms import VoronoiDiagram

# load a set of points
points = np.loadtxt("./points1.txt")

# create a voronoi diagram object
voronoi = VoronoiDiagram(points)

# build the voronoi diagram
cells = voronoi.build_voronoi_diagram()

# plot the voronoi diagram
voronoi.plot_voronoi(cells)

License

This library is licensed under the MIT License, allowing you to use, modify, and distribute it for both commercial and non-commercial purposes.

Start exploring the world of computational geometry with the compute-geometry library in Python!

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

compute_geometry-0.1.1.tar.gz (351.2 kB view details)

Uploaded Source

Built Distribution

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

compute_geometry-0.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file compute_geometry-0.1.1.tar.gz.

File metadata

  • Download URL: compute_geometry-0.1.1.tar.gz
  • Upload date:
  • Size: 351.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for compute_geometry-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0908ceee6e3cf37cc63f48b152efdc9ee20723973445f6306cd381bfb9d2341d
MD5 697f289f15c589acf0311c95726f18b8
BLAKE2b-256 c59c4a5c069f2e70887e731524d635678b19b763c1ca95091208cb64838b1725

See more details on using hashes here.

File details

Details for the file compute_geometry-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for compute_geometry-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d5771045571dfd63435eacd99720eb4f41b80afdc66512e8e8737c0c7820f09
MD5 e665f2c4e7ec2dac514a7b34c5440dc5
BLAKE2b-256 6e74b39880a4d3ea0983bb96ac85fd57e650edda94173745e0a6886717470924

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