1
2import smilPython as sp
3
4
5pi = sp.IntPoint(0, 0, 0)
6pf = sp.IntPoint(60, 50, 10)
7
8line = sp.Bresenham(pi, pf)
9
10
11for i in range(0, line.nbPoints()):
12 pt = line.getPoint(i)
13 print(" {:2d} - {:3d} {:3d} {:3d}".format(i, pt.x, pt.y, pt.z))
14
15
16im = sp.Image(64, 64, 12)
17pts = line.getPoints()
18for i in range(0, len(pts)):
19 im.setPixel(pts[i].x, pts[i].y, pts[i].z, 255)
20im.show()
21