Skip to main content

Computational Geometry Library

Project description

Welcome to the compute-geometry library, a comprehensive computational geometry library for Python. This library is designed to provide a set of tools and algorithms for solving geometric problems, making it a valuable resource for developers and researchers working in areas such as computer graphics, robotics, and geographic information systems.

Features

  • Geometry Primitives: Efficient implementations of fundamental geometric primitives, including points, lines, and polygons.

  • Algorithms: A variety of computational geometry algorithms, such as convex hull computation, line segment intersection, and Voronoi diagram generation.

  • Geometry Operations: Functions for performing common geometric operations, such as distance calculations, area computations, and geometric transformations.

  • Visualization: Functions for visualizing geometric objects and algorithms using Matplotlib.

  • Documentation: Comprehensive documentation with usage examples to help you quickly integrate the library into your projects.

Installation

You can install the compute-geometry library using pip:

pip install compute-geometry

Getting Started

To get started with the compute-geometry library, import it into your Python script or project:

import compute-geometry as cgeom

Explore the library's documentation to understand the available functionality and how to use it effectively.

Examples

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.voronoi 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)

Contributing

Contributions to the compute-geometry library are welcome! If you have additional algorithms, improvements, or bug fixes, please submit a pull request. Be sure to follow the contribution guidelines outlined in the repository.

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.0.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

compute_geometry-0.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: compute_geometry-0.1.0.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for compute_geometry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 003c318f2441ed919a954d27a11779bc6d39fcc1d30be851477ddefc15771079
MD5 2e0c75c8e546ab4099e69918b73a03dc
BLAKE2b-256 8d0ad984882f519face3477bee2cc39b93b42080eb09ed31c53b088e7bb590cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for compute_geometry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bd1dbc2c233508025dad32e70dcd50ee343f286592e99fc73b74baaef3923bf
MD5 6da1562c866a10b53ce533b7e2410ae8
BLAKE2b-256 99a4e9878b059b9c1d352fb763e9ff68e85f018dc118ee5d407e432df02617e7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page