Skip to content

Commit

Permalink
Dodane literki
Browse files Browse the repository at this point in the history
  • Loading branch information
torgiren committed Oct 19, 2013
1 parent 9df47c6 commit 15def58
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions semestr_9/geometria/01/main.py
Expand Up @@ -82,6 +82,7 @@ def wpisany():

p = PS()
p.translate(200, 200)
p.setfont()
p.moveto(0, 0)
p.line(*B)
p.line(*C)
Expand All @@ -99,6 +100,27 @@ def wpisany():
p.moveto(*E)
p.line(*F)
p.stroke()

p.colour(0, 0, 0)
p.moveto(*A)
p.rmoveto(-10, -10)
p.text("A")
p.moveto(*B)
p.rmoveto(5, -10)
p.text("B")
p.moveto(*C)
p.rmoveto(0, 5)
p.text("C")
p.moveto(*D)
p.rmoveto(5, -10)
p.text("D")
p.moveto(*E)
p.rmoveto(-10, -10)
p.text("E")
p.moveto(*F)
p.rmoveto(-10, -10)
p.text("F")

print p.gen()
with open("wpisany.ps", "w") as wpisany:
wpisany.write(p.gen())
Expand Down
3 changes: 3 additions & 0 deletions semestr_9/geometria/01/ps.py
Expand Up @@ -11,6 +11,9 @@ def translate(self, x, y):
def moveto(self, x, y):
self.wynik.append("%f %f moveto" % (x, y))

def rmoveto(self, x, y):
self.wynik.append("%f %d rmoveto" % (x, y))

def line(self, x,y ):
self.wynik.append("%f %f lineto" % (x, y))

Expand Down
Binary file modified semestr_9/geometria/01/wpisany.ps
Binary file not shown.

0 comments on commit 15def58

Please sign in to comment.