Simplify CurveLocation data structures.

Directly creating and linking intersections simplifies things a lot.
This commit is contained in:
Jürg Lehni 2015-09-09 17:17:49 +02:00
parent 78e0bae6aa
commit 04452730dd
5 changed files with 74 additions and 90 deletions
src/path

View file

@ -110,11 +110,13 @@ var PathItem = Item.extend(/** @lends PathItem# */{
startConnected: length1 === 1,
// After splitting, the end is always connected:
endConnected: true,
adjust: function(loc) {
reparametrize: function(t1, t2) {
// Since the curve was split above, we need to
// adjust the parameters for both locations.
loc._parameter /= 2;
loc._parameter2 = 0.5 + loc._parameter2 / 2;
return {
t1: t1 / 2,
t2: (1 + t2) / 2
};
}
}
);