@@ -211,10 +211,10 @@ def inorder_extend(v, v1, v2, ints):
211211
212212
213213 # extend vector rings by intersections
214- for k , v in intersections_a .iteritems ():
214+ for k , v in intersections_a .items ():
215215 inorder_extend (v_a , k [0 ], k [1 ], v )
216216
217- for k , v in intersections_b .iteritems ():
217+ for k , v in intersections_b .items ():
218218 inorder_extend (v_b , k [0 ], k [1 ], v )
219219
220220
@@ -249,7 +249,7 @@ def print_edge():
249249
250250 output = []
251251 while edge_fragments :
252- start = edge_fragments .keys ()[0 ]
252+ start = list ( edge_fragments .keys () )[0 ]
253253 current = edge_fragments [start ][0 ]
254254 sequence = [start ]
255255
@@ -427,7 +427,7 @@ def inorder_extend(v, v1, v2, ints):
427427
428428
429429 # add self-intersection points to poly
430- for k , v in ints .iteritems ():
430+ for k , v in ints .items ():
431431 inorder_extend (pts , k [0 ], k [1 ], v )
432432
433433 # build a list of loops
@@ -833,8 +833,9 @@ def contains_point_s(pts, p) :
833833 # p is not on the boundary, cast ray and intersect to see if we are inside
834834 intersections = set (intersect_poly_ray (pts , p , p + Vector (1 ,0 )))
835835
836+
836837 # filter intersection points that are boundary points
837- for int_point in filter (lambda x : x in pts , intersections ):
838+ for int_point in set ( filter (lambda x : x in pts , intersections ) ):
838839
839840 i = pts .index (int_point )
840841 prv = pts [i - 1 ]
0 commit comments