Created
August 29, 2013 02:05
-
-
Save calvinmetcalf/6373541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0, m = open ? n : n + 1; i < m; ++i) { | |
var point = points[(i + k) % n], | |
p = coincidences.peek(point); | |
if (!linesEqual(p, t)) { | |
var tInP = t.every(function(line) { return p.indexOf(line) >= 0; }), | |
pInT = p.every(function(line) { return t.indexOf(line) >= 0; }); | |
if (tInP) a.push(point); | |
arc(a); | |
if (!tInP && !pInT) arc([a[a.length - 1], point]); | |
if (pInT) a = [a[a.length - 1]]; | |
else a = []; | |
} | |
if (!a.length || pointCompare(a[a.length - 1], point)) a.push(point); // skip duplicate points | |
t = p; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment