Crate boostvoronoi

Source
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 https://www.boost.org/doc/libs/1_76_0/libs/polygon/doc/voronoi_main.htm

Structs§

Aabb2
A simple 2d axis aligned bounding box.
Builder
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.
Cell
Represents a Voronoi cell.
CellIndex
Typed container for voronoi Cell indices
Diagram
Voronoi output data structure based on data wrapped in Rc<Cell<T>>.
Edge
Half-edge data structure. Represents a Voronoi edge.
EdgeIndex
Typed container for voronoi Edge indices
Line
A really simple 2d line type - integer only
Point
A really simple 2d coordinate container type - integer only
SimpleAffine
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.
SyncDiagram
Sync version of the boostvoronoi::Diagram struct. This is useful when traversing the diagram in a multi threaded environment.
Vertex
Represents Voronoi vertex aka. Circle event.
VertexIndex
Typed container for voronoi Vertex indices
VoronoiVisualUtils
Utilities class, that contains set of routines handful for visualization.

Enums§

BvError
The Error type of the library
SourceCategory
Represents the type of input geometry a voronoi Cell was created from

Traits§

InputType
This is the integer input type of the algorithm. i32 or i64.
OutputType
This is the floating point output type of the algorithm. f32 or f64.

Functions§

cast
Convert from one numeric type to another.
read_boost_input_buffer
Reads an example from a buffer using the format used by C++ boost voronoi:
read_boost_input_file
Reads an example file in the file format used by C++ boost voronoi:
to_segments_offset
Helper function: Affine transforms and casts a slice of [[integer,integer,integer,integer]] into input data for the Builder.
try_cast
Try to convert from one numeric type to another

Type Aliases§

ColorType
SourceIndex