for(stroke=poly->strokes;stroke;stroke=stroke->next) {
dict_put(todo, stroke, stroke);
assert(stroke->num_points>1);
count += stroke->num_points;
if(stroke->dir == DIR_UP) {
dict_put(d, &stroke->points[stroke->num_points-1], stroke);
for(stroke=poly->strokes;stroke;stroke=stroke->next) {
dict_put(todo, stroke, stroke);
assert(stroke->num_points>1);
count += stroke->num_points;
if(stroke->dir == DIR_UP) {
dict_put(d, &stroke->points[stroke->num_points-1], stroke);