# zipper.draw # Paul Boersma, July 15, 1998 # # Praat script that creates figure 2.4 of # Boersma (1998): Functional Phonology. # http://fonsg3.hum.uva.nl/paul/ # Erase all Times 12 Line width... 4 Viewport... -0.4 6.3 0 3 # Create the top wall: a pentagon. Create simple Matrix... topWall 2 5 0 Formula... if col=1 then if row=1 then -60 else 3 fi else self fi Formula... if col=2 then if row=1 then -60 else 15 fi else self fi Formula... if col=3 then if row=1 then -30 else 15 fi else self fi Formula... if col=4 then if row=1 then -30 else 9 fi else self fi Formula... if col=5 then self[1] else self fi # The bottom wall: reflected through y=0. Copy... bottomWall Formula... if row=2 then -self else self fi # Make polygons of both matrices and paint and draw them. plus Matrix topWall To Polygon Paint... 0.9 -55 55 -15 15 Remove Draw rectangle... -60 -30 -15 15 Draw line... -60 3 -30 9 Draw line... -60 -3 -30 -9 # Closing walls: move open walls by (45, +-5) select Matrix topWall Formula... if row=1 then self+45 else self-5 fi Formula... if col=1 and row=2 then 0.2 else self fi Formula... if col=5 then if row=2 then 0.2 else -4 fi else self fi select Matrix bottomWall Formula... if row=1 then self+45 else self+5 fi Formula... if col=1 and row=2 then -0.2 else self fi Formula... if col=5 then if row=2 then -0.2 else -4 fi else self fi plus Matrix topWall To Polygon Paint... 0.9 -55 55 -15 15 Remove Draw rectangle... -15 15 -10 10 Draw line... 15 4 -4 0.2 Draw line... -4 0.2 -15 0.2 Draw line... 15 -4 -4 -0.2 Draw line... -4 -0.2 -15 -0.2 # Closing walls: move open walls by (45, +-3) select Matrix topWall Formula... if row=1 then self+45 else self-3 fi Formula... if col=1 and row=2 then 0.2 else self fi Formula... if col=5 then if row=2 then 0.2 else 56 fi else self fi select Matrix bottomWall Formula... if row=1 then self+45 else self+3 fi Formula... if col=1 and row=2 then -0.2 else self fi Formula... if col=5 then if row=2 then -0.2 else 56 fi else self fi plus Matrix topWall To Polygon Paint... 0.9 -55 55 -15 15 Remove Draw rectangle... 30 60 -7 7 Draw line... 60 1 56 0.2 Draw line... 56 0.2 30 0.2 Draw line... 60 -1 56 -0.2 Draw line... 56 -0.2 30 -0.2 Dotted line Draw line... 54 -0.2 30 -5 Draw line... 54 0.2 30 5 Plain line # Measurement lines. Line width... 2 Dotted line Draw line... -30 9 -25 9 Draw line... -60 3 -25 3 Draw line... 30 0.2 28 0.2 Draw line... 30 -0.2 28 -0.2 Draw line... -15 -10 -15 -14 Draw line... 15 -10 15 -14 Plain line # 0 --> 0.2 precision Text... -45 Centre 0 Half \De%y Draw arrow... -45 2 -45 6 Draw arrow... -45 -2 -45 -6 Text... -25 Centre 6 Half %%\dey Draw arrow... -25 12 -25 9 Draw arrow... -25 0 -25 3 Text... -35 Centre -2 Half %A Text... 0.5 Left 2.5 Bottom \De%y Draw arrow... 0 4 0 1 Draw arrow... 0 -4 0 -1 Text... 10 Centre 0 Half %A Text... 27 Right 0.5 Half \De%%y__min Draw arrow... 27.5 3.2 27.5 0.2 Draw arrow... 27.5 -3.2 27.5 -0.2 Text... 46 Left 1.5 Bottom \--\De%y Draw arrow... 45 5 45 2 Draw arrow... 45 -5 45 -2 # 14 --> 13.8 precision Text... 0 Centre -13.8 Half \De%z Draw arrow... -2.5 -14 -15 -14 Draw arrow... 2.5 -14 15 -14 # Springs Paint rectangle... 0 -45.2 -44.8 15 17 Paint rectangle... 0 -45.2 -44.8 -17 -15 Paint rectangle... 0 -0.2 0.2 10 12 Paint rectangle... 0 -0.2 0.2 -12 -10 Paint rectangle... 0 44.8 45.2 7 9 Paint rectangle... 0 44.8 45.2 -9 -7 Viewport... 0 5.9 0.3 2.7 Line width... 1