Exemplo n.º 1
0
def _possible_starting_lines(lm):
    start_line = lm.outside_lines.pop()
    lm.outside_lines.add(start_line)
    line = start_line.right
    bay_starts = []
    # Find seed lines
    while line != start_line:
        if util.angle_between_line_and_next(line) < math.pi * 0.4:
            bay_starts.append(line)
        line = line.right
    return bay_starts
Exemplo n.º 2
0
 def check_concave(self, line):
     if line.a == line.right.b:
         self.remove_floating_lines()
         if self.verbose: print 'weird line error'
         return False
     if not self.check_intersections(line.a, line.right.b): return False
     if util.angle_between_line_and_next(line) > math.pi*0.75 \
         or line.length + line.right.length > self.lm.base_distance*3.5:
         return True
     new_line = self.make_line(line.a, line.right.b, line.left, line.right.right)
     line.left.right = new_line
     line.right.right.left = new_line
     self.lm.lines.add(new_line)
     self.lm.outside_lines.add(new_line)
     self.remove_line_from_outside(line)
     self.remove_line_from_outside(line.right)
     self.num_lines -= 1
     self.add_terr([(line.a.x, line.a.y, 
                     line.b.x, line.b.y, 
                     line.right.b.x, line.right.b.y)], 
                   [line, line.right, new_line],
                   (0,1,0,1))
     return False