created a union type for lines, and do make it work had to chance line.point to line.startpoint, along with some changes to edgeintersection(line, poly), but this still has some weirdnesses for overlapping edges