a = [0 -40 -5
-10 -30 -5
-15 -20 -5
-17.5 -10 -5
-20 0 -5
-17.5 10 -5
-15 20 -5
-10 30 -5
0 40 -5
0 -15 0
0 15 0
-3 -7 0
-3 7 0
4 0 0
-4 0 0
3 -7 0
3 7 0];

a(:,1) = a(:,1) + 100*pi/2

scale =  max(max(a)) - min(min(a));

a = (a/scale)*256;

offset = min(min(a))

a = ceil(a-offset)