Skip to main content

Bounded Voronoi diagram in Python

Project description

boundvor

A minimal Python library that provides a wrapper for scipy.spatial.Voronoi, clipping the resulting cells to a bounding polygon.

Installation

Install the package using pip:

pip install boundvor

Usage

import numpy as np
from boundvor import BoundedVoronoi

# Generate random points
points = np.random.rand(10, 2)

# Define a bounding box
bounding_box = np.array([[0., 0.], [0., 1.], [1., 1.], [1., 0.]])

# Create a bounded Voronoi diagram
voronoi = BoundedVoronoi(points, bounds=bounding_box)

License

MIT License

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

boundvor-0.1.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

boundvor-0.1.0-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

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