-
Notifications
You must be signed in to change notification settings - Fork 0
/
fill_circle.py
44 lines (33 loc) · 1.22 KB
/
fill_circle.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#fill_circle.py
#This function changes the color
#of certain pixels and fills a circle
#based on the points given
#NOTE that if you want a circle fill a different
#color from the border, you should redraw the circle
#as this function does not take into consideration
#that some of the points found may be apart of the
#border or a single point at the top or bottom of the shape
import copy
import draw_circle
import draw_line
import one_color
def main( x, y, r ):
border = draw_circle.main( x, y, r )
temp = one_color.struc()
points = [ copy.deepcopy( one_color.struc ) ]
length = len( border )
for i in range( length - 1 ):
for t in range( 1, length ):
if border[ i ].y == border[ t ].y:
fill = draw_line.main( border[ i ].x, border[ i ].y, border[ t ].x, border[ t ].y )
length2 = len( fill )
for e in range( length2 ):
temp.x = fill[ e ].x
temp.y = fill[ e ].y
points.append( copy.deepcopy( temp ) )
#end e for loop
#end of if-else statement
#end of t for loop
#end of i for loop
del points[ 0 ]
return points