diff options
author | Ian Jauslin <ian@jauslin.org> | 2022-10-17 20:59:01 -0400 |
---|---|---|
committer | Ian Jauslin <ian@jauslin.org> | 2022-10-17 20:59:01 -0400 |
commit | bdf817efec1cfdd67cc6176a6664442fd98173ae (patch) | |
tree | 93d0abe475c342b2c0cac0dfdb16e2fa018bf4e6 /figs |
Diffstat (limited to 'figs')
29 files changed, 899 insertions, 0 deletions
diff --git a/figs/atoms.fig/Makefile b/figs/atoms.fig/Makefile new file mode 100644 index 0000000..50559fa --- /dev/null +++ b/figs/atoms.fig/Makefile @@ -0,0 +1,15 @@ +PROJECTNAME=crystal liquid gas nematic smectic gas-rods +PNGS=$(addsuffix .png, $(PROJECTNAME)) + +all: $(PNGS) + +$(PNGS): + cp $(patsubst %.png, %, $@)-base.gp $(patsubst %.png, %, $@).gp + python $(patsubst %.png, %, $@).py >> $(patsubst %.png, %, $@).gp + gnuplot $(patsubst %.png, %, $@).gp > $@ + +clean-aux: + rm -f $(addsuffix .gp, $(PROJECTNAME)) + +clean: clean-aux + rm -f $(PNGS) diff --git a/figs/atoms.fig/crystal-base.gp b/figs/atoms.fig/crystal-base.gp new file mode 100644 index 0000000..4de0ee2 --- /dev/null +++ b/figs/atoms.fig/crystal-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view equal xyz + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.50 specular 0.6 + +set palette defined (0 "#339999", 1 "#339999") + +splot \ diff --git a/figs/atoms.fig/crystal.py b/figs/atoms.fig/crystal.py new file mode 100644 index 0000000..4b1ba3c --- /dev/null +++ b/figs/atoms.fig/crystal.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +from math import * +import random +import sys + +# size of lattice +N=5 + +# configuration +config=[] +for i in range(N): + for j in range(N): + for k in range(N): + config.append([2*i+((j+k)%2),sqrt(3)*(j+(k%2)/3),2*sqrt(6)/3*k]) + + +for i in range(len(config)): + print(str(config[i][0])+"+cos(u)*sin(v)", end=",") + print(str(config[i][1])+"+sin(u)*sin(v)", end=",") + print(str(config[i][2])+"+cos(v)", end=" ") + print("with pm3d", end="") + if i<len(config)-1: + print(", \\") diff --git a/figs/atoms.fig/gas-base.gp b/figs/atoms.fig/gas-base.gp new file mode 100644 index 0000000..e95f005 --- /dev/null +++ b/figs/atoms.fig/gas-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view equal xyz + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.5 specular 0.6 + +set palette defined (0 "#339999", 1 "#339999") + +splot \ diff --git a/figs/atoms.fig/gas-rods-base.gp b/figs/atoms.fig/gas-rods-base.gp new file mode 100644 index 0000000..4de0ee2 --- /dev/null +++ b/figs/atoms.fig/gas-rods-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view equal xyz + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.50 specular 0.6 + +set palette defined (0 "#339999", 1 "#339999") + +splot \ diff --git a/figs/atoms.fig/gas-rods.py b/figs/atoms.fig/gas-rods.py new file mode 100644 index 0000000..dc63d24 --- /dev/null +++ b/figs/atoms.fig/gas-rods.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space +L=30 +# number of rods +N=15 +# aspect ratio +a=10 + +# check whether two rods overlap +def check_overlap(rod1,rod2): + # relative placement + relative_pos=unrotate(subtract(rod2[0],rod1[0]), rod1[1]) + if(abs(relative_pos[0])<2 and abs(relative_pos[1])<2 and abs(relative_pos[2])<2): + return(True) + # relative angle + relative_ang=cart_to_spherical(unrotate(spherical_to_cart(rod2[1]), rod1[1])) + # exclusion volume + # rotate other rod + relative_pos=unrotate(relative_pos, [0,relative_ang[1]]) + #if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(relative_pos[2])-a-2<abs(cos(relative_ang[0])*a)): + if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(sin(relative_ang[0])*relative_pos[2]-cos(relative_ang[0])*relative_pos[0])-2<abs(sin(relative_ang[0])*a)): + return(True) + return(False) + +# def subtract vectors +def subtract(x,y): + return([x[0]-y[0],x[1]-y[1],x[2]-y[2]]) +# rotate vector +def unrotate(x,w): + ret=[x[0],x[1],x[2]] + # rotate phi + tmp=cos(w[1])*ret[0]+sin(w[1])*ret[1] + ret[1]=-sin(w[1])*ret[0]+cos(w[1])*ret[1] + ret[0]=tmp + # rotate theta + tmp=cos(w[0])*ret[0]-sin(w[0])*ret[2] + ret[2]=sin(w[0])*ret[0]+cos(w[0])*ret[2] + ret[0]=tmp + return(ret) + +# convert coordinates +def spherical_to_cart(w): + return([cos(w[1])*sin(w[0]),sin(w[1])*sin(w[0]),cos(w[0])]) +def cart_to_spherical(x): + w=[0,0] + w[0]=acos(x[2]) + if(sin(w[0]==0)): + return([w[0],0]) + c=x[0]/sin(w[0]) + s=x[1]/sin(w[0]) + # to avoid truncation errors + if(abs(c)>1 and abs(c)<1.0001): + if(c>0): + return([w[0],0]) + else: + return([w[0],pi]) + if(s>=0): + return([w[0],acos(c)]) + return([w[0],2*pi-acos(c)]) + +# configuration +config=[] +# add rods +while len(config)<N: + # random position and angles + x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)] + w=[random.uniform(0,pi), random.uniform(0,2*pi)] + # chek it does not interfere with other rods + fine=True + for rod in config: + if(check_overlap(rod,[x,w])): + fine=False + break + if fine: + config.append([x,w]) + +for i in range(len(config)): + rod=config[i] + print(str(rod[0][0])+"+("+str(cos(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(-sin(rod[1][1]))+")*sin(u)*sin(v)+("+str(cos(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ") + print(str(rod[0][1])+"+("+str(sin(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][1]))+")*sin(u)*sin(v)+("+str(sin(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ") + print(str(rod[0][2])+"+("+str(-sin(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][0])*a)+")*cos(v)", end=" ") + print("with pm3d", end="") + if i<len(config)-1: + print(", \\") diff --git a/figs/atoms.fig/gas.py b/figs/atoms.fig/gas.py new file mode 100644 index 0000000..8685999 --- /dev/null +++ b/figs/atoms.fig/gas.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space +L=15 +# number of particles +N=10 + +# check whether two rods overlap +def check_overlap(sphere1,sphere2): + if(sqrt((sphere2[0]-sphere1[0])**2+(sphere2[1]-sphere1[1])**2+(sphere2[2]-sphere1[2])**2)<2): + return(True) + return(False) + +# configuration +config=[] +# add spheres +while len(config)<N: + # random position + x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)] + # check it does not interfere with other spheres + fine=True + for sphere in config: + if(check_overlap(sphere,x)): + fine=False + break + if fine: + config.append(x) + +for i in range(len(config)): + sphere=config[i] + print(str(sphere[0])+"+cos(u)*sin(v)", end=", ") + print(str(sphere[1])+"+sin(u)*sin(v)", end=", ") + print(str(sphere[2])+"+cos(v)", end=" ") + print("with pm3d", end="") + if i<len(config)-1: + print(", \\") diff --git a/figs/atoms.fig/liquid-base.gp b/figs/atoms.fig/liquid-base.gp new file mode 100644 index 0000000..4de0ee2 --- /dev/null +++ b/figs/atoms.fig/liquid-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view equal xyz + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.50 specular 0.6 + +set palette defined (0 "#339999", 1 "#339999") + +splot \ diff --git a/figs/atoms.fig/liquid.py b/figs/atoms.fig/liquid.py new file mode 100644 index 0000000..99b09ba --- /dev/null +++ b/figs/atoms.fig/liquid.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space +L=15 +# number of particles +N=100 + +# check whether two rods overlap +def check_overlap(sphere1,sphere2): + if(sqrt((sphere2[0]-sphere1[0])**2+(sphere2[1]-sphere1[1])**2+(sphere2[2]-sphere1[2])**2)<2): + return(True) + return(False) + +# configuration +config=[] +# add spheres +while len(config)<N: + # random position + x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)] + # check it does not interfere with other spheres + fine=True + for sphere in config: + if(check_overlap(sphere,x)): + fine=False + break + if fine: + config.append(x) + +for i in range(len(config)): + sphere=config[i] + print(str(sphere[0])+"+cos(u)*sin(v)", end=", ") + print(str(sphere[1])+"+sin(u)*sin(v)", end=", ") + print(str(sphere[2])+"+cos(v)", end=" ") + print("with pm3d", end="") + if i<len(config)-1: + print(", \\") diff --git a/figs/atoms.fig/nematic-base.gp b/figs/atoms.fig/nematic-base.gp new file mode 100644 index 0000000..4de0ee2 --- /dev/null +++ b/figs/atoms.fig/nematic-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view equal xyz + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.50 specular 0.6 + +set palette defined (0 "#339999", 1 "#339999") + +splot \ diff --git a/figs/atoms.fig/nematic.py b/figs/atoms.fig/nematic.py new file mode 100644 index 0000000..5c779c0 --- /dev/null +++ b/figs/atoms.fig/nematic.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space +L=30 +# number of rods +N=75 +# aspect ratio +a=10 +# spread in theta angle +spread=pi/30 + +# check whether two rods overlap +def check_overlap(rod1,rod2): + # relative placement + relative_pos=unrotate(subtract(rod2[0],rod1[0]), rod1[1]) + if(abs(relative_pos[0])<2 and abs(relative_pos[1])<2 and abs(relative_pos[2])<2): + return(True) + # relative angle + relative_ang=cart_to_spherical(unrotate(spherical_to_cart(rod2[1]), rod1[1])) + # exclusion volume + # rotate other rod + relative_pos=unrotate(relative_pos, [0,relative_ang[1]]) + #if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(relative_pos[2])-a-2<abs(cos(relative_ang[0])*a)): + if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(sin(relative_ang[0])*relative_pos[2]-cos(relative_ang[0])*relative_pos[0])-2<abs(sin(relative_ang[0])*a)): + return(True) + return(False) + +# def subtract vectors +def subtract(x,y): + return([x[0]-y[0],x[1]-y[1],x[2]-y[2]]) +# rotate vector +def unrotate(x,w): + ret=[x[0],x[1],x[2]] + # rotate phi + tmp=cos(w[1])*ret[0]+sin(w[1])*ret[1] + ret[1]=-sin(w[1])*ret[0]+cos(w[1])*ret[1] + ret[0]=tmp + # rotate theta + tmp=cos(w[0])*ret[0]-sin(w[0])*ret[2] + ret[2]=sin(w[0])*ret[0]+cos(w[0])*ret[2] + ret[0]=tmp + return(ret) + +# convert coordinates +def spherical_to_cart(w): + return([cos(w[1])*sin(w[0]),sin(w[1])*sin(w[0]),cos(w[0])]) +def cart_to_spherical(x): + w=[0,0] + w[0]=acos(x[2]) + if(sin(w[0]==0)): + return([w[0],0]) + c=x[0]/sin(w[0]) + s=x[1]/sin(w[0]) + # to avoid truncation errors + if(abs(c)>1 and abs(c)<1.0001): + if(c>0): + return([w[0],0]) + else: + return([w[0],pi]) + if(s>=0): + return([w[0],acos(c)]) + return([w[0],2*pi-acos(c)]) + +# configuration +config=[] +# add rods +while len(config)<N: + # random position and angles + x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)] + w=[abs(random.gauss(0,spread)), random.uniform(0,2*pi)] + # chek it does not interfere with other rods + fine=True + for rod in config: + if(check_overlap(rod,[x,w])): + fine=False + break + if fine: + config.append([x,w]) + +for i in range(len(config)): + rod=config[i] + print(str(rod[0][0])+"+("+str(cos(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(-sin(rod[1][1]))+")*sin(u)*sin(v)+("+str(cos(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ") + print(str(rod[0][1])+"+("+str(sin(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][1]))+")*sin(u)*sin(v)+("+str(sin(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ") + print(str(rod[0][2])+"+("+str(-sin(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][0])*a)+")*cos(v)", end=" ") + print("with pm3d", end="") + if i<len(config)-1: + print(", \\") diff --git a/figs/atoms.fig/smectic-base.gp b/figs/atoms.fig/smectic-base.gp new file mode 100644 index 0000000..6b2077f --- /dev/null +++ b/figs/atoms.fig/smectic-base.gp @@ -0,0 +1,21 @@ +set terminal pngcairo size 2048,2048 + +set key off +unset colorbox +unset border +unset xtics +unset ytics +unset ztics + +set parametric + +set view 90,0 + +set isosample 100 + +set pm3d depthorder +set pm3d lighting primary 0.50 specular 0.6 + +set palette defined (0 "#339999", 1 "#339999") + +splot \ diff --git a/figs/atoms.fig/smectic.py b/figs/atoms.fig/smectic.py new file mode 100644 index 0000000..c8d4d13 --- /dev/null +++ b/figs/atoms.fig/smectic.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space +L=30 +# number of rods +N=150 +# aspect ratio +a=10 +# spread in theta angle +spread=pi/30 +# spread in height +spread_height=a/5 + +# check whether two rods overlap +def check_overlap(rod1,rod2): + # relative placement + relative_pos=unrotate(subtract(rod2[0],rod1[0]), rod1[1]) + if(abs(relative_pos[0])<2 and abs(relative_pos[1])<2 and abs(relative_pos[2])<2): + return(True) + # relative angle + relative_ang=cart_to_spherical(unrotate(spherical_to_cart(rod2[1]), rod1[1])) + # exclusion volume + # rotate other rod + relative_pos=unrotate(relative_pos, [0,relative_ang[1]]) + #if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(relative_pos[2])-a-2<abs(cos(relative_ang[0])*a)): + if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(sin(relative_ang[0])*relative_pos[2]-cos(relative_ang[0])*relative_pos[0])-2<abs(sin(relative_ang[0])*a)): + return(True) + return(False) + +# def subtract vectors +def subtract(x,y): + return([x[0]-y[0],x[1]-y[1],x[2]-y[2]]) +# rotate vector +def unrotate(x,w): + ret=[x[0],x[1],x[2]] + # rotate phi + tmp=cos(w[1])*ret[0]+sin(w[1])*ret[1] + ret[1]=-sin(w[1])*ret[0]+cos(w[1])*ret[1] + ret[0]=tmp + # rotate theta + tmp=cos(w[0])*ret[0]-sin(w[0])*ret[2] + ret[2]=sin(w[0])*ret[0]+cos(w[0])*ret[2] + ret[0]=tmp + return(ret) + +# convert coordinates +def spherical_to_cart(w): + return([cos(w[1])*sin(w[0]),sin(w[1])*sin(w[0]),cos(w[0])]) +def cart_to_spherical(x): + w=[0,0] + w[0]=acos(x[2]) + if(sin(w[0]==0)): + return([w[0],0]) + c=x[0]/sin(w[0]) + s=x[1]/sin(w[0]) + # to avoid truncation errors + if(abs(c)>1 and abs(c)<1.0001): + if(c>0): + return([w[0],0]) + else: + return([w[0],pi]) + if(s>=0): + return([w[0],acos(c)]) + return([w[0],2*pi-acos(c)]) + +# configuration +config=[] +# add rods +while len(config)<N: + # random position and angles + x=[random.uniform(0,L), random.uniform(0,L), 1.6*a*random.randint(0,2)+random.gauss(0,spread_height)] + w=[abs(random.gauss(0,spread)), random.uniform(0,2*pi)] + # chek it does not interfere with other rods + fine=True + for rod in config: + if(check_overlap(rod,[x,w])): + fine=False + break + if fine: + config.append([x,w]) + +for i in range(len(config)): + rod=config[i] + print(str(rod[0][0])+"+("+str(cos(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(-sin(rod[1][1]))+")*sin(u)*sin(v)+("+str(cos(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ") + print(str(rod[0][1])+"+("+str(sin(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][1]))+")*sin(u)*sin(v)+("+str(sin(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ") + print(str(rod[0][2])+"+("+str(-sin(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][0])*a)+")*cos(v)", end=" ") + print("with pm3d", end="") + if i<len(config)-1: + print(", \\") diff --git a/figs/diamonds.fig/Makefile b/figs/diamonds.fig/Makefile new file mode 100644 index 0000000..42b4031 --- /dev/null +++ b/figs/diamonds.fig/Makefile @@ -0,0 +1,20 @@ +all: diamonds + +diamonds: + python diamonds.py > diamonds.tikz.tex + cat diamonds.tikz.tex | sed 's/%1%/red/g;s/%2%/blue/g' > diamonds_color.tikz.tex + sed -i 's/%1%/teal/g;s/%2%/teal/g' diamonds.tikz.tex + pdflatex -jobname diamonds diamonds.tikz.tex + pdflatex -jobname diamonds_color diamonds_color.tikz.tex + +clean-aux: + rm -f diamonds.tikz.tex + rm -f diamonds.log + rm -f diamonds.aux + rm -f diamonds_color.tikz.tex + rm -f diamonds_color.log + rm -f diamonds_color.aux + +clean: clean-aux + rm -f diamonds.pdf + rm -f diamonds_color.pdf diff --git a/figs/diamonds.fig/diamonds.py b/figs/diamonds.fig/diamonds.py new file mode 100644 index 0000000..2bc4d9c --- /dev/null +++ b/figs/diamonds.fig/diamonds.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space (must be int) +L=30 +# number of particles +N=int(L*L/2*0.97) + +# check whether two diamonds overlap +def check_overlap(x1,x2): + if(sqrt((x1[0]-x2[0])**2+(x1[1]-x2[1])**2)<=1): + return(True) + return(False) + +# configuration +config=[] + +# put particles on odd lattice manually +for i in range(4): + for j in range(4): + if (i!=2 or j!=1): + config.append([2*int(L/2/2)+1+i+j,2*int(L/2/2)+i-j]) + +# add particles +while len(config)<N: + # random position + # even sublattice + if(random.random()<0.5): + x=[2*random.randint(0,int(L/2)), 2*random.randint(0,int(L/2))] + else: + x=[2*random.randint(0,int(L/2))+1, 2*random.randint(0,int(L/2))+1] + # check it does not interfere with other particles + fine=True + for part in config: + if(check_overlap(part,x)): + fine=False + break + if fine: + config.append(x) + +print(r'''\documentclass{standalone} +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid{'''+str(L+3)+'}{'+str(L+3)+'''}{(-1,-1)} +''') + +for i in range(len(config)): + part=config[i] + # different colors for even and odd + if i<15: + # replace %1% later + print(r'\diamond{%1%}{('+str(part[0])+','+str(part[1])+')}') + else: + # replace %2% later + print(r'\diamond{%2%}{('+str(part[0])+','+str(part[1])+')}') + +print(r''' +\end{tikzpicture} +\end{document} +''') diff --git a/figs/diamonds.fig/shapes.sty b/figs/diamonds.fig/shapes.sty new file mode 120000 index 0000000..2607bef --- /dev/null +++ b/figs/diamonds.fig/shapes.sty @@ -0,0 +1 @@ +../libs/shapes.sty
\ No newline at end of file diff --git a/figs/libs/shapes.sty b/figs/libs/shapes.sty new file mode 100644 index 0000000..e60faeb --- /dev/null +++ b/figs/libs/shapes.sty @@ -0,0 +1,109 @@ +% square lattice (width #1, height #2, origin #3, spacing #4) +\def\grid#1#2#3{ + \foreach\i in {0,...,#2}{ + \draw#3++(0,\i)--++(#1,0); + } + \foreach\i in {0,...,#1}{ + \draw#3++(\i,0)--++(0,#2); + } +} + + +% cross (color #1, position #2) +\def\cross#1#2{ + \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0); + \begin{scope} + \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0); + \grid44{[color=white]#2++(-2,-2)} + \end{scope} + \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0); +} + +% V triomino (color #1, position #2) +\def\Vtriomino#1#2{ + \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-2)--++(2,0)--++(0,1)--++(-1,0); + \begin{scope} + \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-2)--++(2,0)--++(0,1)--++(-1,0); + \grid33{[color=white]#2++(-1,-1)} + \end{scope} + \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-2)--++(2,0)--++(0,1)--++(-1,0); +} + +% T tetromino (color #1, position #2) +\def\Ttetromino#1#2{ + \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0); + \begin{scope} + \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0); + \grid34{[color=white]#2++(-1,-2)} + \end{scope} + \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0); +} + +% L tetromino (color #1, position #2) +\def\Ltetromino#1#2{ + \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(2,0)--++(0,1)--++(-1,0)--++(0,1); + \begin{scope} + \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(2,0)--++(0,1)--++(-1,0)--++(0,1); + \grid34{[color=white]#2++(-1,-2)} + \end{scope} + \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(2,0)--++(0,1)--++(-1,0)--++(0,1); +} + +% P pentomino (color #1, position #2) +\def\Ppentomino#1#2{ + \fill[color=#1]#2++(1.5,1.5)--++(-2,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,2); + \begin{scope} + \clip#2++(1.5,1.5)--++(-2,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,2); + \grid34{[color=white]#2++(-1,-2)} + \end{scope} + \draw[color=black]#2++(1.5,1.5)--++(-2,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,2); +} + +% 1x1 square (color #1, position #2) +\def\square#1#2{ + \fill[color=#1]#2++(-0.5,-0.5)--++(0,1)--++(1,0)--++(0,-1)--cycle; + \draw[color=black]#2++(-0.5,-0.5)--++(0,1)--++(1,0)--++(0,-1)--cycle; + \draw[color=white]#2++(-0.5,0)--++(1,0); + \draw[color=white]#2++(0,-0.5)--++(0,1); +} + +% 2x2 square (color #1, position #2) +\def\ttsquare#1#2{ + \fill[color=#1]#2++(-1,-1)--++(0,2)--++(2,0)--++(0,-2)--cycle; + \draw[color=black]#2++(-1,-1)--++(0,2)--++(2,0)--++(0,-2)--cycle; + \draw[color=white]#2++(-0.5,-1)--++(0,2); + \draw[color=white]#2++(0.5,-1)--++(0,2); + \draw[color=white]#2++(-1,-0.5)--++(2,0); + \draw[color=white]#2++(-1,0.5)--++(2,0); +} +\def\ttsquareempty#1{ + \draw[color=black]#1++(-1,-1)--++(0,2)--++(2,0)--++(0,-2)--cycle; +} + +% diamond (color #1, position #2) +\def\diamond#1#2{ + \fill[color=#1]#2++(0,-1)--++(1,1)--++(-1,1)--++(-1,-1)--cycle; + \begin{scope} + \clip#2++(0,-1)--++(1,1)--++(-1,1)--++(-1,-1)--cycle; + \grid22{[color=white]#2++(-1,-1)} + \end{scope} + \draw[color=black]#2++(0,-1)--++(1,1)--++(-1,1)--++(-1,-1)--cycle; +} + +% rods (color #1, position #2) +\def\rodh#1#2{ + \fill[color=#1]#2++(-5.5,-0.5)--++(11,0)--++(0,1)--++(-11,0)--cycle; + \begin{scope} + \clip#2++(-5.5,-0.5)--++(11,0)--++(0,1)--++(-11,0)--cycle; + \grid{12}2{[color=white]#2++(-6,-1)} + \end{scope} + \draw[color=black]#2++(-5.5,-0.5)--++(11,0)--++(0,1)--++(-11,0)--cycle; +} +\def\rodv#1#2{ + \fill[color=#1]#2++(-0.5,-5.5)--++(0,11)--++(1,0)--++(0,-11)--cycle; + \begin{scope} + \clip#2++(-0.5,-5.5)--++(0,11)--++(1,0)--++(0,-11)--cycle; + \grid2{12}{[color=white]#2++(-1,-6)} + \end{scope} + \draw[color=black]#2++(-0.5,-5.5)--++(0,11)--++(1,0)--++(0,-11)--cycle; +} diff --git a/figs/rods.fig/Makefile b/figs/rods.fig/Makefile new file mode 100644 index 0000000..33b81e2 --- /dev/null +++ b/figs/rods.fig/Makefile @@ -0,0 +1,28 @@ +PROJECTNAME=$(basename $(basename $(wildcard *.tikz.tex))) +LIBS=$(notdir $(wildcard libs/*)) + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) + +all: $(PDFS) + +$(PDFS): $(LIBS) + echo $(LIBS) + pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@) + +install: $(PDFS) + cp $^ $(INSTALLDIR)/ + +$(LIBS): + ln -fs libs/$@ ./ + +clean-libs: + rm -f $(LIBS) + +clean-aux: + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + +clean-tex: + rm -f $(PDFS) + +clean: clean-libs clean-aux clean-tex diff --git a/figs/rods.fig/libs/shapes.sty b/figs/rods.fig/libs/shapes.sty new file mode 120000 index 0000000..eaa25c7 --- /dev/null +++ b/figs/rods.fig/libs/shapes.sty @@ -0,0 +1 @@ +../../libs/shapes.sty
\ No newline at end of file diff --git a/figs/rods.fig/rods.tikz.tex b/figs/rods.fig/rods.tikz.tex new file mode 100644 index 0000000..935a72f --- /dev/null +++ b/figs/rods.fig/rods.tikz.tex @@ -0,0 +1,30 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid{27}{27}{(-13,-13)} + +\rodh{teal}{(0,0)} +\rodh{teal}{(2,1)} +\rodh{teal}{(8,3)} +\rodh{teal}{(-6,6)} +\rodh{teal}{(8,6)} +\rodh{teal}{(-7,7)} +\rodh{teal}{(8,8)} +\rodh{teal}{(-6,10)} +\rodh{teal}{(-4,-2)} +\rodh{teal}{(8,-2)} +\rodh{teal}{(-1,-5)} +\rodh{teal}{(-3,-7)} +\rodh{teal}{(5,-8)} +\rodh{teal}{(-3,-10)} + +\rodv{teal}{(-12,-1)} +\rodv{teal}{(-11,-5)} +\rodv{teal}{(1,8)} + +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/L_tetromino.tikz.tex b/figs/shapes.fig/L_tetromino.tikz.tex new file mode 100644 index 0000000..5c82766 --- /dev/null +++ b/figs/shapes.fig/L_tetromino.tikz.tex @@ -0,0 +1,11 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid34{(-1,-2)} +\Ltetromino{teal}{(0,0)} +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/Makefile b/figs/shapes.fig/Makefile new file mode 100644 index 0000000..33b81e2 --- /dev/null +++ b/figs/shapes.fig/Makefile @@ -0,0 +1,28 @@ +PROJECTNAME=$(basename $(basename $(wildcard *.tikz.tex))) +LIBS=$(notdir $(wildcard libs/*)) + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) + +all: $(PDFS) + +$(PDFS): $(LIBS) + echo $(LIBS) + pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@) + +install: $(PDFS) + cp $^ $(INSTALLDIR)/ + +$(LIBS): + ln -fs libs/$@ ./ + +clean-libs: + rm -f $(LIBS) + +clean-aux: + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + +clean-tex: + rm -f $(PDFS) + +clean: clean-libs clean-aux clean-tex diff --git a/figs/shapes.fig/P_pentomino.tikz.tex b/figs/shapes.fig/P_pentomino.tikz.tex new file mode 100644 index 0000000..9ef3990 --- /dev/null +++ b/figs/shapes.fig/P_pentomino.tikz.tex @@ -0,0 +1,11 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid34{(-1,-2)} +\Ppentomino{teal}{(0,0)} +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/T_tetromino.tikz.tex b/figs/shapes.fig/T_tetromino.tikz.tex new file mode 100644 index 0000000..087e809 --- /dev/null +++ b/figs/shapes.fig/T_tetromino.tikz.tex @@ -0,0 +1,11 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid34{(-1,-2)} +\Ttetromino{teal}{(0,0)} +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/V_triomino.tikz.tex b/figs/shapes.fig/V_triomino.tikz.tex new file mode 100644 index 0000000..ba07c5f --- /dev/null +++ b/figs/shapes.fig/V_triomino.tikz.tex @@ -0,0 +1,11 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid33{(-1,-1)} +\Vtriomino{teal}{(0,0)} +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/cross.tikz.tex b/figs/shapes.fig/cross.tikz.tex new file mode 100644 index 0000000..ef5f391 --- /dev/null +++ b/figs/shapes.fig/cross.tikz.tex @@ -0,0 +1,11 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid44{(-2,-2)} +\cross{teal}{(0,0)} +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/diamond.tikz.tex b/figs/shapes.fig/diamond.tikz.tex new file mode 100644 index 0000000..6d9eaa4 --- /dev/null +++ b/figs/shapes.fig/diamond.tikz.tex @@ -0,0 +1,11 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} +\grid44{(-2,-2)} +\diamond{teal}{(0,0)} +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/hexagon.tikz.tex b/figs/shapes.fig/hexagon.tikz.tex new file mode 100644 index 0000000..a23b7dc --- /dev/null +++ b/figs/shapes.fig/hexagon.tikz.tex @@ -0,0 +1,37 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{shapes} + +\begin{document} +\begin{tikzpicture} + +\draw(0,0)--++(2,0); +\draw(120:1)--++(3,0); +\draw(120:2)--++(4,0); +\draw(120:2)++(60:1)--++(3,0); +\draw(120:2)++(60:2)--++(2,0); + +\draw(0,0)--++(60:4); +\draw(1,0)--++(60:3); +\draw(2,0)--++(60:2); +\draw(120:1)--++(60:3); +\draw(120:2)--++(60:2); + +\draw(0,0)--++(120:2); +\draw(1,0)--++(120:3); +\draw(2,0)--++(120:4); +\draw(2,0)++(60:1)--++(120:3); +\draw(2,0)++(60:2)--++(120:2); + +\fill[color=teal](60:1)--++(0:1)--++(60:1)--++(120:1)--++(180:1)--++(240:1)--++(300:1)--cycle; + +\draw[color=white](60:1)--++(60:2); +\draw[color=white](60:1)++(1,0)--++(120:2); +\draw[color=white](60:1)++(120:1)--++(2,0); + +\draw(60:1)--++(0:1)--++(60:1)--++(120:1)--++(180:1)--++(240:1)--++(300:1)--cycle; + + +\end{tikzpicture} +\end{document} diff --git a/figs/shapes.fig/libs/shapes.sty b/figs/shapes.fig/libs/shapes.sty new file mode 120000 index 0000000..eaa25c7 --- /dev/null +++ b/figs/shapes.fig/libs/shapes.sty @@ -0,0 +1 @@ +../../libs/shapes.sty
\ No newline at end of file |