Skip to content

Voronoi diagram clipped on a Polygon

License

Notifications You must be signed in to change notification settings

alonfnt/boundvor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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