mod plotter;
mod ring_hierarchy;
mod solvent;
mod tiler;
mod vertex_graph;
use ring_hierarchy::RingHierarchy;
use vertex_graph::VertexGraph;
pub use plotter::{Plotter, PlotterBuilder};
pub use solvent::{Solvent, SolventBuilder};
pub use tiler::{AnnotatedCell, ContainmentMode, Tiler, TilerBuilder};
pub(crate) use tiler::cell_boundary;
fn coord_is_valid(coord: geo::Coord) -> bool {
use crate::TWO_PI;
use std::f64::consts::PI;
coord.x.is_finite()
&& coord.y.is_finite()
&& coord.x >= -TWO_PI
&& coord.x <= TWO_PI
&& coord.y >= -PI
&& coord.y <= PI
}
fn neighbors(cell: crate::CellIndex, scratchpad: &mut [u64]) -> usize {
let mut count = 0;
for candidate in cell.grid_disk_fast(1) {
if let Some(neighbor) = candidate {
scratchpad[count] = neighbor.into();
count += 1;
} else {
count = 0;
break;
}
}
if count == 0 {
for candidate in cell.grid_disk_safe(1) {
scratchpad[count] = candidate.into();
count += 1;
}
}
count
}