Esempio n. 1
0
 def random(points_number=None, min=-1, max=1, **kwargs):
     """Create a random form using the point_number, the minimum and maximum position for x and y components and optional arguments."""
     if not points_number: points_number = random.randint(1, 10)
     points = [Point.random(min, max) for i in range(points_number)]
     form = Form(points, **kwargs)
     print(form.point_radius)
     form.makeSparse()
     return form
Esempio n. 2
0
 def random(min=-1,max=1,width=1,color=mycolors.WHITE):
     """Create a random segment."""
     p1=Point.random(min,max)
     p2=Point.random(min,max)
     return Segment(p1,p2,width,color)
Esempio n. 3
0
 def random(min=-1, max=1, width=1, color=mycolors.WHITE):
     """Return a random line."""
     point = Point.random(min, max)
     angle = random.uniform(min, max)
     return Line(point, angle, width, color)