iOverlay
The iOverlay is a fast poly-bool library supporting main operations like union, intersection, difference, and XOR, governed by either the even-odd or non-zero rule. This algorithm is based on Vatti clipping ideas but is an original implementation.
Documentation
Try out iOverlay with an interactive demo. The demo covers operations like union, intersection, difference and exclusion
Features
- Operations: union, intersection, difference, and exclusion.
- Polygons: with holes, self-intersections, and multiple paths.
- Simplification: removes degenerate vertices and merges collinear edges.
- Fill Rules: even-odd and non-zero.
Working Range and Precision
The i_overlay library operates within the following ranges and precision levels:
Extended Range: From -1,000,000 to 1,000,000 with a precision of 0.001. Recommended Range: From -100,000 to 100,000 with a precision of 0.01 for more accurate results. Utilizing the library within the recommended range ensures optimal accuracy in computations and is advised for most use cases.
Getting Started
Add the following to your Cargo.toml:
[dependencies]
i_float
i_shape
i_overlay
Example
Here is a simple example that demonstrates how to use the iOverlay library for polygon union operations.
use FixVec;
use ;