File: align2.py

package info (click to toggle)
pyscript 0.6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,428 kB
  • ctags: 1,175
  • sloc: python: 10,146; makefile: 67
file content (27 lines) | stat: -rwxr-xr-x 592 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env pyscript

# $Id: align2.py,v 1.3 2006/02/14 14:23:08 paultcochrane Exp $

"""
Aligning boxes, with numbers inside, around a circle.
"""

from pyscript import *

# define the object to hold all the objects
all = Align(angle=90, space=2)

# create an equal sided rectangle, put a number in it and add it to the
# group of all objects
for ii in range(10):
    rt = Rectangle(width=1, height=1)
    all.append(
        Group(rt, Text(str(ii), c=rt.c)), angle=all.angle+ii*360/10.)

# render the diagram
render(
    all,
    file='align2.eps',
    )

# vim: expandtab shiftwidth=4: