diff --git a/src/geometry/with_rtree.rs b/src/geometry/with_rtree.rs index 49d2301..b6f6d1d 100644 --- a/src/geometry/with_rtree.rs +++ b/src/geometry/with_rtree.rs @@ -177,6 +177,8 @@ impl< } pub fn remove_dot(&mut self, dot: DI) { + // One of the possible causes: you have failed to delete navcord's final + // termseg. debug_assert!(self.geometry.joined_segs(dot).next().is_none()); debug_assert!(self.geometry.joined_bends(dot).next().is_none()); diff --git a/src/math/bitangents.rs b/src/math/bitangents.rs index 271a2d4..404ad57 100644 --- a/src/math/bitangents.rs +++ b/src/math/bitangents.rs @@ -70,7 +70,7 @@ fn bitangent_point_pairs( circle1: Circle, circle2: Circle, ) -> Result, NoBitangents> { - let bitangents: Vec<(Point, Point)> = _bitangents(circle1, circle2) + let point_pairs: Vec<(Point, Point)> = _bitangents(circle1, circle2) .into_iter() .map(|tg| { ( @@ -80,11 +80,10 @@ fn bitangent_point_pairs( }) .collect(); - if bitangents.is_empty() { + if point_pairs.is_empty() { return Err(NoBitangents(circle1, circle2)); } - - Ok(bitangents) + Ok(point_pairs) } pub fn bitangents( diff --git a/src/router/draw.rs b/src/router/draw.rs index 2055375..f99ac61 100644 --- a/src/router/draw.rs +++ b/src/router/draw.rs @@ -83,7 +83,7 @@ impl Draw for Layout { into: FixedDotIndex, width: f64, ) -> Result { - let tangent = self + let bitangent = self .drawing() .guide_for_head_into_dot(&head, into, width) .map_err(Into::::into)?; @@ -96,7 +96,7 @@ impl Draw for Layout { self.extend_head( recorder, head, - tangent.start_point(), + bitangent.start_point(), |this, recorder| match head.face() { DotIndex::Fixed(dot) => this .add_lone_loose_seg( diff --git a/src/router/navcorder.rs b/src/router/navcorder.rs index d37426f..6e39e4e 100644 --- a/src/router/navcorder.rs +++ b/src/router/navcorder.rs @@ -94,6 +94,7 @@ impl Navcorder for Layout { let length = navcord.path.len(); self.undo_path(navcord, length - prefix_length); + // XXX: If this fails now, there may be a race condition. self.path(navmesh, navcord, &path[prefix_length..]) }