here's something i came up with that has the basic idea. it still
needs some refining though.
i took your idea about using lerp() to create a number of points. i
then took the second example from the lerp() reference here:
http://processingjs.org/reference/lerp_/ which is of a line running
parallel to a series of lerped points. instead of making points, i
changed it to create a line at that point, but i "plussed" and
"minused" the line so that it would create a dash with the lerped
point as the center.
one thing this "solution" is missing (among others i'm sure!) is that
the first and last dash will extend beyond the initial and ending
point.
size(300,300);
int x1 = 15;
int y1 = 10;
int x2 = 280;
int y2 = 290;
line(x1, y1, x2, y2);
for(int i=0; i<=10; i++) {
float x = lerp(x1, x2, i/10.0) + 10;
float y = lerp(y1, y2, i/10.0);
point(x, y);
line(x-5, y-5, x + 5, y + 5)
}