C, 291 280 277277 273 bytes
r,x,y,A,C,B,D,a,c,b,d,w,s,t;T(i){return abs(i)<2*w-1;}U(j,k){s+=T(j-k)*T(j)*T(k);t*=T(j-k)*j*k<1;}main(){for(scanf("%i%i%i%i%i",&a,&b,&c,&d,&w);A=a;y<20;y+=!x)A=a-x,C=c-x,B=b-y,D=d-y,s=0,t=1,U(A,C),U(B,D),U(A-B,C-D),U(A+B,C+D),putchar((x=r%21x=++x%21)?".?#x"[!!s+t+(!A*!B+!C*!D)]:10),y<20;y=++r/21);}
// Integers...
r,x,y,A,C,B,D,a,c,b,d,w,s,t;
// Is true if i is in range (of something)
T(i){return abs(i)<2*w-1;}
// Tests if lasers (horizontal, vertical, diagonal, etc) can/must exist at this point
// T(j-k) == 0 iff the laser of this direction can exist
// s += 1 iff this laser direction can pass through this point
// t *= 1 iff this laser direction must pass through this point
U(j,k){
s+=T(j-k)*T(j)*T(k);
t*=T(j-k)*j*k<1;
}
main(){for(
// Read input; p0=(a,b), p1=(c,d)
for(scanf("%i%i%i%i%i",&a,&b,&c,&d,&w); y<20; y+=!x)
// A, B, C and D represent delta-x and delta-y for each points
// e.g.: if we're processing (2,3), and p0=(4,5), A=4-2, B=5-3
A=a-x,C=c-x,
B=b-y,D=d-y,
// s != 0 iff (x,y) can have some laser through it
// t == 1 iff all lasers pass through (x,y)
// (!A*!B+!C*!D) == 1 iff (x,y) is either p0 or p1
s=0,t=1,U(A,C),U(B,D),U(A-B,C-D),U(A+B,C+D),
putchar((x=r%21x=++x%21)?".?#x"[!!s+t+(!A*!B+!C*!D)]:10),
// End of for
y<20;y=++r/21);
}