Skip to content

Commit

Permalink
adding better support for asymmetric patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Rublee committed Mar 22, 2011
1 parent 2a5fde0 commit e7579b9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions doc/pattern_tools/gen_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ def makeCirclesPattern(self):
def makeACirclesPattern(self):
spacing = self.square_size
r = spacing / 5.0
row_shift = 0
for y in range(1,self.rows+1):
for x in range(1,self.cols+1):
dot = SVG("circle", cx= (x + row_shift/2.0) * spacing, cy=y * spacing, r=r, fill="black")
for i in range(0,self.rows):
for j in range(0,self.cols):
dot = SVG("circle", cx= ((j*2 + i%2)*spacing) + spacing, cy=self.height - (i * spacing + spacing), r=r, fill="black")
self.g.append(dot)
#this makes the pattern asymetric
if row_shift is 0:
row_shift = 1
else:
row_shift = 0

def makeCheckerboardPattern(self):
spacing = self.square_size
r = spacing / 5.0
Expand Down

0 comments on commit e7579b9

Please sign in to comment.