clipper2_rust/lib.rs
1#![forbid(unsafe_code)]
2
3//! # clipper2-rust
4//!
5//! A pure Rust port of the [Clipper2](https://github.com/AngusJohnson/Clipper2) polygon
6//! clipping and offsetting library by Angus Johnson.
7//!
8//! ## Features
9//!
10//! - **Boolean operations**: Intersection, Union, Difference, and XOR on polygons
11//! - **Polygon offsetting**: Inflate/deflate with Miter, Square, Bevel, and Round joins
12//! - **Rectangle clipping**: High-performance rectangular clipping
13//! - **Minkowski sum/difference**: Geometric Minkowski operations
14//! - **Path simplification**: Ramer-Douglas-Peucker and Clipper2's simplification
15//! - **PolyTree**: Hierarchical parent/child/hole polygon representation
16//! - **Dual precision**: Integer (`i64`) and floating-point (`f64`) coordinate support
17//!
18//! ## Quick Start
19//!
20//! ```rust
21//! use clipper2_rust::core::FillRule;
22//!
23//! let subject = vec![clipper2_rust::make_path64(&[100, 100, 300, 100, 300, 300, 100, 300])];
24//! let clip = vec![clipper2_rust::make_path64(&[200, 200, 400, 200, 400, 400, 200, 400])];
25//!
26//! let result = clipper2_rust::intersect_64(&subject, &clip, FillRule::NonZero);
27//! ```
28//!
29//! ## Coordinate Systems
30//!
31//! - [`Path64`] / [`Paths64`]: Integer coordinates (`i64`) — recommended for precision
32//! - [`PathD`] / [`PathsD`]: Floating-point coordinates (`f64`) — convenient for external data
33
34pub mod core;
35pub mod engine;
36pub mod engine_fns;
37pub mod engine_public;
38pub mod rectclip;
39pub mod version;
40
41pub mod clipper;
42pub mod minkowski;
43pub mod offset;
44pub mod utils;
45
46pub use clipper::*;
47pub use core::*;
48pub use engine::*;
49pub use engine_fns::*;
50pub use engine_public::*;
51pub use minkowski::*;
52pub use offset::*;
53pub use rectclip::*;
54pub use version::*;