HashMap<QuadEdge, Double> qeDistances = new HashMap<QuadEdge, Double>();
for (QuadEdge qe : quadEdges) {
qeDistances.put(qe, qe.toLineSegment().getLength());
}
DoubleComparator dc = new DoubleComparator(qeDistances);
TreeMap<QuadEdge, Double> qeSorted = new TreeMap<QuadEdge, Double>(dc);
qeSorted.putAll(qeDistances);
// edges creation
int i = 0;