// determine width of the lane at that point
double width = (i % 2 == 0)
? v.distanceTo(vs.get(i+1))
: v.distanceTo(vs.get(i-1));
// determine whether this vertex should get the higher or
// lower t coordinate from the vertex pair
boolean higher = i % 2 == 0;