Export other shapes
This commit is contained in:
parent
5864dc5c06
commit
3d681da551
18
TeX/jam.sty
18
TeX/jam.sty
@ -28,3 +28,21 @@
|
||||
\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);
|
||||
\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);
|
||||
}
|
||||
|
||||
% 3-staircase (color #1, position #2)
|
||||
\def\staircase#1#2{
|
||||
\fill[color=#1]#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
\draw[color=black]#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
}
|
||||
|
||||
% disk (color #1, position #2)
|
||||
\def\disk#1#2{
|
||||
\fill[color=#1]#2circle(2.5);
|
||||
\draw[color=black]#2circle(2.5);
|
||||
}
|
||||
|
||||
% square (color #1, position #2)
|
||||
\def\square#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;
|
||||
}
|
||||
|
@ -708,6 +708,12 @@ class Painter(Widget):
|
||||
for particle in self.particles:
|
||||
if type(particle)==Cross:
|
||||
ff.write("\cross{"+colors.closest_color(particle.color,colors.xcolor_names)+"}")
|
||||
elif type(particle)==Disk:
|
||||
ff.write("\disk{"+colors.closest_color(particle.color,colors.xcolor_names)+"}")
|
||||
elif type(particle)==Staircase:
|
||||
ff.write("\staircase{"+colors.closest_color(particle.color,colors.xcolor_names)+"}")
|
||||
elif type(particle)==Square2:
|
||||
ff.write("\square{"+colors.closest_color(particle.color,colors.xcolor_names)+"}")
|
||||
ff.write("{{({:05.2f},{:05.2f})}};\n".format(particle.elements[0].pos.x-self.particles[0].elements[0].pos.x,particle.elements[0].pos.y-self.particles[0].elements[0].pos.y))
|
||||
|
||||
ff.write("\\end{tikzpicture}\n")
|
||||
|
Loading…
Reference in New Issue
Block a user