<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -67,7 +67,7 @@ puts &quot;thread ------&gt;&quot;
             # from the given starting node, and travelling in the given direction
             # around the far node.
 
-            @midpoint = @edge.virtual_midpoint(@node, @direction, :exit)
+            @midpoint = @edge.virtual_midpoint(@node, @direction, :start)
 
             return continue_thread
           end
@@ -95,7 +95,6 @@ puts &quot;   vector:     %s&quot; % vector
 puts &quot;   midpoint:   %s&quot; % @midpoint
 puts &quot;   direction:  %s&quot; % @direction
 puts &quot;   difference: %f&quot; % difference
-
         @thread.add_connection(@midpoint, vector, 4.5 * difference)
 
         @edge.mark(@node, @direction)</diff>
      <filename>lib/celtic_knot/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -174,12 +174,17 @@ module CelticKnot
     # This will be a point offset some distance from the natural midpoint,
     # colinear with the edge. In this case, the direction parameter is
     # ignored, and the midpoint returned will always be the one nearest the
-    # reference node if phase is :enter, and the furthest if phase is :exit.
+    # reference node if phase is :enter, and the furthest if phase is :start.
     def virtual_midpoint(reference, direction, phase)
-      direction = midpoint - reference
-      distance = length/3
-      offset = phase == :enter ? -1 : 1 # FIXME: don't hardcode the cable width
-      return reference + direction.normalize * (distance + offset)
+      direction = (midpoint - reference).normalize
+
+      if phase == :start
+        return reference + direction * 0.75 * length
+      elsif phase == :enter
+        return reference + direction * 0.25 * length
+      else
+        raise ArgumentError, &quot;unknown phase: #{phase.inspect}&quot;
+      end
     end
 
     def vector(parallel, direction)</diff>
      <filename>lib/celtic_knot/edge.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>825d93ff04f5064f7222704271f3abc1250f3ef7</id>
    </parent>
  </parents>
  <author>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </author>
  <url>http://github.com/jamis/celtic_knot/commit/95db7ecc70ce48b0688610361d4598e2ae1311ba</url>
  <id>95db7ecc70ce48b0688610361d4598e2ae1311ba</id>
  <committed-date>2009-06-07T12:18:06-07:00</committed-date>
  <authored-date>2009-06-07T12:18:06-07:00</authored-date>
  <message>compute midpoint of ignored edges better</message>
  <tree>da89f8b745dfeb9613fd426ba6c490d3921be492</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
