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
andi64
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.
- Cell
Index - 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.
- Edge
Index - 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
- Simple
Affine - 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
Diagram - 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.
- Vertex
Index - Typed container for voronoi
Vertex
indices - Voronoi
Visual Utils - Utilities class, that contains set of routines handful for visualization.
Enums§
- BvError
- The Error type of the library
- Source
Category - Represents the type of input geometry a voronoi
Cell
was created from
Traits§
- Input
Type - This is the integer input type of the algorithm. i32 or i64.
- Output
Type - 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