use super::ray_cast::*;
use super::super::path::*;
use super::super::graph_path::*;
use super::super::super::super::geo::*;
pub fn path_add_chain<POut>(paths: &Vec<Vec<impl BezierPath<Point=POut::Point>>>, accuracy: f64) -> Vec<POut>
where
POut: BezierPathFactory,
POut::Point: Coordinate+Coordinate2D,
{
let mut merged_path = GraphPath::new();
for (path_idx, path) in paths.iter().enumerate() {
let path_idx = path_idx as u32;
merged_path = merged_path.collide(GraphPath::from_merged_paths(path.iter().map(|path| (path, PathLabel(path_idx)))), accuracy);
}
merged_path.round(accuracy);
merged_path.set_edge_kinds_by_ray_casting(|path_crossings| {
for count in path_crossings.iter() {
if (count&1) != 0 {
return true;
}
}
false
});
merged_path.heal_exterior_gaps();
merged_path.exterior_paths()
}