Crate boostvoronoi[][src]

Expand description

The boostvoronoi Rust library provides functionality to construct a Voronoi diagram of a set of points and linear segments in 2D space with the following set of limitations:

  • Coordinates of the input points and endpoints of the input segments should have integral type. The i32 and i64 data types are supported by the default implementation.

  • Input points and segments should not overlap except their endpoints. This means that input point should not lie inside the input segment and input segments should not intersect except their endpoints.

This library is a port of the C++ boost voronoi implementation


A simple 2d axis aligned bounding box.

The sweepline algorithm implementation to compute Voronoi diagram of points and non-intersecting segments (excluding endpoints). Complexity - O(N*logN), memory usage - O(N), where N is the total number of input geometries.

Represents a Voronoi cell.

Typed container for voronoi Cell indices

Voronoi output data structure based on data wrapped in Rc<Cell<T>>.

Half-edge data structure. Represents a Voronoi edge.

Typed container for voronoi Edge indices

A really simple 2d line type - integer only

A really simple 2d coordinate container type - integer only

This is a simple affine transformation object. Inadvertently it also serves as a type converter F<->I<->i32 It can pan and zoom but not rotate.

Sync version of the boostvoronoi::Diagram struct. This is useful when traversing the diagram in a multi threaded environment.

Represents Voronoi vertex aka. Circle event.

Typed container for voronoi Vertex indices

Utilities class, that contains set of routines handful for visualization.


The Error type of the library

Represents the type of input geometry a voronoi Cell was created from


This is the integer input type of the algorithm. i32 or i64.

This is the floating point output type of the algorithm. f32 or f64.


Convert from one numeric type to another.

Reads an example from a buffer using the format used by C++ boost voronoi:

Reads an example file in the file format used by C++ boost voronoi:

Helper function: Affine transforms and casts a slice of [[integer,integer,integer,integer]] into input data for the Builder.

Try to convert from one numeric type to another

Type Definitions