1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Computational geometry algorithms
//!
//! This module provides a collection of fundamental computational geometry algorithms
//! including sweep line intersection detection, bounding rectangle computation,
//! Fortune's algorithm for Voronoi diagrams, and incremental 3D convex hull construction.
//!
//! # Modules
//!
//! - [`sweep_line`] - Bentley-Ottmann sweep line algorithm for line segment intersections
//! - [`bounding`] - Minimum bounding rectangles, AABB, polygon perimeter/area utilities
//! - [`fortune_voronoi`] - Fortune's sweep line algorithm for Voronoi diagram construction
//! - [`incremental_hull_3d`] - Incremental 3D convex hull using DCEL data structure
//!
//! # Examples
//!
//! ## Line Segment Intersection Detection
//!
//! ```
//! use scirs2_spatial::computational_geometry::sweep_line::{Segment2D, find_all_intersections};
//!
//! let segments = vec![
//! Segment2D::new(0.0, 0.0, 2.0, 2.0),
//! Segment2D::new(0.0, 2.0, 2.0, 0.0),
//! ];
//!
//! let intersections = find_all_intersections(&segments).expect("Operation failed");
//! assert_eq!(intersections.len(), 1);
//! ```
//!
//! ## Bounding Rectangle
//!
//! ```
//! use scirs2_spatial::computational_geometry::bounding::{axis_aligned_bounding_box, polygon_perimeter};
//! use scirs2_core::ndarray::array;
//!
//! let points = array![[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]];
//! let aabb = axis_aligned_bounding_box(&points.view()).expect("Operation failed");
//! assert!((aabb.area() - 1.0).abs() < 1e-10);
//! ```
//!
//! ## Fortune's Voronoi
//!
//! ```
//! use scirs2_spatial::computational_geometry::fortune_voronoi::fortune_voronoi_2d;
//!
//! let sites = vec![[0.0, 0.0], [1.0, 0.0], [0.5, 1.0]];
//! let diagram = fortune_voronoi_2d(&sites).expect("Operation failed");
//! assert_eq!(diagram.num_sites(), 3);
//! ```
//!
//! ## 3D Convex Hull
//!
//! ```
//! use scirs2_spatial::computational_geometry::incremental_hull_3d::IncrementalHull3D;
//!
//! let points = vec![
//! [0.0, 0.0, 0.0], [1.0, 0.0, 0.0],
//! [0.0, 1.0, 0.0], [0.0, 0.0, 1.0],
//! ];
//! let hull = IncrementalHull3D::new(&points).expect("Operation failed");
//! assert_eq!(hull.num_faces(), 4);
//! ```
// Re-export key types for convenience
pub use ;
pub use ;
pub use ;
pub use ;