GalleryThese are the patterns supplied as examples. They are not great art - I was more interested in writing the package than generating beautiful parquet deformations... Notes
Asymmetric - first attempt
def example2(root):
"""
The symmetry is now in the motif - same pattern, but might be faster
"""
nx, ny = 18, 4
scale = 20
s = Screen(nx, ny, root=root, scale=scale)
t0 = nullTransform
t1 = lambda p, x, y, nx=nx: Scaling(1 - float(x)/(nx-1)) * p
pairs = [(Coordinate(1, 1 ), t0),
(Coordinate(1, 0.5), t0),
(Coordinate(1, 0.5), t1),
(Coordinate(1, -0.5), t1),
(Coordinate(1, -0.5), t0),
(Coordinate(1, -1 ), t0)]
sym = lambda points: repeatPoints(4, points)
m = Motif((pairs,), symmetry=sym)
l = Lattice(nx, ny, transform=centreToTopRight)
l.display(m, s)
Asymmetric
def example3(root):
"""
Make creation symmetry more explicit, introduce new movement that
relies on transforms being rotated with points. Discovered an
asymmetry by accident that improves things enormously!
"""
nx, ny = 18, 4
scale = 20
s = Screen(nx, ny, root=root, scale=scale)
t1 = lambda p, x, y, nx=nx: Scaling(rNorm(x, nx+3)**1.5) * p
t2 = lambda p, x, y, nx=nx: YScaling(rNorm(x, nx+3)**1.5) * p
pairs = [(Coordinate(1, 1), t2),
(Coordinate(1, 0), t1)]
pairs = flatten(xReflectPairs(pairs))
pairs = flatten(repeatPairs(4, pairs))
# pairs.append((Coordinate(1, 1 ), t2))
m = Motif((pairs,))
l = Lattice(nx, ny, transform=centreToTopRight)
l.display(m, s)
Temblor
def example4(root):
"""
Not really rotation...
"""
nx, ny = 22, 4
scale = 20
s = Screen(nx-4, ny, org=Coordinate(2,0), root=root, scale=scale)
t1 = lambda p, x, y, nx=nx: YScaling((-1)**x*(0.85+0.15*cos(2*pi*rNorm(x, nx)))) * p
pairs = [(Coordinate(1,1), t1)]
pairs = flatten(repeatPairs(4, pairs))
pairs.append((Coordinate(1, 1), t1))
m = Motif((pairs,))
l = Lattice(nx, ny, transform=centreToTopRight)
l.display(m, s)
Lissajous Flowers
def example5(root):
"""
Experiment with lists of lists of points (not connected).
"""
nx, ny = 18, 4
scale = 20
s = Screen(nx, ny, root=root, scale=scale)
t0 = nullTransform
t1 = lambda p, x, y, nx=nx: XScaling(0.2 + 0.5 * rNorm(x, nx)) * p
t2 = lambda p, x, y, nx=nx: YScaling(0.2 + 0.5 * rNorm(x, nx)) * p
pairs1 = [(Coordinate(1.0, 1.0), t0),
(Coordinate(0.9, 0.9), t1),
(Coordinate(0.9, 0.9), t2),
(Coordinate(1.0, 1.0), t0)]
pairs1 = repeatPairs(4, pairs1)
pairs2 = [(Coordinate(1.0, 0.0), t1)]
pairs2 = flatten(repeatPairs(4, pairs2))
pairs2.append((Coordinate(1.0, 0.0), t1))
pairs1.append(pairs2)
m = Motif(pairs1)
l = Lattice(nx, ny, transform=centreToTopRight)
l.display(m, s)
Me Too
def example6(root):
"""
Apologies to David Oleson (see Metamagical Themas, p211).
"""
nx, ny = 10, 10
scale = 15
s = Screen(nx, ny, root=root, scale=scale)
t0 = nullTransform
d = 2/3.0
waist = lambda p, x, y, ny=ny, d=d: Coordinate(0, d/2 - d*norm(y, ny)) + p
twist = lambda p, x, y, nx=nx, d=d: Coordinate(0.6*(d/2-d*norm(x, nx)), 0) + p
pairs = [(Coordinate(0,0), t0),
(Coordinate(0,d), twist),
(Coordinate(1.1,d), waist)]
pairs = repeatPairs(4, pairs)
m = Motif(pairs)
# alternate motifs must be reflected, so modify lattice transform
t8 = lambda p, x, y: ReflectX() * p
t9 = switch(alternateXY, nullTransform, t8)
l = Lattice(nx, ny, transform=cascade(centreToTopRight, t9))
l.display(m, s)
Che
def example7(root):
"""
Hexagon based.
There is a compromise here - in an elegant world I would have a
hexagonal display with variations in three different directions.
"""
nx, ny = 7, 7
scale = 20
t0 = nullTransform
d = sqrt(3)/2
s = Screen(nx*d+0.5, ny*0.75+0.25, root=root, scale=scale)
t1 = lambda p, x, y, nx=nx, ny=ny: Scaling(0.5*radius(x, nx, y, ny)+0.5) * p
pairs = [(Coordinate(0, 1), t0),
(Coordinate(d/2, 0.75), t1)]
pairs = flatten(repeatPairs(6, pairs))
pairs.append((Coordinate(0, 1), t0))
m = Motif((pairs,))
l = Lattice(nx, ny, org=Coordinate(0, 0), yShift=hexShifter(),
xShift=shifter(XHat * d), transform=centreToTopRight)
l.display(m, s)
Home | Disclaimer | Name | Bulli |