Did a test and the color thing works fine… it didn’t solve the gaps completely though.

Here’s a new bit of the script to try:

```
step = int(ceil(size*sqrt((co1[0]-co2[0])**2+(co1[1]-co2[1])**2)))
if step:
for t in range(step):
x = int(floor((co1[0] + t*(co2[0]-co1[0])/step) * size))
y = int(floor((co1[1] + t*(co2[1]-co1[1])/step) * size))
if bWrap.val:
x = x % wrapSize
y = y % wrapSize
else:
x = int ((x - minx) * scale)
y = int ((y - miny) * scale)
co = x * 3 + y * 3 * size;
img[co] = 0
img[co+1] = 0
img[co+2] = 0
if wsize > 1:
for x in range(-1*wsize + 1,wsize):
for y in range(-1*wsize,wsize):
img[co + 3 * x + y * 3 * size] = 0
img[co + 3 * x + y * 3 * size +1] = 0
img[co + 3 * x + y * 3 * size +2] = 0
for v in f:
x = int(v[0] * size)
y = int(v[1] * size)
if bWrap.val:
x = x % wrapSize
y = y % wrapSize
else:
x = int ((x - minx) * scale)
y = int ((y - miny) * scale)
co = x * 3 + y * 3 * size
img[co] = 0
img[co+1] = 0
img[co+2] = 255
```

Ok I updated this post a few times now.

Just a round didn’t fix it… you had to either round up or down. Rounding up worked fine but didn’t line up with the “verts”.

We had to round down and not the step value but the x and y coords.

Also in this version the lines are black and the vert points red.

My result is quite perfect now, even with complex meshes, uv layouts.