import rhinoscriptsyntax as rs
from Attractor import*
import random
numX = 20
numY = 20
#initi LIST for attractors
attractors = list()
#create attractors
for i in range(3):
pt = rs.AddPoint(random.random()*200, random.random()*200, 0)
attractor = Attractor (pt)
attractors.append(attractor)
#draw circles on a grid
for i in range(0,numX):
for j in range(0,numY):
pt = rs.AddPoint(i*10, j*10, 0)
#check the distance from the cloest attractor
minDist = 10000
count = 0
for k in attractors:
distance = rs.Distance(pt,attractors[count].pt)
if(distance < minDist):
minDist = distance
count += 1
if (minDist < 100):
rs.AddCircle(pt, (100-minDist)/10)
count = 0
for i in attractors:
attractors[count].drawAttractor()
count += 1