diff --git a/src/drawing/drawing.rs b/src/drawing/drawing.rs index 03e219f..ce942c0 100644 --- a/src/drawing/drawing.rs +++ b/src/drawing/drawing.rs @@ -728,35 +728,27 @@ impl Drawing { let (from, to, offset) = if let Some(inner) = rail_primitive.inner() { let inner = inner.into(); - let from = self.guide_for_head_around_bend_segment( + let from = self.guide_for_head_around_bend( &from_head, inner, RotationSense::Counterclockwise, width, )?; - let to = self.guide_for_head_around_bend_segment( - &to_head, - inner, - RotationSense::Clockwise, - width, - )?; - let offset = self.guide_for_head_around_bend_offset(&from_head, inner, width); + let to = + self.guide_for_head_around_bend(&to_head, inner, RotationSense::Clockwise, width)?; + let offset = self.offset_for_guide_for_head_around_bend(&from_head, inner, width); (from, to, offset) } else { let core = rail_primitive.core().into(); - let from = self.guide_for_head_around_dot_segment( + let from = self.guide_for_head_around_dot( &from_head, core, RotationSense::Counterclockwise, width, )?; - let to = self.guide_for_head_around_dot_segment( - &to_head, - core, - RotationSense::Clockwise, - width, - )?; - let offset = self.guide_for_head_around_dot_offset(&from_head, core, width); + let to = + self.guide_for_head_around_dot(&to_head, core, RotationSense::Clockwise, width)?; + let offset = self.offset_for_guide_for_head_around_dot(&from_head, core, width); (from, to, offset) }; diff --git a/src/drawing/guide.rs b/src/drawing/guide.rs index c675f2d..0b916ec 100644 --- a/src/drawing/guide.rs +++ b/src/drawing/guide.rs @@ -20,7 +20,7 @@ use super::{ }; impl Drawing { - pub fn guide_for_head_into_dot_segment( + pub fn guide_for_head_into_dot( &self, head: &Head, into: FixedDotIndex, @@ -36,7 +36,7 @@ impl Drawing { math::tangent_segment(from_circle, from_sense, to_circle, None) } - pub fn guide_for_head_around_dot_segments( + pub fn guides_for_head_around_dot( &self, head: &Head, around: DotIndex, @@ -52,7 +52,7 @@ impl Drawing { Ok((tangents[0], tangents[1])) } - pub fn guide_for_head_around_dot_segment( + pub fn guide_for_head_around_dot( &self, head: &Head, around: DotIndex, @@ -67,7 +67,7 @@ impl Drawing { math::tangent_segment(from_circle, from_sense, to_circle, Some(sense)) } - pub fn guide_for_head_around_dot_offset( + pub fn offset_for_guide_for_head_around_dot( &self, head: &Head, around: DotIndex, @@ -79,7 +79,7 @@ impl Drawing { ) } - pub fn guide_for_head_around_bend_segments( + pub fn guides_for_head_around_bend( &self, head: &Head, around: BendIndex, @@ -95,7 +95,7 @@ impl Drawing { Ok((tangents[0], tangents[1])) } - pub fn guide_for_head_around_bend_segment( + pub fn guide_for_head_around_bend( &self, head: &Head, around: BendIndex, @@ -110,7 +110,7 @@ impl Drawing { math::tangent_segment(from_circle, from_sense, to_circle, Some(sense)) } - pub fn guide_for_head_around_bend_offset( + pub fn offset_for_guide_for_head_around_bend( &self, head: &Head, around: BendIndex, diff --git a/src/router/draw.rs b/src/router/draw.rs index c65a2f6..58faa69 100644 --- a/src/router/draw.rs +++ b/src/router/draw.rs @@ -85,7 +85,7 @@ impl Draw for Layout { ) -> Result { let tangent = self .drawing() - .guide_for_head_into_dot_segment(&head, into, width) + .guide_for_head_into_dot(&head, into, width) .map_err(Into::::into)?; let (layer, maybe_net) = { @@ -139,10 +139,10 @@ impl Draw for Layout { ) -> Result { let tangent = self.drawing() - .guide_for_head_around_dot_segment(&head, around.into(), sense, width)?; - let offset = self - .drawing() - .guide_for_head_around_dot_offset(&head, around.into(), width); + .guide_for_head_around_dot(&head, around.into(), sense, width)?; + let offset = + self.drawing() + .offset_for_guide_for_head_around_dot(&head, around.into(), width); self.cane_around( recorder, head, @@ -168,10 +168,10 @@ impl Draw for Layout { ) -> Result { let tangent = self .drawing() - .guide_for_head_around_bend_segment(&head, around, sense, width)?; + .guide_for_head_around_bend(&head, around, sense, width)?; let offset = self .drawing() - .guide_for_head_around_bend_offset(&head, around, width); + .offset_for_guide_for_head_around_bend(&head, around, width); self.cane_around( recorder,