cache = VertexCache(self.cache_size)
island = []
+ face_neighbors = []
island_strips = []
while 1:
if not island:
n.flag = True
queue.append(n)
+ face_neighbors = [f.get_neighbors() for f in island]
+
# Unflag the island for the next phase
for f in island:
f.flag = False
# or along borders of a non-closed island.
best = 5
face = None
- for f in island:
+ for i, f in enumerate(island):
if f.flag:
continue
- score = sum(not n.flag for n in f.get_neighbors())
+ score = sum(not n.flag for n in face_neighbors[i])
if score>0 and score<best:
face = f
best = score