for (i = 0; i < segs.length; i++) {
                segsByCol[segs[i].col].push(segs[i]);
            }