honeycomb_kernels/grisubal/routines/
insert_intersecs.rs1use honeycomb_core::{cmap::CMap2, geometry::CoordsFloat, stm::atomically_with_err};
6
7use crate::cell_insertion::insert_vertices_on_edge;
8
9use super::{DartSlices, IntersectionsPerEdge};
10
11pub(crate) fn insert_intersections<T: CoordsFloat>(
12 cmap: &CMap2<T>,
13 edge_intersec: &IntersectionsPerEdge<T>,
14 dart_slices: &DartSlices,
15) {
16 for ((edge_id, vs), new_darts) in edge_intersec.iter().zip(dart_slices.iter()) {
17 atomically_with_err(|trans| {
18 insert_vertices_on_edge(
19 cmap,
20 trans,
21 *edge_id,
22 new_darts,
23 &vs.iter().map(|(_, t, _)| *t).collect::<Vec<_>>(),
24 )
25 })
26 .unwrap();
27 }
28}