# Visual Modeling with Logo ## A Structured Approach to Seeing James Clayson Originally published in **Exploring with Logo**, E. Paul Goldenberg, editor. 1. _Exploring Language with Logo_ by E. Paul Goldenberg and Wallace Feurzeig 2. _Visual Modeling with Logo_ by James Clayson The MIT Press Cambridge, Massachusetts London, England Copyright 1988 by the Massachusetts Institute of Technology. ### Series Foreword The aim of this series is to enhance the study of topics in the arts, humanities, mathematics, and sciences with ideas and techniques drawn from the world of artificial intelligence--specifically, the notion that in building a computer model of a construct, one gains tremendous insight into the construct. Each volume in the series represents a penetrating yet playful excursion through a single subject area such as linguistics, visual modeling, music, number theory, or physics, written for a general audience. ### Preface 'What is the use of a book: ' thought Alice, "without pictures . . . ." Lewis Carroll In the fall of 1982 I started to teach a course called Thinking ." It was offered jointly American " Problems by Parsons School of Design in Paris and the College in Paris . Looking back now, perhaps I should have replaced the word Problems with something less pathological - Explorations that original my reason for inventing title really first place . I taught encouraged indicated courses in statistics my students in Visual and operations to add a bit of visual maybe . But the course in the research in which thinking I to their quantitative analysis, but each semester I was disappointed . I continued my pleas for visualization who could introduce because I saw that the few students a little of it into their work discovered - more often than not - the most surprisingly useful things . These visualizers intimidated because their by vagueness concrete starting painted abilities points, and they seemed to enjoy playing pieces of complex encouraged picture -making seemed to me less around problems . Perhaps, I thought, their them to see where more analytic approaches gave them might with the visual play usefully be applied . My problem was to discover how to teach visual thinking who had problems to those students doing it naturally . It was obvious that most of my students lacked visual vocabulary and few of them had ever been in an art or drawing studio . How was I to cancel out this liability ? Luckily I had managed an art Preface school and knew a bit about people who had design experience. Professional art students certainly have the visual baggage, but most are severely lacking in analytical skills . " Let's put these two groups together, " I thought, "and set them a series of tasks." The art students can show their colleagues a bit about color and design, while the non-art crew can gently introduce the art students to a little quantitative model building . The Logo computer language struck me as an appropriate medium of instruction - just enough of the visual and just enough of the analytical . Problems in Visual Thinking was born . most There were recent set no suitable of class texts, so I set out to write one, and this . It is structured around a series of notes book is the exercises that encourage visual thinking in students from a variety of different backgrounds . I wish that I could claim total success in turning my students into better problem -solvers by first turning them into more effective visualizers . But I fear that my record is mixed . I am convinced, however, that for some people, certainly not all, visual model building is an enormously enjoyable activity that leads them in new and surprising directions . And since that activity falls nicely within the terms of reference of a liberal arts education, I am quite pleased with the classroom results Most thanks are due their help . You will I have seen . to my students because this book find quotes and illustrations was realized with from them scattered throughout the text . Thanks, too, go to Roger Shepherd, the first Director of Parsons in Paris, who not only encouraged me to start this project but helped to teach it for the first would still be in year . Were a basement it not for Xerox room Frank Satlow . I also of MIT benefited Press, this from his book readers ' reports . The final construction of the manuscript, however, was a solo affair ; what,ever opacities, inconsistencies, or mistakes remain are mine . JamesClayson Paris, 1987 xii Ackn owl edg me nts I wish to thank the following for granting permission to reproduce illustrations in this book : Robert Delaunay, Disque, Musee d 'art moderne de la ville de Paris, courtesy of ADAGP and ARS. David Hackney, Sunbather, courtesy of the artist . Wassily Kandinsky, Several Circles, No. 323 (1926), Solomon R. Guggenheim Museum, New York . Photograph by Robert E. Mates. Wassily Kandinsky, First study for SeveralCircles (1926), Collections du Musee National d'art moderne, Paris, courtesy of ADAGP and ARS. Gustav Klimt, Poissonsrouges, courtesy Giraudon / Art Resources, New York . Gustav Klimt, Rosiers sous les arbres, courtesy Giraudon / Art Resource, New York . Piet Mondrian, Compositie met kleurvlakjes no. 3, Collection Haags Gemeentemuseum, the Hague, courtesy of Beeldrecht, The Netherlands / V AGA, New York . Piet Mondrian, Composition with red yellow and blue, Tate Gallery, London, courtesyof SPADEM and ARS. Acknowledgments Piet Mondrian, New York City 1, Collections du Musee National d'art moderne, Paris, courtesy of Beeldrecht, The Netherlands/ VAGA, New York. Georges Seurat, La Seinea la Grande-Jatte, Musees royaux des Beaux-Arts, Brussels . Jean Tinguely, Homage Ii Marcel Duchamp, courtesy of the Stadtisches Museum Abteiberg M6nchengladbach, photo by Ruth Kaiser. Henry van de Velde, Faits du village VII - La ravaudeuse, Musees royaux des Beaux-Arts, Brussels. Vincent van Gogh, Van Gogh 's bedroom, courtesy Giraudon / Art Resources, New York . Andy Warhol, Marilyn Monroe, courtesy Giraudon / Art Resource, New York . Architectural trees reproduced from Bob Greenstreet, Graphics Sourcebook (Prentice-Hall, Englewood Cliffs, NJ, 1984). Celtic knots reproduced from George Bain, Celtic art : the methods of construction (Dover, New York, 1973). Computer - generated globes reproduced from Melvin L . Prueitt , Computer Graphics(Dover, New York, 1975). Farkas forms : 18 , number grids reproduced from experimental Tamas graphics 3 ( 1985 ) , pages F and 179 - 183 . Farkas and theoretical , copyright Peter Erdi associations @ 1985 , " ISAST , " Impossible Leonardo, volume . Islamic tile designs reproduced from J. Bourgoin, Arabic geometrical pattern and design (Dover, New York, 1973), and from Keith Critchlow, Islamic patterns (Schocken Books, New York, 1976). xiv Acknowledgments Lattice designs reproduced from Daniel Sheets Dye, Chinese lattice designs (Dover, New York, 1974). Stone mason marks reproduced from Matila Ghyka, The geometry of art and life (Dover, New York, 1977), and Charles Bouleau, Charpentes, La Geometrie secretedes peintres (Editions du Seuil, Paris, 1963). Tree silhouettes reproduced from Derrick Boatman, Fields and Lowlands (Hodder & Stoughton, London, 1979), courtesy of the Rainbird Publishing Group . xv VisualModelingwith Logo Chapter 1 Introduction "Skill to do comesof doing." Ralph Waldo Emerson " Chance favors the prepared mind ." Louis Pasteur Who I hope you are You might be interested photography - or in architecture . You may have had experience commercial, or industrial with a background a professional in the studio arts - painting, drawing, sculpture, in graphic, design . Then again, you might be a liberal arts type in language, literature, music, or science . Or perhaps you are type educated in the field of business, law, medicine, or theology . You could be a student or a teacher or neither or both . You may have spent long hours in art studios and possess an exceptionally rich, visual vocabulary . Then again, your graphic abilities, both verbal and physical, may be very much on the thin side . Instead, your vocabulary might be skewed toward logic and mathematical is in the sciences, philosophy terms because your background , law, or mathematics . Perhaps you are that much sought after, well -rounded person whose vocabulary is rich without being specialized . Chapter1 you You may enjoy when be able looking at art, and see them you favorite not period home you perspective , you intrigued by illustrate objects At some in has that forgotten everything the by This aging to expect own from have idea of what that , in fact , there past , you the favorite of them Acropolis means are of , but artist or your own in using perspective dozens through , say, a Pissarro a reproductions sketch in must What , but you aren ' t brought , and most of intellectual a 3 - point . You would different things and you a special by this idea , then visual by how to be ways to , visual you one of course the the few ? edge in of geometry bits You . of liberal may have coronary arrest by . your baggage curriculum vitae you carry , I hope about how things look increase this kind of variety of computer thinking to a trigonometry , whatever or is about trigonometry important taken . It .) and have geometry share at went are exactly who quick summary of basic know a little Logo but I hope says that , and you are . excitement by models . If you just because that you are words , I you encour are are . baggage gives a very you use already the manual that willing to that you are you have never came do with your some learning before , probably Logo . It is brief because copy of , not I expect Logo . In other about Logo mechanics you have been on your . If some other ( I am saddened 2 to still build chapter or Picasso a Picasso probably able a course to This willing your show computer differentiate . You be that . will Your that some book stimulated can phase paintings geometry looking you I hope have in words type excited not we Finally whatever may space every side have taken education hearing by suggestion time ( Everybody you you do the describe side , and . While to computer to met Logo language think of and you most learning likely this BASIC before other Logo language , and introduced was this to BASIC book will . Introduction give you the chance to right that terrible wrong .) If you do know something about one computer language, you should be able to plunge happily into the manual of a second language - Logo . I will give you some directional help, though, by suggesting what questions you need answered in your manual . Then it will be up to you to learn the specifics. I assume, too, that you have played around with personal computers and know how they "feel." You may like or dislike these machines, but your feelings are based on personal experience. You are familiar with disks, disk drives, keyboards, and program editors . No baggage If you have learn had acorn rough puter going who is , . If and as to " others skills doing Logo the yourself - on other give I personal your hand you - own , help or you you Logo is in a have when think computers course - access you should , ask stick to for a it - around - and have never you may find teacher , and if tried to this tutor , you book or are friend patient , . craft in " as doing it for effective needed you as can well very read . But Logo in or much like about making order to furniture learning a furniture craft , develop the . and You can you can individual craftsmanship , read talk to talents you must and physically . For old on program about with - tenacious Learning it , to Programming about experience language willing curious do no the timer newcomer can overly intimidating spirits high to suggest a craft , beginning small . And by offering , a master artisan projects encouragement that can certainly are reasonably , he be of taxing can keep help . but the novice The not 's . 3 Chapter1 This chapter is designed to reinitiate you into the excitement of Logo craft; all the exercises within the chapter have been fashioned by an experienced craftsman . These initial projects should be copied . All artisans begin learning their craft by copying what others have done . This is not to deny their creativity but rather to allow for a strengthening of the basic skills that support individual creativity . Good craftsmanship, of course, requires both skill and creati ve flair . For my purposes, skills are as much frames of mind as forms of physical dexterity . For example, in this chapter I will stress the usefulness of three such skills : first, an ability to break down big problems into smaller problems ; second, a willingness to imagine yourself as " walking " shapes into existence; and third, a propensity to tinker with your Logo machinery . Very soon (starting with the exercises at the end of this chapter, in fact) you will be asked to apply these skills to support your own kind of invention . Craft is about building things by hand, and that is what you will be doing with Logo. Copying and tinkering Copying computer programs opinion about the usefulness is so widespread that I had better give you my of it all . In the previous paragraph I said that copying was a good thing at the start of one 's apprenticeship . As you go through this chapter, I hope you will want to try out my procedures . That 's OK . But if you simply type my procedures into your computer, you will only reproduce what I have done . And that will bore us both . The book shows what I have done ; it doesn 't show what you can do . My procedures offer you a starting place, so that you don 't have to build from zero . But it is up to you to go beyond that start . So please do copy the ideas of any procedure that strike your fancy . But, once you have made those ideas work on the screen, play rough with them . Give the copied procedure 4 funny and outlandish arguments . (Very big or very small Introduction numbers could then ? be Does make your a few mands a but what procedure . the Can is still inside little changes you funny work body of guess a ? the what argument Can you ) What explain procedure ; might ? happen happens how change ? some before Go of you on the to com - experiment on ? Get nice , copied changes just these outlandish into the procedure habit , of make a tinkering few , just changes a to it little . so that Whenever it you does write , something or else copy , a . Equipment Your most than important the computer Select a track them , and ; than don good I lot will write worry , the . a of the Glue . . ' t smoke Get lines in Rubber The . and of glue is it You will , . Be at careful the . finally , of using same time If . I fancy , - with find the less . plenty of get there room ; no for will for messy is paper pages any need a not you to careful let you . and glue in in you will graph , Stick whenever and need keep sketches good Since . to little . means . disposal you the never That you your want the bound important images better you the more : handwriting Glues this . mixing best organize Queen pages that is way far at printed those is may the the be paper the in your with unlined notebook cement lot strike is everything crabbed in And - , well , get piece bound that It manuals means encourage will . and notebook Also . technical That . format . notebook listings worked large space book a . a the , organization notebooks a unlined procedure that Small glue all illustrations a , , hesive , things lot and notebook about carefully reorganize Don ' t stuff diagram this diagrams that need , newspaper suggest of in is on large work portraits equipment work with your magazine of you notebook of word a piece the , though world ' s ; it is best notebook very flammable ad - . . 5 Chapter 1 Dialects Unfortunately, there is not just one Logo . While some Logos are more alike than others, most have quirks .1 I use Terrapin MacLogo throughout this book . All the procedures have been written in this dialect using an Apple Macintosh Plus. Most of the images were generated by Logo procedures and printed on an Apple Imagewriter II printer . The rest were done by hand, mine . You may have a different machine and a different Logo . To make life as easy as possible, and to eliminate the need to talk about dialects, I have tried hard to avoid using those components that vary most between Logos. The bad news : this is a book about graphics and graphics is the area in which Logos differ most . So I skirt any graphics razzle- dazzle that might work in one Logo and not in another . I don 't use funny pen patterns, polygons filled with patterns that look like brick walls or tile roofs, or automatic mirrors that reverse images. There are no sprites or multiple turtles . The only colors I use are white, black, and (very occasionally ) a reversing pen color . All the line drawings have been done with a standard, narrow -width pen. Caveat emptor This is a little late for a warning, but here it is anyway : This is not a bookabout Logo. You will end up knowing a lot about Logo, and that is no bad thing . But the goal of the book is to get you to build visual models, and Logo is only a means to that end. God knows, we could have used Pascal. But it just so happens that Logo is easier to learn and easier to use than most of the other languages that we 1. Appendix A in Brian Harvey 's Computer Science Logo Style, volume 1: Intermediate Programming (Cambridge, MA : MIT Press, 1985), gives a nice summary of the syntactic differences between Logos. It gives no help with differences in graphics, though . 6 Introduction could have selected. Logo notation is neat and tidy ; it looks nice on the page and that encourages visual thinking . But most important, because Logo is so easy to play around with, it won 't get in the way . Turtles are us We will concentrate on the graphic parts of Logo . And that means " turtle graphics ." The intent of Logo's turtle metaphor was to inspire young children to explore shapes. The turtle is a tiny triangle of light that is moved about the screen via Logo commands . As the turtle moves, it leaves a trace of light . Children are encouraged to imagine themselves in the turtle 's place and to draw a shape by walking through it, as the turtle would walk through it . Children have the necessary body knowledge to walk a circle, even though they cannot express their circle drawing rules before walking them . Walking the turtle around an invisible circle translates the body 's knowledge into word commands : " I' m walking him forward a little bit, now I' ll turn him a little, I 'm walking him forward a little bit, now I'll turn him a little . . . I'll keep doing this until until he's finished . Yes, that 's it ; I'm back where I started ." Once said, the words are available to be transformed into Logo commands. Because adult bodies may be more spatially intuitive than children 's, your turtle visualizations can be far more effective than a child 's. There is a problem with adults, though ; they aren't used to playing imagination games as adults and must be coaxed into it . Children are happy to play silly games; adults may be embarrassed to try . I will be asking you, after all, to imagine yourself as an electronic turtle . And what would that feel like, I mean physically ? Use your turtle body and walk around a bit . Don 't reject visualization and muscular thinking before you try it . What was good enough for Uncle Albert should be good enough for you . Listen to what he said: "The physical entities which seem to serve as elements in thought are certain signs and more or less clear images which can be 'voluntarily ' reproduced 7 Chapter1 and combined . . . this combinatory play seems to be the essential feature of productive thought . The above elements are, in my case, of the visual and some of the muscular type ." - Albert Einstein Turtle space Turtles live on your computer screen . Make sure you know the size of yours, since different computer screens have different generally stated in vertical dimensions . Screen dimensions (the y -axis direction ) and horizontal are (the x -axis direction ) measurements . Pinpoint the x = 0 and y = 0 point on your screen . The turtle can be moved about the screen using cartesian x-y coordinates or turtle coordinates . Cartesian commands send the turtle to a specific xy position on the screen, without Various regard to the turtle 's current position . SET commands move the turtle through cartesian space . Review them . In the turtle reference system, all commands refer to the turtle 's current position, not its final position . The turtle is moved forward, backward, turned left or right in relation to where it is now . Review the turtle reference commands : FD, BK, PU, PD, RT LT . In the cartesian system, the destination is the important thing ; in the turtle reference system, it 's the trip . Making shapes Let's draw a simple shape using turtle reference commands . Suppose you would like the turtle to draw a square box located at the center of the screen (usually the origin of the xy coordinate system). Here are the three steps you would take: First, you would clear the screen by typing CG (clear graphics ). The turtle now sits at 0,0 and faces straight up . 8 Introduction Second, you would through think about the commands needed to walk the turtle the shape . Use the turtle metaphor . 1. " OK turtle ? Go forward 50 steps and turn right by 90 degrees. That completes the left side of the box." 2. "Now, go forward another SOsteps and turn right by 90 degrees. That completes the top of the box." 3. " Go forward yet another 50 steps and turn right again by 90 degrees. That completes the right side of the box." 4. " Go forward another 50 units and turn right 90 degrees. That completes the bottom edge of the box." That 's it . The turtle has walked around the four sides of a size 50 box, arriving back to where it started . These prose commands would translate into Logo as: 1. FD 50 RT 90 2. FD 50 RT 90 3. FD 50 RT 90 4. FD 50 RT 90 The third and last step would be to type these commands on the keyboard . And here is what you will see. 9 Chapter 1 " 2- , J 4- Great . This series of commands wasn 't it tedious does indeed draw the square you wanted ; but to type in all that stuff ? The command FD 50 RT 90 was typed four times . Surely there is a shorthand method to repeat this line four times without typing four times . Review the REPEAT command ; it is exactly w hat we need here. Try it . CG REPEAT 4 [ FD 50 RT 90 ] Notice that the line REPEAT 4 [ FD 50 RT 90 ] is a kind of operational definition of what a square is : a square is four sides, four FD commands , with each side joined at right angles to the next, the RT 90 commands . That 's tidy, but it 's still a bore to type two lines each time you want a size 50 box on the screen . After all, you may want Wouldn 't it be convenient to draw 100 boxes . to be able to " tell " Logo your square and then to give that definition definition of a a name ? Logo proceduresgroup commandsunder a single name You can group a series of Logo commands together under a single name by writing a Logo procedure . The name of the procedure is a shorthand for all commands in- 10 Introduction cluded in it . Typing the name of the procedure tells Logo to automatically execute each line of the procedure in turn, just as if you had typed them, one after another, on the keyboard . You can " tell " Logo your definition of a square by creating called SQUARE. Logo will " remember " your definition a procedure until you either erase it or turn off your computer . Review the defining and editing procedures in your Logo manual . Shapes defined. and drawn by procedures Let 's get on with writing the necessary procedure . Here it is : TO BOXSO REPEAT 4 [ FD 50 RT 90] END Logo will add BOXSO to all its other commands . Each time you type BOXSO, the turtle will draw a square of size 50. The figure will be drawn at the turtle 's current position on the screen . Unless you move the turtle to a different starting point, each time you type BOXSO, the square produced will be on top of the previously drawn figure . So move the turtle around to new positions and draw some more boxes . But you can certainly be more imaginative than that . Create an interesting design on the screen using only the BOXSOprocedure and move commands. If you have a color screen, you might want to investigate the effects of changing the screen's background color and the color of the pen. Keep track of what you are doing in your notebook so that you can reconstruct your successfuldesigns. Here is a simple command that wraps boxes around the screen: REPEAT 25 [ PD BOX50 PU RT 15 FD 60 LT 15 ] 11 Chapter 1 Wrapped boxes Here are two different images produced by that one -liner . How are they differ - ent ? Is one image more pleasing than the other ? Why ? 12 Introduction Generalizing procedures What about boxes of different sizes? You could edit the BOX50 procedure every time you wanted it to draw a different size box. You could also define many BOXlike procedures, each to draw a different size box. But that doesn't seem very efficient, does it ? After all, Logo itself doesn't have a different FD command for every possible length of line that you might wish the turtle to draw . There is not a FD- 1O command for drawing lines of length 10 and a FD- 43 command for drawing them 43 units long . Logo has a single FD command . Whenever FD is used, an argument must be used in conjunction with it : the form is FD argument . A single argument must be typed just after FD. For example, one could type : FD 10 or FD 43. The value of the argument " tells" FD how to go about its business of drawing straight lines . Isn't this convenient ? One command does a variety of things . FD argument draws straight lines of any length . If we change the value of the argument, the line length changes accordingly . Let's generalize BOX50 in terms of box size as FD is general in terms of line length . Adding an argument to a procedure Define a new box procedure that has a size argument . The value of the argument will tell the box procedure how to go about its business of drawing boxes. Changing the value of the argument will change the size of the box. You can now draw boxes of any size from, say, 1 unit to 5000 units . Use this example as a "pattern " for incorporating an argument into a procedure. TO BOX : EDGE REPEAT4 [FD : EDGERT 90] END 13 Chapter 1 Putting a demonsuation procedure together I am sure that by this time you have already designed some interesting patterns with various BOXprocedures. Some of these patterns you probably liked enough to print and glue into your notebook. Remember to include a few written comments on what you were trying to achieve. Perhaps you would like to show off your designs. You could show your pals the images in your notebook . But seeing an image is not the same as seeing how the image is drawn, the order in which the pieces are visually assembled. How would you go about demonstrating this? You could retype all the Logo commands needed for your screen collage. What else could you do? Remember that Logo procedures can group a series of commands together under one name. So let 's define a new Logo procedure that will run all the necessary steps to demonstrate your design. Once defined, you will only have to type the demonstration procedure 's name to have your designs redrawn on the screen. Your demonstration procedure will have no arguments; it will only do one thing : generate a specific design that you want to show to your friends . If you wish to show off with several designs, you could design specific Logo procedures to reproduce each design. Here is an example of such a demonstration procedure : TO DEMO ; A demonstration procedure to show off a design ; produced from multiple boxes of different sizes . REPEAT 4 [ BOX 100 BOX 98 BOX 96 BOX 75 BOX 40 BOX 35 BOX 30 RT 90 ] END To see the pattern defined by DEMO , type it : 14 Introduction Funny feelings Do you have a funny feeling that this isn't enough, that we aren't producing great enough images? Let's think about this for a while . Drawing with Logo should not be the same as drawing with a pen or pencil . What can be sketched quickly by hand is unbearably tedious to sketch with Logo. You may have tried sketching with Logo by moving the turtle as you would move your sketching hand . It doesn't satisfy, and it doesn't work . Logo is a unique medium for visual expression; don 't expect it to, be like other media . Visual modeling with Logo is as different from drawing as clay modeling is different from photography . Our Logo media is a visual modeling media . We use it best to build models . Why ? To encourage us to think about shapes. The drawing is done to encourage thinking . So don 't worry too much (now ) about the final image. Don 't worry if your designs aren't amazingly beautiful ; don 't be concerned if they aren't " arty ." This isn't, after all, a book about computer "art," but it might be useful to think about ART for a minute . Here is a quote from a computer art type, Harold Cohen from the University of California at San Diego : " For most people outside of art, 15 Chapter 1 probably, art is directed primarily at the production of beautiful interesting images ; and who is to argue that a complicated beautiful than an Elsworth machine simulation Kelly painting of Mondrian Lissajou figure is less or a Jackson Pollock ; or that a is less interesting plagiarizes ? To talk of beauty or of interest objects and than the original it is to talk of taste, and matters of taste cannot be argued with much profit . The fact is that art is not, and never has been, concerned primarily with the making patterns . The real power, the real magic, which of beautiful or interesting remains still in the hands of the elite, rests not in the making of images, but in the conjuring of meaning ." A little professorial, this . But do you think he has a point ? Go back to your demonstration procedures, the ones that have no arguments so they do only one thing . A procedure drawing procedure much thinking procedures that does only one thing is like a box that draws only one size of box . One box doesn 't encourage about the nature of boxes, does it ? Can you use your demonstration to explore the nature of a collage that intrigues with the collage demonstration procedure Maybe you could generalize argument . To generalize does ; and that 's our appropriate that draws it . Tinker a bit . the demonstration a procedure you ? Play around procedure is to stretch your thinking by adding an about what it work, too, because it respects the uniqueness of the Logo art medium . " It 's the tinkering that counts, not the artiness ." Pin that phrase over your computer screen . Generalizing a procedure with arguments Let 's go back to that BOX procedure . Can we generalize it so that it draws triangle " boxes " as well as square ones ? While we are at it, let 's ask BOX to draw boxes with any number of equal sides . These shapes will be regular polygons with n sides . Why not call the generalized procedure NGON for n-sided polygon ? Look again at the procedure BOX into NGON. 16 BOX and decide what needs to be changed to turn Introduction TO BOX :EDGE REPEAT4 [FD : EDGERT 90] END You need to add a secondargument : N. This will tell Logo how many sides to draw. We can replacethe REPEAT 4 with REPEAT : N. FD : EDGEwill stay the same, but what about the angle you want the turtle to turn before drawing the next side? It surely will be different for different sided polygons. Generally, sketching focusesgeometric thinking . Here are some walking plans that you might issue to the turtle to do NGONs . 7. <. 1 '1 ~ \ 2 A ~ ! - \ . How can you calculate the angle indicated by the " ?" for any n-sided poly gon? Your geometric intuition should tell you that the turtle, after making : N turns, will end up facing the same direction in which it started . The amount of each individual turn will be 360 divided by the number of turns, or 360/ : N. (Now is the time to recall Logo 's mathematical capacities. Review the Logo notation to add, subtract, multiply, and divide .) You are ready to write the new procedure NGON : TO NGON:N : EDGE REPEAT :N [FD : EDGERT 360/ :N] END 17 Chapter 1 Try it out . Notice that when : N becomes large, the drawn figure becomes a circle (almost ). Carry out some clever visual experiments with NGONs. Some observations Look back carefully at what we have done so far with procedure writing . We started with a list of commands that drew a box of a single size. Next, we grouped these commands into procedures that could draw boxes of several different sizes. Next, we generalized the BOX procedure with an argument so that it could draw boxes of any size. Finally, we produced a still more general procedure, NGON, that can draw any regular, polygonal "box" - triangles, squares, pentagons, hexagons, and so on- of whatever size we wanted . Making the simple more complete What next ? How can we make these simple polygons more interesting ? Maybe we can add another polygon characteristic to NGON . Sometime in your life you were probably given an exercise like the follow ing . " Cut out some different sized squares from a sheet of colored paper and think about placing the squares on a large piece of white paper . First, try to arrange the squares so that your design feels unbalanced and looks wonky . Next, rearrange the squares to create a balanced design." What kinds of changes did you make? What about creating an arrangement that looks sad and another that looks euphoric ? Each design used the same squares. What made them different ? Their placement . Make NGONdraw a bunch of NGONsand put them on the screen according to some placement rule . Take out your notebook and doodle . Here are some results from my doodling . Your approach will be different . I'll explain mine, and I'll expect that your plans will go into your notebook. 18 Introduction Sketches of spinning polygons that grow or shrink as they spin - - _..~~ ~ (s:e..,.."'('",,.J(,. ~ l (,.G --c:12 . / l' (r.G, -r-"JC::r SMA Ll . En- SI =iit C+-,p, ~ CrE 19 Chapter1 Word description of sketched ideas " I want Logo to draw a series of polygons rotating around a common point, and I want each successivepolygon to get bigger, or maybe get smaller . " I don 't know what angle to turn between one polygon and the next, so I'll include an argument called : ANGLE that I can vary, to see what happens. " 1 don 't know how big the growth should be between one polygon and the next, so I 'll define another argument called : GROWTH . I 'll play with different values of : GROWTH to see what looks best. " How do I make : GROWTHwork ? Growth can be of two sorts: growth by a constant amount, or growth by a constant percentage. I 'll try the latter . That means that if I want polygons to grow by 10%, I define : GROWTH to be 1.10. For a 90% shrinkage I would use : GROWTH = .9." A procedure to spin polygons TO SPINGON : N : EDGE :ANGLE : GROWTH NGON : N : EDGE RT : ANGLE SPINGON : N ( : EDGE* : GROWTH ) :ANGLE : GROWTH ; Here is the recursion . END What is new here? First, there are more arguments than you have seen before. Every time you use SPINGON, you must remember to type four numbers after it . Second, this procedure is recursive : the last line in the SPI NGON procedure asks that SPINGONbe done again, but with some arguments changed. For example, ( : EDGE) becomes ( : EDGE* : GROWTH ) the first time recursion is called; and then ( : EDGE* : GROWTH ) becomes ( : EDGE* : GROWTH ) * : GROWTH the second time recursion is called . A recursive procedure is a procedure that uses itself as one of its parts . Will SPINGON ever stop? Try it out . 20 Introduction Somespingons SPINGON30 2 10 1. 02 95 HOMECG REPEAT 3 [SPINGON4 120 0 . 95 50 RT 90] SPINGON 4 120 0 . 95 19 21 Chapter1 Stopping recursive procedures One last procedural writing point to review . Having put SPINGON into motion, how do you make it stop at a stage of your choosing? You need to have a way of telling it how to stop . That 's another characteristic to include as an argument . Look at the following modification to SPINGON. Review the conditional commands in Logo. IF . . . [ something ] is such a conditional . Using the IF phrase, everything becomes very tidy . TO ; SPINGON IF ; : N Note the : TIMES This < is NGON : N RT : ANGLE : GROWTH argument 1 above [ STOP the : TIMES . ] conditional stopper . : EDGE : ANGLE SPINGON ; : EDGE new : N Note ( : EDGE the new * : GROWTH ) : ANGLE above . me give you topic that gives most students talk about : maintenance argument : GROWTH ( : TIMES - l ) END Boring logistics Before ending Logo language one about of the most from files the , let . The boring please . Do chapter manual it . But material files this same things review , how review to how to erase for storing to save files , and a few text more file items material how to as catalog retrieving files graphics to review from the most problems . So files , , I how and information how your is won 't to retrieve to talk print . A note on the procedure presentation style used in this book I have tried to make the presentation of procedures possible . Here are several of my presentation 22 rules . in this book as readable as 00 t~o :r:1~hj ~ hj -C :jHo -C :jH~ Introduction First, the many commentsrule . I have included wordy explanations in some of my procedures. These comments begin with the Logo command " ; " . There is, of course, no need for you to include these comments in your own version of my procedures. However, it is a good idea for you to put comments in your own procedures. Second, the meaningful cluster rule . I often include extra parentheses to group like elements into a cluster. This is useful, for example, when an argument is composed of a collection of Logo material, but you want to see it as a single cluster of information . Here is an example from this chapter. Notice the use of comments, too. TO SPINGON : N : EDGE : ANGLE : GROWTH: TIMES ; Note the new argument above . IF : TIMES < 1 [ STOP] ; This is the conditional stopper . NGON : N : EDGE RT : ANGLE SPINGON : N ( : EDGE* : GROWTH ) : ANGLE : GROWTH( : TIMES- l ) ; Note the new argument above . END Third, the body structuring page without rule . Procedures should be laid out nicely on the too much information should be divided on anyone line . Long procedure statements up between lines to make them more readable . The special character " - " is used to indicate continued from one line to the next . Here is an example . Notice that the Logo material within the [repeat brackets ] would long statement had not been divided TO SQUIGGLE REPEAT :N [ END when : B Logo statement have been difficult has been to read if the into several short lines . : N :A - 130 - :A - 50 - :B a single ] 23 Chapter 1 The symbol " - " indicates, of course, that the return key should not be used becausethe Logo statement continues. Consult your ov- mLogo manual for handling the problem of procedure layout . Exercises There are five exercises to explore before going on to the material of chapter 2. The first is so important that we will go through it together, step by step. You can work on the other exercisesby yourself . Exercise 1.1 Make NGONmore versatile by doing two things to it . First, improve NGONso that it will draw polygons around a central point; and second, improve NGONso that it can be given an argument that specifies not the length of an edge of the polygon but the radius of the polygon. I' ve made up the term radius of a polygon . It is the radius of the smallest circle that just encloses a regular polygon . The center of this circle is the point around which the polygon is to be drawn . Seethe diagram below . t ~ .J, . " " ' 0 . . . . fr.o . . . . . . . . . R lS ~ ' . " t>\ ~ S 0 ;:: 1' ~ l...vG-l.?, J Call the revised procedure CNGONfor " entered NGON ./I 24 . ' . . . . . . Introduction Two hints : First, ask yourself what arguments CNGONwill need. This is another way to ask yourself what information must be given to CNGONso that it can go about its business of drawing centered NGONs . CNGONneeds only two pieces of information, or two arguments : the number of sides of the polygon to be drawn and the radius of that polygon . That means that the first line of the new procedure will look like this : CNGON:N : RAD Second, imagine yourself as the turtle . How would you walk through the design that CNGON must make? Draw a simple diagram to describe such a " turtle walk ." You might want to divide the diagram up into individual scenes. Later you can translate each scene in words and then into Logo notation . Here is the first instance where this turtle visualization is really needed. Let yourself go; talk out loud ; get on with it without too much thinking . Word description of the turtle walk (see sketches on next page) Diagram A: Gettingread~ to drawthe~ol~gon. You, as the turtle, begin your journey from position (1), the center of the proposed polygon . You are facing straight up . Pick up your pen and move forward by the amount of the polygon 's radius . This is : RAD. This puts you in position (2). You now need to turn right by an amount that is labeled (angle) on the sketch (3). What will (angle ) be related to? Will (angle ) be different for differently shaped polygons, that is, polygons with different numbers of sides? Yes. Will (angle) be related to the overall size of polygons ? No . Don 't worry about how to calculate (angle), yet; you can work that out later . 25 Chapter 1 Turtle walk sketches . . : (3) . . . . . . . . ~ A \) II .I.~ : . . . . . e A ::B t t :~ (+) (b) . ~ ) AIIJ6 -tE~ . c 26 ~ c..~) ,]) Introduction After turning right by the amount of (angle), you are looking along one of the polygon 's edges (4). Put down the pen in preparation for drawing the polygon . Diagram B: Drawing the I2o1~gon. You are at position (4) and ready to draw an n-sided polygon . You can use the procedure NGON. But what arguments will you use? It needs some values for : N and : EDGE. Right ? Yes, but wait a minute . What should the value for : EDGE be ? You know the value of : N, the number ')f sides of the polygon . And you know the value of the new argument, : RAD. What must the polygon 's edge dimension be so that, after it is drawn, it has a radius equal to : RAD? In other words, we need to be able to express : EDGE in terms of : Nand : RAD. OK . We know the problem, what we have to work on, but let 's not stop yet . Label the edge thing that must be calculated (edge). We will return to it in a minute . Now you can draw an NGON : N (edge). You began the NGONfrom position (4). You will end at the same place. Diagram C: Gettingread~ to returnto thecenter . You are at position (6). You must now turn left by the amount of (angle); this is indicated by (7). This leaves you in position (8), pointing straight up . Diagram D: Returning to the centerof the ~ol~gon. Pick up your pen and back down, by an amount equal to : RAD, to the polygon's center. Finally, put your pen down in preparationfor whatever might comenext. Note that you, as the turtle, have ended in the sameposition (9) as you began (1). 27 Chapter 1 A turtle walk transfonned into a Logo procedure (almost ) No more words are necessary. Here it is. TO CNGON : N : RAD PU FD : RAD RT (angle ) PD NGON : N (edge ) LT (angle ) PU BK : RAD PD END The procedure is sketched. And we know what we know and what we don't. The two amounts, (angle) and (edge), are still unknown . To figure these bits will require a little geometry and trigonometry . We might as well use this opportunity to review all the bits and pieces of polygons . The Geometry of CNGONs two diagrams in conjunction with the word and equation Use the following descriptions . , . . . k /' :: !~d.e : . . . ~~ /2. . . - 6 ~\ : / - " \ e/ 2. f 6., ' 2. .-...-. . ' . . . . . . . :, .. , .. . ' . .. ' . ~ \, .- . . -" . . . ' \ . . : ." - - . ' . . , . . , . , , ' . . .'t. . ..' . . . . . . . . .. . ." ",., D ., ~ :~ o... . . . . . . . . ' D . . . Q.. . . . . . r " ' - ~ - ' . . . , . . ' . ' ' ....., ~~ . . . ' . . . ' . . . . . . . . . . . . . . , . , . . . . - . , ' 28 . . . . . . . - . - ' . . . ' . . . . , . v . IJ.., . . . . .\" .''..*.'' ...tIt' ..'7~' Iv - - . . . " , . " " ... c.1 . Introduction The first problem we face is to find an expression for angle d in terms of n, the number of sides of the polygon . The second problem is to find an expression for the length of a polygon 's edge, e, in terms of its radius, R, and n, the number of sides . In preparation with for these two acts, let 's look at all the angles associated polygons . The central angles, labeled a, are easy . They are each equal to 360 / n . The external angles, labeled c, are also equal to 360 / n . The external angle is the turning angle used in NGON. What about the internal angles, labeled b . We need some work here : (1) c = 360jn, (2) c + b = 180. 29 Chapter 1 Putting (7) and (6) togetherand solving for e gives (8) e = 2*R*sin (180/ n) <---Secondl2roblernsolved. Review the following trig functions : sine, cosine, and tangent . What is an arctangent:? Draw some diagrams to explain each of these functions . Glue them on the insidecoverof your notebook. Installing the necessary geometry into CNGON Here's how far we have gotten with CNGON : TO CNGON : N : RAD PU FD : RAD RT (angle ) PD NGON : N (edge ) LT (angle ) PU BK : RAD PD END Now we can replace ( angle ) and ( edge ) with the needed expressions . Here is the finished CNGON : TO CNGON : N : RAD PU FD : RAD RT 180 - ( 90* ( : N- 2 ) / : N) PD NGON : N (2* : RAD* SIN ( 180 / : N LT 180 - ( 90* ( : N- 2 ) / : N) PU BK : RAD PD END 30 Introduction Lessons and When solving visual problem in tips down turn , and Exercise Put into then 1 problems several plug one presented chapter . or placing simple balance or ' s the little reproduction little more thing . solutions want to shapes emotions title . . , DEMO act below ( That CNGON problems , Solve together try each to procedures reviewed them might reproduced this smaller the and Make You like form to break of the small big solution one the single big problems . . 2 together ideas , by more strangely think some on a A painting What the ? in Can this chapter by way . ) you do about field be What something . make imaginative Modify use every procedure of the in the . more blank could that of exercise paper the more the to Russian that do similar depict artist elegant emotion , you described above different eight feel when of feelings Kasimir these , of Malevich red looking is rectangles ? at this ? 31 Chapter1 Exercise1.3 Combine the ideas of SPINGONwith your newly constructed CNGON . Exercise 1.4 Design a fancier CNGONthat fills up a polygon with textures. Here are a few visual tips for Exercises 1.3 and 1.4: 32 Introduction Exercise 1.5 Design a Logo procedure that puts polygons on the vertices of other polygons . Hint : look carefully at the body of CNGON. When does the turtle arrive at a polygon vertex ? Mark the vertex arrival place in the CNGONprocedure . You might consider this location as the right spot to install some recursion : when the turtle arrives at any vertex, ask it to do another CNGONcentered on that vertex . This recursive drawing will place polygons on the vertices of polygons on the vertices of polygons . You will need to figure out a way of stopping the recursion machinery, or it will continue forever . Define a new argument, : LEVEL, to keep track of recursion levels. What about the relative sizes of the polygons ? Should they get bigger or smaller ? Can you handle that? Don 't forget the following tricks : 1. Imagine yourself as the turtle . 2. Sketch the design that the turtle must walk through . 3. Describe the turtle walk in words . 4. Divide the walk up into logical sections . 5. Note the bits you know and the bits that will need some further thought and research . 6. Translate the words into Logo commands . 7. Test it out with realistic and totally outlandish argument values. 33 Chapter 2 Visual Modeling " In the case of miniatures, in contrast to what happens when we try to understand an object or living creature of real dimensions, knowledge of the whole precedes knowledge of the parts . And even if this is an illusion, the point of the procedure is to create or sustain the illusion, which gratifies the intelligence and gives rise to a sense of pleasure which can already be called a es the tic ." Claude Levi -Strauss, The SavageMind Models Most physical models are miniatures, smaller versions of something else. Model railroad engines are good examples, and many of us have had pleasant experiences with them . They can be picked up and looked at from any angle, and they can be experimented with, too . How many wagons, for example, can a model locomotive pull ? Attach 10 wagons and see if the locomotive can pull them . And if you should sit beneath a model railway bridge when the tiny engine rolls across it, pulling all those wagons, what will the sound be like ? Will it be like the real thing ? Listen carefully and you will experience a double thrill : an excitement that comes from using a model to hear how a full -sized locomotive might sound; an excitement that comes from simply playing, on your own terms, with a miniaturized piece of the world . Visual Modeling I believe closely at the our clarity ourselves , that this kind of world , is very useful of vision not in just well . is about construction as This visual book images are produced by more whatever they raw material Logo get in OK . No Logo . But An important What more first . But material in the model Chapter to a talking in next requires what ask now few of my style ; a review 's an image have a fair patterns and models of , images will our models though All must try first . OK . Models and times , you craft design visual procedures fact that involving their Logo . In build does fair mean now is the time . Logo mechanics text the good time of . Logo hard not be , is the to let ? - producing machine . In you working of Logo , the the using you will the exercises at Logo , a and that get used centered polygon of turtle the 's style right assignment walks , and build through . be some helpful . the geometry you to away . Be . This simple the throughout apply introduce that end the your 1 ; go would to at to Chapter chapter Logo compare used . Try the looked need probably will yet you trigonometry 1 to scan review material , Chapter 't let what of haven 1 will ' t just review introduction you . Don addition on If Chapter geometry should understanding section some to ? with out the time exercises maybe try know much a next , and already is you , in the you , so bines from more convinced explores . Other . look by using world Logo am in that designs building that 1, 1 describes some but to narrative , you of in spend about . Let the described examples book pause Chapter if not introduction knowledge Even constructed model pursued machinery be your best modeling imaginary is , I models real us addition is create the encourages . . . language visual of will book of play of kind or it . In such from , will this way comes current much abstract , but the special we represent because manipulation a very that by the Sometimes , enjoyment developed . machines play my Logo - sure to exercise com geometry . - 35 Chapter2 Go back and take at peek at Chapter 1 right now . Have a good read and take your time with it . If you are a real Logo high -flier, test your flair by doing the exercises at the end of Chapter I, before you glance through the hints given there. After having a go at these problems, compare your Logo style with mine . On to modeling I have decided to begin this work with something concrete, something from the world of things . We can do some abstract modeling later on . The example that follows is a description machine . I never built of ideas or emotions of a device that I vaguely remember seeing described in an old Scientific American a pipe - and -roller selected magazine . I 've called it the thing, but I always wanted to see how it worked . Pipes and rollers Imagine that we are wandering about a construction site where there are useful bits and pieces lying about, free for the taking . While this wandering will be done only in our minds, the images seen there are based on impressions from past, real excursions. We will need some short sections of plastic pipe, the kind used for plumbing . Try to find as many different -diametered pipes as you can. Here is a sketch of what you might have picked up so far. 36 Visual Modeling Next, let 's assemble a collection of wooden dowels of various diameters, from very small diameters to very large ones . Dowels, or rounded wooden pegs, are used to join together adjacent parts by fitting holes . Dowels are used by cabinetmakers tightly into two corresponding to assemble fine pieces of furniture when nails or screws would be unsightly ; and large dowel -pegs are still used to fit together wooden beams when aesthetics are more important than cost . Call the dowels that you have assembled " rollers " ; you will see why in just a minute . Here is a sketch of my dowel collection . (Sketches are models, too .) Assemblin19the pipe -and-roller machine Now, imagine that one section of pipe is floating in the air at eye level ; one end of the pipe is clearly visible to us, and the pipe 's length is parallel to the 37 Chapter2 ground . Now, hold one of the dowel -rollers parallel to the length of the pipe and place it on top of the pipe . Next, imagine rolling the dowel around the circumference of the pipe until it arrives back at its starting position at the top of the pipe . You will have to hold the roller very carefully so that it doesn't slip on the pipe but rolls nicely in contact with the pipe . If you roll the dowel around the pipe in a counterclockwise direction, the dowel will also turn counterclockwise . - ' " The dowel would ' , turn in a clockwise direction . . " if the rolling -about -the- pipe was also in a clockwise direction . Note the two motions of the roller : the roller goes around the pipe as it turns around it own center . The two centers, the center of the pipe and the center of the roller, will feature in all our calculations . 38 VisualModeling Now that you have an image of the physical machine in your mind 's eye, I can ask you to begin manipulating the parts of the image. Imagine playing with this model in your mind . What will the roller "look like " as it rolls around the pipe ? Can you draw a picture of it ? Or better still, can you create a Logo model of this roller / pipe machine that can illustrate the motions for us? Imagine, for example, that we glue an arrow onto the end of the roller . What pattern will the tip of this arrow trace out as the roller moves around the pipe ? Imagine a series of photographs taken at regular intervals as the roller moves around the pipe . Let's construct a Logo machine that will work in this photographic way . In other words, let 's build a Logo machine to model the physical pipe -and-roller events visually . Roller talk At first glance, this exercise looks pretty than the centered polygon break this problem polygon problem difficult .! certainly more complicated problem discussed in Chapter 1. But, if we could just down into smaller, more manageable parts, as we broke the down, some of the complexity might vanish . So let 's set about doing just that . First, we can talk about the geometry already of rolling know . Then, we can do a turtle -walk words . Finally, Logo will act as the glue cylinders to see what we scenario - with sketches and to stick all the individual parts together . 39 Chapter 2 Look at the figure on the left below . We see the roller at the top of the pipe, position (a), and then rolled counterclockwise around the pipe to position (b). How much has the roller turned between points (a) and (b)? The dark bands in the figure indicate the contact surfaces between the roller and the pipe . If there is no slipping, the length of the band on the roller must equal the length of the band of the pipe . Why ? a- (b)( . We could think of this rolling in another way . See the figure on the right above. Imagine that the roller stays fixed at position (a). The roller now rotates at (a) while the pipe is rotated- clock wise- underneath it from (b) to (a). In this alternative view, the roller also turns in a counterclockwise manner, by the distance indicated by the dark band . Here, as in the figure on the left, the length of the band on the pipe must equal the length of the band on the roller . How can we calculate the lengths of these bands? First, note that the bands can be described as segments of a circle, that is, some fraction of the total circumference of a circle . Well, what do we know about circumferences ? Any circle 's circumference, C, equals 2nR, where R is the radius of the circle . Now look at the figure on the next page. 40 Visual Modeling ( a. ) - The band ' - - on the pipe fraction is the number of degrees in where band 27tRp8 / length 360 , of the What next physical ? 8, / measured a circle . The Rp is the radius on the We photograph the distance to point much that outset ? two circumference degrees of the pipe 360 . , . ( phi ), , ( a ) and the same Rr to is the degree Here . If we it is 360 pipe is each other in of pipe , . the , This total therefore , provides of other rotation (b ) . by radius to each the thinking equal equal the on The Here of divided band expressions are between for you Listen on radius : its of the roller talk more about around , the by the length the the roller . , since the . Then we roller , in terms we want : know the and the of how pipe dividing pipe / represent is the expression So of the in length : 27tRr4 express between knowing stopping set of Rr expression And roller can distance rotation degree fraction ), terms degree 8Rp This to the some ( theta they rearrange CP = 8 dimensions can of angle is , 360 by the roller relative many times can calculate number of we the , rotation of we the can 8, the stoppings use . the roller tidy from one , you . big . But this problems before we problem down go on to than you into smaller the turtle thought walk you ones knew makes will at the getting 41 Chapter 2 started easier. And once you get started moving in any direction, you will discover that you are already familiar with much of the scenery. A turtle walk around the pipe Remember that a turtle -walk scenario describes in words and sketches how you want the turtle to walk through a design . Let yourself go, but be specific . Addressing your instructions to the turtle and talking out loud may be helpful . Let's use the sketches on the next page as the focal point of this scenario. I have divided my turtle walk into small scenes and have given each a letter designa tion . The previous shapes in this section were drawn with Logo procedures, but I have intentionally left the following figures in freehand form ; they are taken from my own Logo notebook . I wanted to remind you that sketches come before Logo procedures that draw rounder circles. The following sketches record my visual doodling about this particular problem . But to appreciate the usefulness of sketches, you must do some yourself . Don 't just look at my examples. Because sketches can be effective visual aids for careful thinking, they need to be drawn carefully . I occasionally use rulers and a compass, but not always . Of course, the small diagrams on the next page are final sketches, not beginning ones. Final drawings, like final Logo procedures, are the results of many preliminary studies, many of which did not " work out properly ." Word description of the turtle walk DiagramA: Qrawingthe~i~e Begin at position (1) facing straight up. Draw a circle around point (1) with radius Rp. This will be easyto do using CNGON . (This procedure is listed below, but seeChapter 1 for a full description of it . Think of it as a black-box procedure 42 I "" ' -.. / " . D. ' , . .:. .'-' . " . . . . .. . . , . , , . \ ...." . v , . " ' " " . ~. . ' ' . , , ' , " ' J>" " .. , , . ' ' , . ~ - ' . " D> . ' , , , , . ' , . . Visual Modeling Turtle -walk sketches of the roller -pipe machine E. F. q G . H. 43 1111 ~ MOU s1uawn Jo l ~ lE Sn ! pEl PlnoM 09 OM } a1l1 UO ! 1 ! sod ld2uoI O ! Jap MElp JeldE4~ ~ PUE aa aD ! od ' UMElP 01 . IEl : JuaJ aq lad pue E punolE UO ~ Alod a1 . I ~ Jo la . uO ~ Alod o ~ Slalpun !{J~ S~~OlE ! li! Melp ! JJ1U3 lanDl U ~Ua ~ ; Alod ) l( Z ~ ) Sn apl UO uO pap! !pt1 ! sod !?ls - JO oz :urOlJ E- liD SDa a1l1 ! 1 !qJrqM S !aIJl ;2u ) t ?! !1le Mt J suo a1l1 ' Jo ~ Alod lEln ~ al SMElp ' 1E1l1 auop ! s Jo~ Iusel ! 1 ! sod sap laqwnu{ 1 ! ' UOa1l1 'N 2u a1l1 E sau G ~ ~UnOUle dUlOS pdUln ~ dq II ! M + d ~ S' !2u a ;!)JeJ ut ?~ sale! P nOA al, l ~ { 1 MelO l { J !l { M U ! U UO ! ~ e ~Ol dq ~ d ~ elrole .~unOUle I ~nOA : g! !UIarr WEl2E Uo } ! soa xau {lanOl S U lallol ! J ale.Ia1 all al! }Oa{ }~~Ot~?l ual U~ snln ! ~Ua {! M !UO lO ! ~ 1 !:usod : )! aao ruelS ! ~s l {' Je 1 } 01 !G ~ : al { 1 urOlJ snUl noA sell paAour !a ( ( ) all ldIIOl 1aA .M al .( ) U all } O ~ dSne ; ) dH sell laIIol ~ u ! od ~V } Jo .Ia } uaJ dq 10U OU II N! M MOlle dq ~ ' ( Z ) ?( 1dn) uo uad !UMelp } ! soda1 . I '~ad~aq;! )d! dueJ at ' {~}xaJo .Ia } uaJ al {at1 { '} aJuaH O } ) { Jeq ! 1U ! od MOlle ! 1le1S put 2U ?lp MoN ~S MOllE aa ~ ~! ~Ueleaala ! MEla pal lO ]a4 UO : J a1l1 ~Ua ; ) a1 . I ~ I ( ZMOlle ) uo ! ~ ! sod o ~ aAOW 1el { 1 pue ! J ' 1E1l1 dn 1laIJl { 2 ! el1S a1l1 { 1saqS ! ! lJSWnJl !J pala Jo ~ a4~ Alod ~ liD uo al ~ all1 ( Z ) -uo . 09! ~ ! sod uo Sn ! pEl ! a aqa4 PlnoM ~ JD ! 1. I . L ' lallol NO ~ N : ) : aldwExa . s . aNlm Sa ) { E1 NO ~ N : ) 1U ' av OZ 1UallnJ . UMElp Aue Visual Modeling Diagram F: Orienting therolleranddrawing thearrow The roller has moved from position (2) to position (3) by rotating about its own center. We used the symbol to indicate this rotation . The angle is measured relative to the dotted line linking the centers of the pipe and roller : (1) to (3). You have arrived at position (3), pointing along the axis (1) to (3). If you now turn left by angle = 8Rp/ Rr, you will be facing in the correct direction to draw the arrow . Draw the roller circle, too. Diagram G: Gettingbackto thecenterof the12i12e Turn right by 4>, pick up the pen, and move back down to (1). DiagramH: Pre~aringfor thenextrollersto~~ing~osition Get ready to position to the ( 4 ) . The the dotted culated cj> at the arrow , turn be back and A turtle To start a by cj> at 38Rp look (4 ) the / Rr Why at the transfonned , recall that equals ? Ora figures to go , a on have to an down few page 40 Logo procedures glue arrow an of for the any center ( 5 ) is not to of Because move out to relative length moved left the pipe in convince help cj> must turn shown onto shaft and measured has now the arrow again 28 ? roller may some 8 ? and diagrams angle ( 4 ) is Why to by point / Rr : you position w left ( 4 ) . Why 28Rp back into draw the position stopping we to ( 2 ) . Turtle next : turn at (1) starting cj>, and walk procedure angle position right image points the starting Angle will linking to roller rotation position relative from next roller line Angle write draw 28 by cj>, be cal - degrees draw the . the diagrams yourself of . But all it this . Go . So let . the face of the roller 's : L . 45 Chapter2 SHAFT TO ARROW ; To ; each : L draw a tip simple is FD arrow of by . 2 * given ; PD LT 140 FD . 2 * : L BK . 2 * : L RT 280 FD . 2 * : L BK . 2 * : L LT 140 shaft length : L . The length of : L . : L BK : L PU END PIPEGONs Let 's call the procedure will that will be the arguments ? Certainly carry out this turtle walk P IPEGON . What the radius of the pipe and the radius of the roller will be needed . We will also need to know e and how many stopping points we would like to photograph . Here is the list of arguments so far : : RP, the radius of the pipe : RR, the radius of the roller : THETA, the angle distance between stopping places : N, the number of stopping places Let's add one more, : CUM, that will keep track of the total of the angle turned from the starting roller position . We can now write the first line of PIPEGON: TO 46 PIPEGON : RP : RR : THETA : CUM : N Visual Modeling How do you feel about rushing right into doing the rest ? The following is not my first " rush " or even the second . My first few attempts had bugs in them, and they didn 't work as I had planned . But procedures almost never work the first time . That 's OK as long as your energy is up to fixing them . TO PIPEGON: RP : RR : THETA : CUM : N IF :N < 1 [CNGON20 : RP STOP] PU FD : RP + : RR PD LT : CUM* : RP/ : RR ARROW : RR* 1 . 5 CNGON20 : RR RT =CUM* =RP/ =RR PU BK : RP + : RR LT :THETA PIPEGON: RP : RR : THETA ( : CUM+ : THETA) END ( : N- l ) Supporting procedures TO CNGON : N : RAD . , To draw an N - sided polygon centered on the turtle of the circle ' s . , current position . RAD is the radius that . , would pass through all of the polygon ' s vertices . . , See Chapter PU FD RT 180 NGON : 180 PU BK ( N ( : for a full description of CNGON . RAD - : LT 1 2 90 * ( * : 90 RAD ( : RAD * ( : N - * SIN 2 N - 2 ) / ) / : N ( 180 : N ) PD / : N ) PD END TO NGON ; To ; drawn ; is : N : EDGE an draw N given REPEAT N sided [ : FD polygon turtle EDGE by : - the from . ' s The current first edge position will , be and its length . EDGE RT 360 / : N ] END Some I pip typed . egon PIPEGON productions 60 30 60 0 6 . This models , in a visual way , the rolling of a 47 Chapter2 roller of radius 30 around the circumference of a 60 radius pipe . The roller stops along the circumference every 60 degrees, and 6 rollers will be drawn . The argument : CUM is given an initial value of o. What is : CUM being used for ? What happens if you begin with some other value, say 43.5? ~ One last point . In my turtle-walk scenario I drew the pipe circle before doing anything else. The procedure PIPEGONdraws it last. Why did I change the order of things ? Well, I wanted to use recursion and to be able to specify the number of times recursion would happen . I used the argument : N to take care of this . PIPEGON's first line looks at the current value of : N; when : N"becomes zero, PIPEGON should be stopped . It is easier to know when a procedure should be stopped than when it has just begun, and this seemed a nice place to draw the pipe, after all the rollers had been drawn . Could you reorganize the procedure to draw the pipe before drawing any of the rollers ? Exploring PIPEGONdynamics One of the pleasures of modeling is playing with the little model you have 48 Visual Modeling built . Let's fiddle with PIPEGON's parts to see what happens . I will show you only a few things to give you the idea. Let's start with some different argument values . Here is the portrait of PIP EGaN 60 30 2 0 180 . But I don 't like all those circles. So I removed PIPEGON's third line . Here is the new version . The asterisks ( * * * ) mark where the line was removed from the original version of the procedure . Don 't type them, though . TO A . PIPEGON : RP : RR : THETA : CUM : N ; Arrow - only pipegon new name IF :N < 1 [CNGON20 : RP STOP] PU FD : RP + : RR PD LT : CUM * : RP/ : RR ARROW: RR* 1. 5 (* * * ) < - - - RT : CUM * : RP/ : RR PU BK : RP + : RR LT : THETA A . PIPEGON : RP : RR : THETA ( : CUM+ : THETA) END ( : N- l ) line removed < - - - new name 49 Chapter2 Now this is a portrait of A . PIPEGON 60 30 2 0 180 . Instead of drawing an arrow on the roller, let 's draw a stripe along a diameter . We can use CNGONto draw a two- sided polygon with radius equal to the roller . We take out the ARROWprocedure and insert CNGON . Here it is: TO ; S . PIPEGON .s..triped : RP : RR IF :N < PO FD : RP LT : COM * : RP / : RR (* * * ) CNGON 2 1 [ CNGON + : RR PO BK LT : THETA : RP S . PIPEGON 20 : RP : N < - - - new name + STOP ] <- - <- - - : COM * : RP / : RR 50 : COM PD : RR RT END : THETA pipegon ARROW 2 - sided removed CNGON installed here : RR : RP : RR : THETA ( : COM + : THETA ) ( : N- l ) <- - - new name Visual Modeling And here is a portrait of s . PIPEGON 60 30 2 0 180 . Now, imagine an invisible arrow glued to the front of the roller . At the tip, there is a flashing light . Here is the new part to fit into our P IPEGON machine : TO FLASH : L ; Flashes a light at distance : L from the starting ; and returns the turtle to where it started . PU FD : L PD REPEAT 6 [ FD 2 BK 2 RT 60 ] PU BK : L PD END point, To install FLASH into PIPEGON, we could fix a value for : L, perhaps based on the value for : RR. Or we could extend PIPEGONby adding another argument . Call the extension TO L . PIPEGON . : RP : RR : L : THETA [ CNGON 20 : RP STOP IF :N < PU FD : RP LT : CUM * : RP / : RR FLASH 1 L . PIPEGON + : RR : L : CUM < - - - RT : CUM * : RP / : RR PU BK LT : THETA : RP L . PIPEGON + <- - - FLASH installed CNGONremoved arg . : RR : RP : RR : L : THETA ( : CUM+ : THETA) < - - - END new name and PD < - - - ( * * * ) :N ] ( :N- l ) new name and arg 51 Chapter 2 Here is the flash portrait ~ * . . ~ * "' * . ~ - ~ ~ * .. * ~ J "' " .,. - ~ * .... "' ~ * - 40 2 0 180 - 40 2 0 180 . * *' * * " ~ " . ~ * ~ .. * - 30 30 - - - .. * * . L .PIPEGON 60 L .PIPEGON 60 of : os .,. - .. * ~ . *' . . . . ~ ~ .. "" 1 ,: ' " .. .. . ~ ~ ~ :' t * ' " * ..* * ~ . . ~ .. ~ .. . ,. " ' ~* ~" tt ~ * ~ o ' \ W* *" ~ ' " " .. . *~ r .. "" "" .. . tt ~ ~ - * * " . ~ .. * ,," . ~ - " What happens if we make the radius of the roller negative ? Right . The roller is inside the pipe . Some examples are shown on the next page. Cosure Have you noticed that even the most complex designs we have done so far are drawn quite quickly ? Each is complete by the time the roller has made a single 360-degree trip around the pipe . If the roller makes a second trip around the pipe, the design repeats exactly. We can describe this kind of design as one that has " closed upon itself " or, more briefly, that has " closed" after one trip . Not all designs produced by our PIPEGON machine will close after only one trip ; some will take several trips to close, and others will require a great number of trips . Experiments will show that altering the sizes of the roller and pipe leads to different closure patterns . What determines the number of trips before closure occurs? Can you calculate the trips until closure if you know the sizes of the roller and pipe ? Could you "find " a design that never closed? 52 .. Visual Modeling A portfolio of roller -inside -pipe portraits 53 Chapter 2 On the next page is a PIPEGON design that closes only after a number of trips around the pipe . The individual images show the design at various trip stages around the pipe . Can you guess the pipe and roller sizes I used? Words elicit images Words that are visually descriptive, like closure, should call up a variety of images in your mind . This elicitation of mind -images can be enormously useful in visual modeling . In each of the following exercises, I will stress the importance of words . We must talk a lot in conjunction with sketching a lot . Take a few minutes here to think visually about the word closure. Say " closure " : what images does it bring to mind ? Tell the turtle to "hurry up and bring a design to a close." Jot down, or sketch, the image ideas elicited in your own mind by the chanting of the word . Put it all in your notebook. Suppose you needed to find a synonym for closure. What would you suggest? Any suggestion must be descriptive of all the image work we have completed . By the way, you probably won 't find closure in a standard dictionary . Why is this? Imaginary machines At the start of this chapter I mentioned that sometimes we would model machines from the real world - pipes and rollers are very real world - and other times we would model model machines that aren 't so real . Perhaps we can make one do both real and imaginary things . For example, can we make our P IPEGON machine draw some fantastic designs ? (By the way, look at that word imaginary . Why does it have image in it ? Can you imagine why ?) Let 's imagine a striped generate a composite picture roller inside a pipe . The procedure PIPEGON will of this roller as it travels around the inside of a pipe . So far, this is just like introduce 54 the fantasy the situations viewed feature . Make the radius above . But now, let 's of the roller larger than the Visual Modeling A slowly closing pipegon 55 Chapter2 radius of the pipe in which it " rolls ." Is this possible? Can it be done? I asked PIP E GON to do it, and the results are shown on the next page. What is happening ? Are these pictures of real or imaginary machines? How can you work out your answer? Can you sketch it ? Recapitula lion Let's summarize what has happened in the last few pages. We have built a Logo model that can produce a large variety of images, some of them very surprising . But more important, we have seen how the act of modeling can facilitate the visual exploration of some of the characteristics of a real-world machine . Once we began to tinker with our model, we wanted to tinker further . Some of our designs posed difficult questions whose answers were not at all obvious . Closure was such a question . We needed to do more tinkering and more experimenting to come to grips with what was going on. Could we have predicted the directions this tinkering and experimentation would take before we started? I don 't think so. Once we begin to model parts of our world, the act of modeling takes on a life of its own . I think we have touched what Levi -Strauss said happens when one plays with miniatures . Model play " gratifies the intelligence and gives rise to a sense of pleasure which can already be called aesthetic." I hope you would also describe visual modeling as fun . Why pipes and rollers ? I started with this particular have used any number direction . I will machine of alternative illustrations , but in it . I could this was my own show you, in the chapters to come, dozens of other examples that illustrate the ways in which look at the differently 56 because I was interested world . visual modeling encourages the modeler to Visual Modeling Imaginary PIPEGONs? :11,/Ill I S // / I] 57 G It noAUI Ana Aill asalSaSt lO al lO l a ' PIlOM pJJ )! a~.loa~ Jo ' I.lOM alII :S1S !JS! SAIla 'CaldoaJ ){ooq S!l{1 01 aA!1EUla1It ?lit ?a1~ !lM 01 noA ?M! 1ua I !~1JaJJa {~!M Ua~ S!SUOJ '1Ut a~ElnJ lEu ~~n lO passaldxa AnEqlaA '~no pa ~JE AI~!J! all S ' saWOJ awEJ o~ W!EIJ S, ~lnJ 02 aw ~aI '~uawnJop UE . Jo ){lOM al{~ noA o~ 2U!JnpOl ~ IEuoslad AlaA E S! ){ooq s!l {~ ~El{~ pa ~~!WpE 2U ~Eal2 SEll Ol{M ~s!20IOl {JAsd UEJ!lawy )! U! UlOq 'Ana)! a2loa ~ '2u !PI!nq Iapow ~noqE 2u ! ){U!l {~ UMO AW paJua A20IOl {JAsd PUE ' A20IO !JOS ' SJ!SAlld ' SJ!~Ewal {~Ew U! paU !El ~ SEM 5' 0 a){EW o~ Sa!l ~ uoslad l {JEa ~El{~ Ma !A S!l { wall ~JEJ UI 's~s!~ua !Js Aq pasn asol {~ o~ lEI !W!S alE ~El{~ sanb ! ul{Ja~ 2u !sn PIlOM s~s!~ua !Js SE aldoad lIE paMa !A UOpast?q alt ?SaS !JlaXa al{1 JOIIV .pU!ill U! ~U!MOIIoJ ast?~ald l {J!la\.{1 {M daa){ s~aldwa lO 1ng sula ~~Ed ~ualEdsuEl ~ l {2nollI ~ PIloM s!l { ~E S){OOIUEW" {1 Jo ~U!laplO al{1 'laAaMoH .s1uapmSAill Jo s1Sala1u ! al{1alput s1Sala1u ! PIlOM {~ l?{J!l {M JO! liMO sa!~!IEol al{~ laAO ~!J o~ s~dwa ~~E ual {~ PUE Sa !JlaXa Aill paJt?Id AllnJalt ?J aAt?l{ I .Alt?l1!qlt ? IOU S! al{~ ){ooq S!l{1 U!l {Jns SaS !JlaXa sula ~~Ed ~nOl{~!M ~aA 'po02 iClaA SAEMIE ~ou S! ~!J alI .1 'pasod ? U! sla1dt?l{J asal{1 paJnpOl1u! put ? palaplo aAt?l{ I ){EW put? sla1dEtp o~ alqEun J!J!Jads S! UEW U!l{1 ~El{~!M ~ !aua20wol { pa ~E!~UalaJJ!pUn .UE l {Jns aq o~ SlE .n1.JnJ .Is V S! ){ooq al{1 Jo aN!1qns al{1 1El{1 IIt?Ja~ .UO!l{st?J paln1Jnl1S f..1aA ,'nE ~E 2u !l {~ ou UEl{~ InJdlal { alOW S! ~!J load E uaAH '~! JO asua 01 1f.JvoJ .ddv az!s lOJ uo ZU1JJS iCl~ aldoad ~El{~ sula ~~Ed al{~ o~ SlJn.llSUOJ aWEU al{~ saA!2 Ana)! , ?ns!A 01 l{Jt?olddt ? dUO ' AlaS!Jald AlaA ' nOA MOl{S 01 uO!1ua1u - S~ JnlS!~SUOJ asall! ].AW ' S]3POUlsula ~~Ed asal{~ paIIEJ aAEl{ naM SE ~snf PlnoJ SnO!Aqo os aq II!M s!l[1 Jo ssaulnJasn al{11t?l{1 adol{ I .SJ'UEW !l[dt?lsalqEua ~ put?2u!Iapoill {~ PUE ~EllM alE Aall ]. 'PIlOM all ~ 2u !nl ~suOJ Jo SAEM alE,,- sIa pa ~ElnwloJ AI~!J!Idxa ' lO !AEl{aq JO aSlnOJ E ~lEllJ o~ ' OO~ SIEW!UE l .saldillt ?xa liMO lnOA l{~noll {1 'l{Jt?olddt ?liMO lnOA PU!J 01 pa~t?lnOJUa aq II!M ' asuas lall AI SESUE ' 89 J8ldE4~ Visual Modeling other courses of behavior or inconsistent with them, intellectually reasoned or vegetatively sensed." Each person's scientist aspect encourages him to " improve his constructs by increasing his repertory, by altering them to provide better fits, and by subsuming them with subordinate constructs or systems." For Kelly, human behavior is the application of scientific method in making sense of a particular environment . Rather than merely responding to surroundings, people use an experimental approach to test and extend their system of personal constructs . Each person 's goal, in Kelly 's view, is to build explanatory models that effectively explain and predict personal environments . Kelly suggested shortcuts for improving construct systems. Kelly 's shortcut was to encourage individuals to make their own constructs verbally explicit . His most famous method for eliciting and verbalizing personal constructs is known as the repertory grid technique . Using slightly different words, Kelly 's techniques encouraged individuals to build verbal models of their own constructs . Once built, these verbal models could be analyzed in much the same way as we have analyzed our pipe -and-roller model . Tinkering with constructs would occur naturally, and this would encourage further tinkering . And as a result of this play, construct models might become more general and more powerful . Kelly worked with verbal rather than visual models, but many of his ideas can be extended to the latter . My interest, as was Kelly 's, is to suggest how to describe our inner models . While Kelly was interested in the verbal description of models, I am interested in more graphical descriptions . My goal is to encourage you to look at your own visual baggage. Obviously, I need words, too, to help in my form of elicitation . Sometimes, you may think that I rely on words too much . Too much chat, you might say. . . If you are intrigued by this very brief account of George Kelly 's work, find his book A Theory of Personality: the psychology of personal constructs (W . W . Norton, New York, 1963). All the Kelly quotes were taken from it . 59 Chapter2 Exercises Exercise 2.1 Can you come up with some rules about P IPEGON closure ? Specifically, can you characterize a final pipegon image in terms of the dimensions of its parts ? Experiment a bit . Try to make some generalizations . Do the generalizations up after more experimenting ? Whether you feel successful in this activity find the following (Cambridge or not, book in your local library : E. H . Lockwood, A Book of Curves University Press, Cambridge, 1963). This book may help you think image ideas to think math . Look hold about closure . It may also suggest other about visually . Don 't worry too much about the book 's at the diagrams, and read the chapter chapters : cardioids, limac ;ons, astroids, right names . Listen to these strophoids, tractrices, roulettes, and glissettes . What images do these names dredge up ? Sketch them before you find the book . Exercise 2.2 How do you feel about carnivals and amusement parks ? Do you enjoy their mechanical rides ? I 'm not talking about tame rides, like the merry -go- round or carousel, but wild rides that yank the rider through space. On the next page is a sketch of a machine that gave me a dose of healthy terror . Suppose that we are watching this machine from a safe distance. A brave friend is sitting inside it and pointing a very bright flashlight at us. What pattern will this light trace out as the machine grinds into life ? The pulls and pushes on the rider of this machine change suddenly and unexpectedly . Can you make a picture of this ? Can you describe visually why this kind of machine is so scary? 60 Visual Modeling f "t..~ 5HUhf ' T , . . . . . ~- - - - - - - - - . . . - Exercise 2.;2 Design some imaginary carnival rides and give your machines imaginative names. Draw big sketchesof your ideas; draw them large enough so that others can "read" them. Describe the ride in words so that potential travelers will know what to expect, beforethey climb aboard. You had better show them some pictures of the trip as well. Why not use Logo to generatethesescenes ? Exercise 2.4 Do you know the term "kinetic sculpture " ? If not, you can guess what they are, or rather what they do? Kinetic sculptures are mechanical or electronic sculpture machines that move, clank, or flash . Some even squirt water (for example, the wonderful kinetic fountain designed by Nikki de Saint-Phalle and Jean Tinguely opposite the Pompidou Center in Paris). 61 Chapter2 Carnival rides are a special class of kinetic sculptures . They may not seem suitable for art gallery installation, but I have seen films of amusement park rides included in exhibitions . The French sculptor Jean Tinguely does kinetic sculpture on a more modest scale. Below is a reproduction of his " Homage a Marcel Duchamp," done in 1960. It is human scale, about 5 feet high . Design and build a kinetic sculpture using Logo . You might start by trying to model the Tinguely machine. PIPEGONsare a kind of kinetic sculpture, too. 62 Chapter 3 Visual Discovery "The discoverer seen before is the [ person Norwood Russell Hansen " In order to think productively the realm of physical thought in represented Rudolf ] who sees in familiar objects what no one else has ." which about objects the or properties that the nature of abstract of the of a theory situation fact or problem , one needs to be a explored , whether in medium of can be ." Arnheim The style of discovery This chapter continues the exploration of visual models and how they can stretch your mind -and-eye's vision into areas unfamiliar to you . The style of presenta tion remains the exercise form . Exercises will encourage you to experiment dynamically with the simplest of shapes. I hope to convince you, through illustrations, that playing experimentally with familiar and plain objects can lead you into a space filled with objects that are not only unfamiliar but surprisingly different from what you expected. Chapter 3 Problem -solving style This book is structured around two kinds exercises described in the text to illustrate of exercises . First, there are many what I consider to be good problem - solving style . You don 't have to do it my way, but I want you to see one person 's way . Second, the exercise section at the end of each chapter offers several open ended problems generally that demand are not illustrated originality and flamboyance . These exercises in the text ; I don 't want to influence your creativity by showing you how anybody else did them . Let 's begin this chapter, therefore, by finishing up some of the more specific exercises at the end of Chapter 1. From now on, at least one assigned problem from the previous chapter will be discussed in detail at the start As I have already mentioned, much of the learning quired by watching copying chapter of each of a craft is ac- and copying someone who is used to doing it . Constructive can lessen your programming anxiety by providing a firm support for personal exploration . (I' ve said that before, but it is worth repeating .) Centered polygons with CNGON Let's begin with a final look at Exercise1.1. This problem askedyou to refashion NGON . The new procedure, CNGON , should draw an n-sided polygon around a central point. CNGON , named for enteredNGONs , will take two arguments: first, the radius of the circle circumscribedon the polygon, and second, the number of polygonal edges. Here is the completed version with plenty of comment lines, eachintroduced by a semicolon: TO CNGON:N :RAD PU FD : RAD ; Move out to the circumference of circumscribed circle . RT 180 - (90* ( : N- 2) / :N) PD ; Turn right to face along one of the edges of the polygon . NGON:N (2* : RAD* SIN 180/ : N) ; Draw an NGONwith edge expressed in terms of the radius . 64 Visual Discovery State transparency What on earth does that mean? Notice an interesting feature of CNGON. After CNGONhas drawn a figure, the turtle is returned to its starting place. CNGONputs the turtle back to where it found it (in terms of its screen location and its heading ). We can also refer to the turtle 's position and heading as its state. Because CNGONleaves the turtle in the same state in which it found it, CNGONis said to be state transparent . NGON, by the way, is also state transparent . We will find this notion useful later in this chapter, so remember the technical term . It 's a nice visual description, as well . The distance traveled so far Recall, now, how you began your review of Logo mechanics. First, you drew boxes of fixed size. You then extended the idea of '~ ox" to include polygon shapes of any number of sides and designed a procedure, NGON , to draw them. CNGONuses the ideas of NGONbut extends them . Our next step is to extend CNGONto make it more general. Let's think about generalizing CNGONto solve two of the exercises at the end of Chapter 1. Exercise 1.3 asked you to add the notion of spin to CNGON , and Exercise 1.4 asked you to fill up CNGONwith other CNGONs. Let 's start with the latter as it is a bit simpler and has one less argument . 65 Chapter3 Generalizing CNGONto draw concentric polygons The diagrams accompanying the exercise suggested one way of filling up polygons : draw many increasingly smaller polygons, one inside another, until you have filled up the polygon with color or with texture . Theideain sketches : Co ~ ~ Dij OF A C- L C-e.,..)~ ~ Q\ JAQ ..GS c. o~ M 0...J CE.oJ " TCC2 . II~ At -L- T (1.t p. ..JG : LE. ~ Theideain words: Draw several polygons around a central point using CNGON. Allow each succeeding polygon to be a different size. If the radius of each succeeding polygon "shrinks " by 1 unit, the shape outlined by the largest polygon will gradually fill up with color . In summary, the new procedure will draw concentric polygons . The size of the first polygon will be set by one argument ; the amount of size change of succeeding polygons will be determined by another argument ; the number of sides to the polygons and the number of concentric figures will be determined by two additional arguments . Let's call this new procedure CONGON for concentric polygons . What will the first line of CONGONlook like with all the needed arguments nicely arranged? 66 Visual Discovery The idea asa Lo~o procedure: TO CONGON:N : RAD : SLICE : TIMES ; CONGON stands for ~ centric NGONs . ; : N is the number of sides . ; : RAD is the radius of the first figure . ; : SLICE is the change in radius of succeeding NGONs . ; : TIMES is the number of polygons to draw . Once design ideas are written down in sketchesand words, with all the argumentsdefinedand named, writing the Logo procedurebecomesvery easy. CONGON needsa structure to executeCNGON as many times as is specifiedby the argument : TIME S. We can use recursion for this, similar to its use in SPINGONin the last chapter. TO CONGON:N : RAD : SLICE : TIMES ; Concentric polygon exercise . IF : TIMES < 1 [ STOP] CNGON : N : RAD CONGON: N ( : RAD- : SLICE ) : SLICE ( : TIMES- l ) END Experimenting with CONGON First, fill up a square of radius equal to 80 totally with color . Second, fill up a square of radius equal to 80 with 20 concentric squares. Make each succeeding square 4 units smaller than the previously drawn one. Third, fill a square frame of radius equal to 80 and width equal to 20 with black . If you have a color Logo, you can set the pen to the color you wish . I am sticking with black and white . Here are the three commands ; the results are shown on the next page : CONGON4 80 1 80 CONGON4 80 4 20 CONGON4 80 1 20 67 Chapter 3 TO SPIN . ; Concentric ; Note IF ; SPIN : new : N : RAD : polygon < : N : and 1 [ SLICE : exercise name TIMES CNGON RT CONGON new STOP TIMES : ANGLE . argument : ANGLE . ] RAD : ANGLE Single new . CONGON command : N . ( : RAD - : SLICE ) : SLICE ( : TIMES- l ) :ANGLE END Is this procedure state transparent ? Well, no . The turtle always returns to the center of the figure, and that was where it started from, but there is no guarantee that the turtle will end facing in its original direction . The turtle turns a total amount, to the right, from its starting heading of : TIMES * : ANGLE degrees. To make this procedure state transparent, we need to turn the turtle back to the left by this amount after all the polygons have been drawn . Can we insert such a command in SPIN . CONGON above? The problem is that the : TIMES argument is decreased by 1 each time recursion is used in the procedure 's last line . This is the stopping mechanism . When SPIN . CONGONis finished, the value of : TIMES is zero. We could embed SPIN . CONGONin another new procedure, which we call SPIN . Why is SPIN able to use the original value of : TIMES SP IN . CONGON isn 't? Note : there are other ways of handling when this state transparency problem . This is my way ; I like it because it can be understood easily. It 's also very tidy because it doesn't demand any more arguments or the introduction of local variables- which we haven't discussed yet . TO SPIN :N : RAD : SLICE : TIMES :ANGLE ; State - transparent SPIN. CONGON runner . SPIN. CONGON:N : RAD : SLICE : TIMES :ANGLE LT :TIMES* :ANGLE END SP IN does only two things . It runs SPIN . CONGONand then returns the turtle 's heading to its original state. 70 Visual Discovery SPIN productions The first figure was run with SPIN 6 100 4 25 5 and the second with only the sign of the last argument value made negative . This changes the spin orienta tion . Squarish SPIN images The left figure was produced with SPIN 4 100 4 25 5; how can we make it more complex ? The right figure suggests a new kind of complexity that we haven't yet seen. It is a composite image that includes the left figure with its mirror image placed on top of it . 71 Chapter 3 More squares SPIN 4 120 2 60 5 A winter holiday SPIN 4 120 1 120 5 wreath Visual experiments It might be interesting to set up a more controlled experiment with SPIN . For example, let 's build a structure to see how SPIN -produced designs vary as we alter the arguments . We can simplify 72 the experiment by changing only one Visual Discovery variable I have decided to look first at the effect of an altered at a time : ANGLE argument . I thought it would be nice to seea number of SPIN . CONGONS on the screen at the same time, so that I can compare the effect of the single changed argument . By looking at the size of my screen, and deciding that my individual figures would be about 50, I decided where (the cartesian x-y addresses) on the screen I would put them. Here is my visual simulation machine. TO EXPLORE : N : SLICE : TIMES : Al : A2 : A3 : A4 :A5 the screen . To , explore five different figures on at once . . , Only the angle variable PO SETXY ( 0 PO SETXY ( 70 PO SETXY ( 70 - PO SETXY ( - 70 PO SETXY ( - 70 60 will be changed . 0 ) PD SPIN : N 50 : SLICE 60 ) PD SPIN : N 50 : SLICE 60 ) PD SPIN : N 50 : SLICE - 60 ) PD SPIN : N 50 : SLICE ) PD SPIN : N 50 : SLICE : TIMES :Al : TIMES :A2 : TIMES :A3 : "rIMES :A4 : TIMES :A5 END I don 't much like using the cartesian system to move the turtle around the screen, but this seemed an easy and quick way to start experimenting turtle -reference moving Four experiments . I 'll do la ter . with EXPLORE 73 U) Chapter ...... ~ Visual Discovery Some surprising images with EXPLORE The figures on the last two pages looked isolated to me, so I decided to make them overlap by increasing the values used for the : TIMES argument . Having increased this value, I went back to my initial rule : keep all the arguments constant but one, the : ANGLE argument . Suddenly I had designs that were surprisingly intriguing . I think one reason for this surprise is that we can no longer predict the results of our experiment before we carry it out . And in addition, it is not at all obvious why the experiment proceeds the way it does. For example, note the strange central figure in the following group . Note, too, how it grows larger from the first to the third figure . The shape of that beast is very responsive to small changes in : ANGLEvalues. And the beast exists only within a narrow range of values. Our experimental machine has shown us something visually odd growing inside these designs. It has also indicated that this form of oddness is extremely sensitive to small changes in our experimental parameter . This is a sort of visual sensitivity analysis. The argument values used are placed above each experimental result . EXPLORE 4 4 40 4 4 444 75 Chapter3 EXPLORE4 4 40 4 . 5 4 . 5 4 . 5 4. 5 4 . 5 EXPLORE4 4 40 5 5 555 76 Visual Discovery EXPLORE44 EXPLORE 4066666 4 4 40 10 10 10 10 10 77 Chapter3 EXPLORE 4 4 35 15 15 15 15 15 Tiling spinning shapes The overlapping of the previous images suggested another kind of experiment : could the spinning shapes be placed on the screen so that they would not overlap too much but would still touch and influence each other ? A student of mine considered this as a problem in tiling . Here 's what she decided to do : 1. First, she used SPIN to produce many large single designs . 2. She printed these out on her printer . 3. She made dozens of photocopies . 4. She cut out the designs and placed them on a large piece of stiff paper . She could then move the design cutouts around the paper, rotating and fitting them together to form larger, composite designs. This is similar to fitting decorated tiles together in various ways to create different patterns . Here is the surprising result of one such cutout exploration . Four SPIN . CONGONS have been fitted together, like tiles, to form a larger design. 78 Visual Discovery Logo -laid tiles You probably detected that the above composite design could be done with a Logo procedure far more easily than with scissors and glue . I designed the following procedure to tile four square designs together . Any idea what that argument called : ALT is for ? : ALT is short for alternating . If it is set to 1, all four of the tiles will spin to the right ; that is, there will be no alternation of spin direction . However, if : ALT is set to -1, the odd tiles will spin to the left while the even tiles will spin to the right . Notice the use here of the MAKE command to alternate the sign of the turning angle. If you have forgotten the MAKEcommand, review it now in your Logo manual . TO LAY . SQ. TILES : RAD : SLICE : TIMES : ANGLE : ALT REPEAT 4 [ PU FD : RAD PD SPIN 4 : RAD : SLICE : TIMES : ANGLE PU BK : RAD RT 90 MAKE "ANGLE : ANGLE * :ALT] END 79 Chapter3 The next illustration alternation shows two square tile designs with different spin schemes . The first is always to the right, the second alternates . --~ .. ~ k' ~ff Here are two partially overlapping square tile designs . Note the appearance of more serpents. Laying other tile shapes Why not tile triangular shapes? The only quirk here is the necessity to turn the turtle 180 degrees to face the center of the composite design before drawing a SPIN . CONGON . Why is this turn necessary? 80 Visual Discovery TO LAY REPEAT . TR . TILES 6 : RAD [ PO FD : RAD : SLICE PD : TIMES : ANGLE turtle to : ALT - LT 180 ; Orientation SPIN RT of 3 180 : RAD : SLICE : TIMES face center . : ANGLE - ; Reorientation of turtle . PU BK : RAD RT 60 MAKE " ANGLE : ANGLE * : ALT ] END Hexagonal tiling patterns Why not? The procedure is straightforward . Note that the angle turned between tiles is now 120 degrees. 81 Chapter3 TO LAY . HEX . TILES REPEAT 3 PU BK RT 120 MAKE END : RAD : SLICE [ PU FD : RAD PD SPIN 6 : RAD : SLICE : RAD : TIMES : ANGLE : ALT : TIMES :ANGLE - " ANGLE : ANGLE * : ALT ] Something curious occurs now . Note that three of the four designs below look as if they are interlaced . Are they? What is happening ? ~ ~ (j~. ", .~ .~ .. u#f~ .... " ",~ "" \~~ ~, ,\,,-,, ' " .. , I : I' ' \ \,\' .," ",i;5j1 ;I . "S ~ -"lilii;'~'" : ' I I ,, . : ~, lil \. 1 .,"! I1 , I., .. t J" t ~ !I, x,"'-\ ' I'(II ;! .! ,~~~~~ ' . .~ ' " . .,' . Iff! I ~~ "~~~::~~~~~ ~~ ~ ~':-.., ~ - ':' ',," ", "/ " " '/ . .~ ~ ~.,"'-;~~ ~ \i /.;I/1 .; "~~ \ ' .Ii'(ilii '~~~ \' ' .J !';t.t If !'ttilij bi,,"I \" : 07 ',:" ~, "'::: ~ ~:l' I .,,:,ltl '1 .1"\;1 ' " ~ "i. ;;111 :~! I.Ii' " . tt, " "" : :1 ..'11 VfIll "! ~"'~,~ 11 ',,", \ ",-,\, ~~~V '[""""l '' .." ...,....." ~ ~ ~ ~\~~ -~ff ~ "~\~:,,,"~ .f!J " . . ., N, . ~.~' " ' " . ~;~ p - 82 IJ!I'1~, , . " " ." ' II .' Il}t , \ I ' ...,::,~~ ~./ . Visual Discovery Still only polygons We have come a long way from the original BOX procedure of Chapter 1 to the surprising designs shown above. But do not forget that all the images we have created so far are still only polygons . Polygons, yes; but we have gone out of our way to play and experiment with these simple shapes, not just to complicate them but in the hope that we might see something new through them . Have you found the images of this chapter sufficiently strange to justify that hope? Extending the range of exploratory models Before going on, I would like to describe another exploratory model . In the following case, a model is used to investigate some of the visual characteristics of a painting . So far, we have only looked at our own work . The results of the next exploration show that models can be effective visual thinking tools for analyzing somebody else's images . Specifically, this model will be inves tigating the qualities of balance in a design composition . A Delaunay machine Here is a reproduction of a 1938 painting, entitled " Disque," by the French artist Robert Delaunay . I recently discovered this work in a Paris museum . Although the thing is enormous, about 5 by 6 meters, I had never seen it before. Why, I wondered, did I like it so much? I decided to think about this by building a model to " simulate " the picture . Obviously, I did not hope - or want - to reproduce the painting . I can always go and see the real painting whenever I want . Perhaps, I thought, I could fashion a model to explore some of the characteristics of a painting that I especially liked . And that might help me to see better what attracted my eye in the first place . 83 Chapter3 I would be exploring two things with my model : the world I was looking at in the Delaunay painting and the world of how I felt about it . I was sure that the latter would predominate . Why ? Because I am convinced that models tell more about their builders than about what is being modeled . Painting elements I decided against using too many design elements. The ones I selected were a bit arbitrary, but they were based on my impressions of the design elements used by Delaunay . Notice that none of my elements is an exact replica of anything in the painting . I built a different Logo procedure to draw each of these elements and to place them onto an imaginary canvas grid . Each element and its procedure is shown below . 84 Visual Discovery These procedures are simple and easy to read, but I want to add a few comments. I decided not to vary every possible dimension in my experiments. The double rings, for example, have a fixed size. However, while the form and size of the other design components are also fixed, each can be placed at different locations of the canvas. These design element locations are defined by two arguments : first, an : ANGLE argument sets the element 's angular position, measured clockwise from the straight -up position ; and second, a : DIST argument defines the elements distance from the center. Each procedure is state transparent . Why might this be useful when we begin to use these procedures to paint canvases? TO DOUBLE . RINGS CONGON 40 120 5 5 CONGON 40 80 2 5 END 85 Chapter3 TO WIDE. SPLINES :DIST :ANGLE RT :ANGLE REPEAT15 [FD : DIST BK :DIST RT 3] LT :ANGLE+ 45 END TO NARROW . SPLINES RT : ANGLE REPEAT 7 [ FD : DIST LT : ANGLE + 21 END I 86 : DIST BK : ANGLE : DIST RT 3] o tIj ~ Z G) to! . . -.J 0 I -' H .. -3 G) tUG ) 0 to! tIj Z 1-3 ~ . . C/ ) 01 -3 H C/ ) . . C/ ) I -3I -' WtUtIj 0001 to! 1-3 I -' I -' hj 00 to! ~ ~ . 1-3 O ~ ~ HOOtIj ~ G) zzz oo 1-3 ~ O -3 1-3 .. ~ .. ~ ZZ t:i:' G) G) tIj ZtUOO 00001 zz O tIj ~ Z G) to! . . I-' 0 tIj . 1-3 H .. C/ ) -3 Z tUG ) 0 to! tIj 1-3 ~ .. 01 H C/ ) .. -3 G) to! ~ ~ G) ~ 1-3 ~ O -3 0 .. Z C/ ) I -3NtUtIj 001 to! 1-3 I - ' hj 00 O ~ HOtIj .. ~ Z t:i:' G) tIj ZtUO 0001 Visual Discovery 87 Chapter3 TO FOUR. TARGET : DIST : ANGLE RT :ANGLEPU FD : DIST PD LOCAL " R MAKE" R 25 REPEAT4 [CONGON 40 : R 2 MAKE" R :R PU BK : DIST LT :ANGLE END 5] 1 ~~r:;;:;~~ o ~.,~ /(,r '~, ) ~ ) 1 ' ~~~~ ~~~~ i~~' TO FIVE . TARGET : DIST :ANGLE PO RT LOCAL : ANGLE PU " R REPEAT PO BK END 5 : DIST 88 FD MAKE : DIST " R 5 0 [ CONGON 40 LT : ANGLE : R 1 5 MAKE " R : R - 1 0 ] Visual Discovery Delaunay experiments Six illustrations of Delaunay experiments follow . Turn at the in different orientations . How do you designs orientation of the page effect a specific more pleasurable opinion ? What to look makes the book 'around feel design ? Do you find about and look them ? Does some of the designs at than others ? Is there an outstanding design, in your it so ? 89 Chapter3 Balance My feelings after this experiment ? Did I discover why I liked the painting so much ? Yes. I was convinced (or rather, I convinced myself ) that the aspect of the Delaunay painting that caught my attention was its balance. I watched myself as I tried to place my design elements on the screen. I kept thinking to myself : try to balance the composition . This was difficult because the weight of each of my elements was hard to calculate until after I tried a new configuration . I discovered, however, through experimentation, that the eye has its own rules for judging the balance of designs. To evaluate balance, we seem to divide pictures into two equal parts . This division is horizontal, not vertical ; a left and -right partitioning, not an up -and -down one. We look into each half, visually add up the weight of the elements seen there, and compare these weights with a similar calculation made within the second half . Usually, we find a balanced scene to be more pleasant than an unbalanced one. In fact, extreme visual imbalance can make me feel very uneasy. Howdoes theeyecalculate theweight ofadesign element ? Here are some rules . The relative 90 size of shapes is important : bigger forms may be judged Visual Discovery heavier than smaller ones. But relative color value is also important . For example, white against black, because it attracts our attention, has more weight than gray against black, which attracts less attention . Thus a small black object might be heavier than a large gray one, if both were on a white background . Variety of shape is also important in weight calculations . A more complex shape, because it attracts the eye, may be judged heavier than a boring shape. For example, a small asterisk may have more weight than a larger circle . Relative position is important, too. For example, a small shape in an extreme position can sometimes balance heavy shapes that are more centrally located. When all the elements of a scene seem to radiate from a central point, a kind of balance known as radial balance occurs. Because the eye seems to be concerned with horizontal rather than vertical balance, rotating a picture can destroy its balance. Why ? Or, on the other hand, a rotation can fix an unbalanced picture . Now go back and look at the Delaunay painting . I see a calming image made from disparate elements, finely balanced into a single design. Turn it on its side and what happens? Now go back and look at the Delaunay simulations . Do they halance? How would you change each of them to make them more balanced? Try some balancing exercisesyourself with a design machine of your own invention . Polygons placed on the vertices of other polygons There is one remaining exercise to discuss from Chapter 1. Exercise 1.5 asked you to design a Logo procedure that will draw polygons centered on the vertices of other polygons . You need to have a good feeling for what this problem is really about before you rush off and try to solve it . As always, small drawings can help by making problems easier to visualize and to manipulate . Even the simple sketches below should make the problem clearer. You will see the pattern required . Start by drawing one polygon . Now draw a series, or a 91 Chapter3 layer , of the vertices could polygons of change the from those could , from Recursion The the original of , from one of drawn . The the previous layer the same just remain polygons though vertices polygons as well similar the the polygons polygons triangles in anyone layer to to size squares design the next polygon sizes . Now of the draw polygons polygons in - getting larger or . We could change the . But let ' s work to . We pentagons can let their on one smaller layer - or all of the shape relative only sizes with change , . again hint given CNGON TO on , might CNGON PU FD RT 180 in Exercise be helpful : N 1 . 5 suggests . Let ' s look that again recursion at , placed CNGON inside the body of . : RAD : RAD - NGON :N ( 90 * ( : N - 2 ) / : N ) ( 2 * : RAD * SIN LT 180 - PU BK : RAD We want to polygons . Let ' s find the ' s arrival at polygon around 180 PD . / :N ) ( 90 * ( : N - 2 ) / : N ) PD END turtle centered draw centered the the vertex arrival place : once a vertex take CNGON could be place a vertex The asked a vertex , CNGON current position , and 92 the polygon , so inside 's current reached draw could can another the asked forth . How can will find the the is spot where polygon vertex to find the arrival it ; once draw other draw to another . recursion drawing around again we to a vertex of corresponds command on the vertices that position polygon be the procedure insert CNGON in ) around CNGON turtle is we the we inside so ( CNGONS . Then point to reaches draws polygons should procedure CNGON this polygon a polygon new around vertex arrival point points inside NGON the ? NGON . , Visual Discovery 93 Chapter3 TO NGON:N : EDGE REPEAT :N [ FD :EDGE (* * * ) RT 360/ :N ] END The ( * * * ) symbol indicates the place in the procedure NGON where the turtle arrives at a polygonal vertex . How can we find this location inside CNGON when it uses NGON? Look closely at the following . How does this version of CNGONdiffer from what we have been using ? Not at all . NGONhas been opened up so that we can see its parts. All of NGONis now placed inside of the body of CNGON ; there are no longer two separate procedures . The vertex arrival point is still marked with ( * * * ) . TO CNGON:N :RAD PU FD : RAD RT 180 - (90* ( :N- 2) / :N) PD REPEAT :N [ FD (2* : RAD* SIN 180/ :N) RT 360/ :N ] LT 180 - (90* ( :N- 2) / : N) PU BK : RAD PD END Vertex arrival (* * * ) point Now try saying in words what you would like to insert at the ( * * * ) above and what arguments the insertion requires . Here is an sample of such " wordy " thinking : " OK, turtle : whenever you find yourself at the vertex arrival point (the place between drawing an edge and turning in preparation for drawing the next edge), draw another polygon . As you are drawing that next polygon, stop after each edge and plan to do another polygon . But don 't do this forever . To stop yourself, you will need a new argument ; call it : LEV, for recursion level . "You also will need to know if each succeeding layer of polygons is to get bigger or smaller in terms of of the preceding layer . So, define another argument ; call it : FAC for growth factor . This will define for you whether to shrink or enlarge polygons from one layer to the next. "Give the new procedure a new name, RECGON , for illursing 94 polygQnS. Visual Discovery " One last idea. Maybe you should think about rotating the polygons at a vertex in relation to the previous polygon . Call this argument : ROT. Look at my sketches below ." /' <::) v(:~~,.. Ae.e' vAl. PO "' T . / 1" 'T' ~L j),E o~ T" aT'-E AT c....,o.J V€Q.TE" AI2~I~ L f'o..JT . ~ Ro-rAT.O.J " oJ6l.~ . "\ ~ / DI2ECTlo ..I OF-n. a.TL~ ,' " Pfl-E1'AC1 .ATlo..I FolZ . D~" wlo.lr,. ~ t ",G -o..> Aeo.J..J[) T"IE: VE : ~T~" p",. . rr . . . . =, iy ~ .......) ~.f... ~ -..,: ,;, Two ' . . " " ." .' .' ..,.,.." . . . . PO~o;.' e.,- e eOTAT .', ~ '..""" . " ~ . ' . 00 : ' - v60 ' ) s . "..."> .:.."'.0 .,.., G 2oT" = 4S. , " . . ~ ) . . ,~ " $ a. " 1" E " " . . " . . . , ~oT = 00 95 Chapter3 The assembled RECGON Now we need to convert CNGONinto RECGONbased on these words and sketches. Here it is TO RECGON ; Recursing IF : LEV ; , with plenty : N of comments : RAD : FAC : ROT polygons < Stops 1 FD : RAD RT 180 - REPEAT : N on [ STOP the PU recursion ( at ( 90 * : N - 2 ) [ FD ( 2 * : RAD LT : ROT - ; / - PU BK : RAD Note that , values ( 90 polygons ) * . 180 inserted : ROT ; Reorients ; Is / the - drawing : RAD : FAC next : ROT : LEV recursion : RAD turtle 2 ) figure - 1 . - apparatus argument is . scaled by : FAC . - state 360 : N before the is how . PD SIN * Here : N - level : FAC Note ( proper turtle ; * of : N ; RT 180 : N Orients RT : LEV vertices ] RECGON LT . by removing transparency / : N ) / rotation an issue angle here . ? ] : N ) PD END used of the five figures RECGON has must drawn be . Only five arguments supplied : RAD to and it . . : LEV These change Therefore , values control their each values time the from RECGON is characteristics one level of recursion to another. Can you see how these two arguments control the scaling of the RECGONdesign as well as its complexity (that is, level of recursion ) ? Recursion is a tricky business, but it is also very elegant. Many art students have told me that they find recursion aesthetically pleasing ; they like its "shape," somehow . 96 Visual Discovery Understanding recursion experimentally Recursion is the most elusive concept in this book . I believe it is also one of the most powerful because it provides you with an entirely new metaphor for visual thinking . Working and thinking about recursion will encourage you to look -think at your world differently . In a strange way, recursive thinking gives you the power to make the world look different . You may not understand recursion at all in the beginning, until you have experimented, over and over again, with recursive procedures written by others. If you can understand one recursive procedure well, you are on your way to using recursion on your own terms. Toward the goal of understanding a recursive procedure, you must design your own experimental apparatus to test it out . Let's playa bit with RECGON . Watch how RECGONdirects the screen turtle from one part of the design to another ; the turtle is walking through recursion space. Try to get an intuitive feeling for how recursion " does it ." At the end of this series of design experiments, we will talk more about the mechanical nature of RECGONand introduce you to a kind of visual model of recursion . For the moment, though, just play about with RECGON . For example, ask RECGONto place squares at the vertices of other squares down to four levels of recursion . Four levels means that there will be squares on squares on squares on squares. The value that we will type for the argument : LEV will be 4. Now, what about scaling the design? If we make : FAC equal to .5, the squares will get smaller as recursion progresses. Finally, what about the rotation angle, : ROT? Let's try 45 degrees to start . To make this rotation idea less cryptic, we will experiment with different values to see what happens . One last item : set the beginning : RADto 50 units . 97 Chapter 3 Square RECGONs RECGON4 50 . 5 45 4 RECGON4 50 . 5 0 4 Triangle RECGONs RECGON3 50 . 5 30 4 RECGON3 50 . 5 0 4 Less obvious RECGONs Before going on to experimenting with funny values for arguments, to see what RECGONdoes, let me pose a question . Can you calculate the number of figures that RECGON must draw for any kind of polygon 98 and any level of recursion ? If you Visual Discovery could calculate the number of figures that must be drawn, you could guess how long anyone design might take to draw . Let's try to attack this for a specific case. Later, you can generalize the approach . Think about square RECGONs . A level 1 RECGON would draw only one square, but a level 2 RECGON would draw an additional four squares on the vertices of the first : that makes five squares for level 2. Now, at level 3, we must put four squares on each of the squares drawn at level 2 . That means another 4 times 4 . In total, level 3 includes 16 + 4 + 1 = 21. Can you work out the general formula for number of figures in terms of n, the kind of polygon, and L, the level of recursion? Here are two more RECGONs. The second design was drawn using the reversing pen color . Can you verify that the second design was formed from 341 squares? (1 + 4 + 4 *4 + 4 *4 *4 + 4 *4 *4 *4 = 341 .) RECGON4 50 (l / SQRT2) 0 4 RECGON 4 10 ( SQRT 2) 0 5 <,,/ / " /,,/ ,,,/ /,,> A " / ,, / / " " / " / ,, / / " ,, / / " V <,,/ / ",,/ /,,/ /,,> Recursion diagrams: visual models of recursion We will be talking a lot more about recursion in the following chapters. But let us end this exploratory work with RECGONby presenting a visual model of how recursion works . 99 Chapter 3 Before visual you read rather than a " happening " on " happening " inside recursion than students are technical my technical It a little itself , so let 's that Logo makes first . This copy copy asks The to third a is be copy If third more copies of third copy where it written Suppose sheet calls below it recursion the 100 a copy is are mixed first a original procedure turtle goes in search of the recursion ". d copy does not turtle is reading The turtle is a are the indicated 45 path paper and liberal if arts you hanker defined to be run again , imagine locates this copy below its instructions next located in the instructions turtle the again deeper climbs up copy , the of the the second . . no second terms . If under goes . The on instructions back to the 3 . the for turtle the the values that takes 5 arguments the whatever and no from the looking turtle fof climbs the top place up to top sheet . Suddenly sheet down to arguments sketches the the diagram one at this the of from each procedure it . If on identical sheet the there that Notice which from from diagram 50 recursion be further itself from the , carries recursion of drops climbs 4 sheets instructions read course call graphical can and on is . the , of of made continues instructions turtle search are and reads turtle , copy turtle to itself procedure copy begins and created call in as . asks is The and procedure copy as . dinner a what intuitive . But is describe that art students third not for procedure . When found true to I with an science a What encouraging scientist how copies itself with have , a original secol always I turtle the the almost follows coincide , in . What . necessarily However goes license recursion the does the visual useful computer the again not visualize of . If indicate values This following second RECGON arrows . my of . more these Here type far the , the . The often copy of . computer where the Think your to left does where is the instructions diagrams to run you description , take the show technical difficult try to results truth is , I need ones , though after off the models sense on procedure top where along with of level two another . on the the sheet . top just without it had left after we it . operation shows to currently ends sheet path level is is things ; and . First , second , , Visual Discovery Recursion diagram of RECGON 4 50 . 5 45 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - : LEV (4 50 .5 45 4 ) TORECGON :N :RAD :FAC:ROT IF :LEV< 1 [STOP ] POFD:RAD RT180- (90*(:N-2)/ :N) PD LT:ROT F~O~ REPEAT :N [(RECGON FD.(2*:RAD 180 / :N ) - :ROT ~ ~S AI :N *SIN :FAC *:RAD :FAC :LEV -1 - l mM RT:ROT RT360 / :N ] LT180- (90*(:N-2)/ :N) POBK:RAD PD END 'itS -------------------------------------------------------TORECGON :N :RAD :FAC:ROT :LEV(4 25 .5 45 2) IF :LEV< 1 [STOP ] POFD:RAD RT180- (90*(:N-2)/ :N) PD LT:ROT FaVf '? REPEAT :N [( FD (2*:RAD 180 / :N ) - :ROT ~?tP RECGON :N *SIN :FAC *:RAD :FAC :LEV -1 - l II( 'O "\'ES RT:ROT RT360 / :N ] LT180- (90*(:N-2)/ :N) POBK:RAD PD END -------------------------------------------------------TORECGON :N :RAD :FAC:ROT :LEV(4 12.5 .5 45 1) IF :LEV< 1 [STOP ] POFD:RAD RT180- (90*(:N-2)/ :N) PD LT:ROT ~v~ REPEAT :N [CRECGON FD(2*:RAD 180 / :N ) - :ROT lR~ :N *SIN :FAC *:RAD :FAC :LEV -1 ~~ET { RT:ROT RT360 / :N LT180- (90*(:N-2)/ :N) POBK.:RAD PD END ------------------------------------------------ --0 RECGON :N :RAD :FAC:ROT :LEV(4 6.25 .5 45 0) IF :LEV< 1 [STOP ] 101 Chapter 3 Visual thinking Do I need to summarize what we have been doing ? I don 't think so. Theillus- trations show it : a kind of visual thinking about objects and shapes . Exercises Exercise 3.1 Look back over the composite designs that were made from the SPIN . CONGONS in this chapter . Design a Logo procedure that will produce composite designs from a number of different design elements. The following series of designs was done by a student . She labeled the collection " Hurricanes ." They should give you some ideas. But don 't limit yourself to figures based on the square. 102 Visual Discovery 103 Chapter3 104 Visual Discovery 105 Chapter 3 Here is another student "solution " to this exercise. He has constructed a map of France with alternatively spinning hexagons. 106 Visual Discovery Exercise 3.2 Design a procedure that combines the ideas of SPIN . CONGONs with the ideas of RECGONS . Exercise 3.3 Look back at the Delaunay machine . Invent a queasy machine that produces the most unbalanced designs imaginable . Try to characterize in words what your designs are doing and what you were doing . Exercise 3.4 Build an exploratory a reproduction to your local to carry museum artists . Don 't limit work, even Inspiration doing of a painting of the painting best . Go out different model photographs may strike any Logo until lot of time looking After you acteristics you from have finished tried this of a painting without changed your ? you . Postcard a collection quite of are the ; include by realistic work as you pictures . Don 't start up over your desk . Spend a different is pinned images of reproductions painters a variety sure you have can . . to simulate painting two collection characteristics toward buy as large at those postcards have with you . Make to geometric comparing your painting around and yourself . Select that interests exercise , describe . Remember copying that clearly you what char - can simulate the image . Have your the feelings Exercise 3.5 Study the following several pages of figures . Bring out your visual thinking gear; can you decompose these composites into their components? 107 Chapter3 Stone mason marks ,. 5. b. 3. 108 Visual Discovery More stone mason marks / --- --... 10 . ..._~J_=~/ 13. "--- ------""" II. 109 Chapter3 These symbols, called stone mason marks, are copies of the marks builders of Gothic cathedrals left as signatures on their work . The mark actually put on the stone is that indicated by the dark lines . These lines are selected segments from an underlying matrix of lighter lines . The design of an individual stone mason's mark was, therefore, a two -stage operation : first, design the underlying line matrix ; and second, make an aesthetic selection of line segments from this matrix to express an individual 's or guild 's signature . The exercise here is to create the line matrices similar to the examples drawn . Select one of the examples that strikes your fancy . Look hard at it . Think in terms of polygons and the placement of polygons . Make some free-hand sketches in your notebook on how you would draw the matrix, component by component . Next, try to design a Logo procedure that parallels your own drawing . Take the very first design, for example. It is composed of a circle in which are placed squares of different sizes and orientations . Finally, several straight lines are drawn to connect the vertices of the squares to the center of the design. You can do far more than just reproduce the designs offered here. Generalize your MASON.MARKprocedures so that you can produce a suite of designs based on the theme suggested by anyone example . Take the first design again, for an example . Your procedure could have one argument for the overall size of the figure, while another might define the kinds of polygons placed inside the circle. The first design has squares inside the circle, while the second design has triangles . Perhaps your generalized procedure could draw both designs. Finally, you might want to design some kind of experimental apparatus that will display several of your designs on the screen at the same time, each with a slightly different degree of oddness. If you find all of these designs too boring, design your own . For a historical description of these symbols and a full geometric analysis see Matila Ghyka 's The Geometryof Art and Life (Dover, New York, 1977). 110 Visual Discovery Exercise 3.6 Design a personal mark in the manner of, but not limited to, the approach used by the Gothic stone masons. This mark should be a visual model of several aspects of your personality . This exercise will require a combination of introspection and Logo designing . You may find that your Logo designs actually help the looking within yourself . Start this exercise by doodling in your notebook before you write any procedures . Without thinking too much about what you are doing, write down a list of your own personality quirks . Do this as fast as possible. Now go back over your list and make small sketches of whatever images come into your mind . Try to make a sketch for each word . But if one word doesn't cause an image to pop into your mind quickly, leave it and go on to the next. Finally, combine some of your best sketches into a single design theme and design a Logo procedure to explore it . Don 't intellectualize what you are doing . Do everything as quickly as possible. Think about what you have done only when you have generated some personality images. You may find that you will produce many personal marks that you aren't happy with . That 's OK . Put them all in your notebook and write a short note on what you were trying to accomplish with each. This is important : keep a trace of what you are thinking and doing . Finally, select one or two individual marks . These images are to be included in your published biography . This is the only authorized biography of your life and you may wish to write a few words of description . Don 't worry about being too personal in your description : the book 's production run will be very, very small . And since few people will read your comments, you can be totally candid . The next page shows an example of a mark designed by one of my students. He found a basic theme that he presents in various configurations . Following the images is his description of what he was trying to say with the mark . 111 Chapter 3 112 Visual Discovery Thestudent 's 12ersonal markex12lained in words~ "I liked the idea of using circles in my personal mark. I wanted to show that I have many interestsand that no one single interest is most impor.tant to me. I try to be a well-rounded person (sorry about that). I get a lot of personalsatisfaction from seeing how a number of different disciplines interact with each other. Math and art are two examplesof my interests. "I wanted the circlesnot to overlap in the design- I found that Gothic stone masonmarks get too busy when too many lines overlap; I try to get my life pretty organized, so I wanted to show the circlesin my head all touching- but in a nice neat way. I like being clever with math, so I was pleasedto be able to work out the math in this design. I wanted the balls to get bigger and to fit nicely together. They do look a bit like ball bearings, I'm afraid. Maybe I come across to peopleas a bit of a machine. I don't know. "I like the top mark becausethe turtle overlappedon the screenturning two of the circlesinto little moon shapes. Thesemoons have rather soft outlines, and they would never work asball bearings. The moonsgaveme the idea of softening up the entire mark- making it more organicand lessgeometric. I figured out how to have my printer make the first two designs look squashed; I liked the comparisonwith the nonsquashedthird design. The bottom mark is done with CONGON . It looks like Greekjewelry that is made from thosewasher-like things. "These three marks illustrate how I try to apply my mathematicalmind to soft, organic (human) problems. And Greek jewelry? I think it is an exampleof math-inspired designsthat servehumanistic ends." 113 Chapter 3 The following is not an example of a personal mark ! Why ? Because a physical likeness of the author is not the same as a model of the author 's personality . 114 c hapter 4 c ircuIar Grids " Language is an expression of thought George " By of human reason and not merely a medium for the free to . . . ." Boole relieving concentrate Alfred instrument the on North more brain of advanced all unnecessary problems work , a good notation sets it . . . ." Whitehead Modeling for communication and thought Like algebra, geometry, or any other language, the language of modeling is both a medium for communication and a notation system that helps structure thought . You can crystallize an idea about a shape or complex of shapes into Logo procedures. Logo gives you a language both to name the shape and to define how to go about drawing the shape. Once the shape is named in a procedure, that name can be used as a shorthand for the method of constructing and exploring the visual implications of the shape's definition . In the preceding chapters you have seen that our visual intuitive sense is limited in many cases. That explains why some of the images are so surprising . Most people 's visual vocabulary is fairly rudimentary, even when it comes to something as commonplace as polygons . Visual exploration with models can Chapter 4 help increase your visual vocabulary by forcing it to describe unexpected shapes. Have you felt visually stretched ? Unpacking and repacking shape packages The goal of this chapter is to encourage you to take complicated designs apart in order to find their basic elements, the building blocks. Once unpacked, a complex design can be explored by modeling each of the component parts in turn . And once the small -part models are completed and named, you are free to concentrate on how to put the parts back together again, that is, how to repack the package with which we started . Along the way, you may be able to find several alternative ways to repack the pieces. Do you remember the first time you took a small machine apart ? I remember happily attacking a large, mechanical alarm clock . The pleasure came from solving two puzzles : to separate the pieces and then to put them back together again. And because I had seen through those puzzles, and had arranged all the small parts carefully on a carpet, I knew that the reassembled clock was not the same as the original . Circular grids Having explored polygons extensively, are you beginning to see the world packed with them ? Were you able to spot and recreate in procedure forms the polygons hidden inside the stone mason marks of Exercise 3.5? I want to use this mason mark exercise as an example of how to go about the unpacking repacking images . The mason marks are good ex- of complicated, composite amples, too, of a special kind of composite shape organization elements are all arranged circular 116 grids . around and . The component a central point . I call this class of designs Circular Grids Analyzing mason marks Let's go through the exercise of analyzing the mason mark designs to illustrate the usefulness of Logo shape and placement notation . The following discussion is not the only description of what one can see in stone mason marks ; don 't be alarmed if the work you did yourself doesn't correspond exactly to the following illustrations . There is no single " correct" answer . But there is a proper style of approach . The following examples are designed to show you that style . Go back and look carefully at all the stone mason marks at the end of the last chapter . Think about the following questions: 1. What shapes are used? 2. What shapes are not used? 3. Wha t shapes are used together? 4. What shapes are not used together ? 5. Are individual marks symmetric ? If yes, can you see the point of symmetry ? Are some marks partially symmetric ? (Be sure that you have a definition of symmetry at your fingertips . Are there different kinds of symmetries ?) 6. Within any individual mark, is anyone shape repeated over and over again in a way that might suggest recursion? 7. What are the characteristics that make all the marks alike ? 8. What are the characteristics that make each mark unique ? 9. What already written Logo procedures could be used to produce parts of the marks ? 10. What new Logo procedures need to be designed? Now look back over the marks and quickly jot down your answers to these questions . Don 't mull over the words ; write them down as they come to you . 117 Chapter 4 Written observations You probably noticed that 1. All the designs are composed from a few basic shapes: circles, squares, and triangles . You can produce all of these easily with CNGON. 2. All the marks reveal a common characteristic: the orientation of the polygons around a center. Each mark has a design symmetry "around " the center of this theme circle. Each mark uses a limited combination of polygons . For example, squares and circles occur together in the same mark, but triangles and squares do not. Excepting the circle, no polygon beyond the 4-gon level is used. There are, for example, no pentagons or octagons. For polygons centered on the circle's center, CNGON can be used. 3. Two polygons of the same size and shape are often overlapped to form stars . For example, one triangle in Mark 2 is rotated 60 degrees from another, to form a six -pointed star, while one square, in Mark 1, is rotated 45 degrees from another to form an eight -pointed star . This is easy: use a combination 4 . There are require and special second example two 5 . There the boxes fact 118 that special the circles new procedures two at least mentioned 7 has twice polygon grid placements of within placement of at vertices polygons vertices here at already Mark the of has , the of forms marks of . First placement the are kinds attention , , need of two the the of CNGONsand RTs. smallest squares in of triangle the marks Marks 7 other in that and 10 ; polygons Mark : for 13 . You will , and each . recursion one that of them appear in operating might be structured as many boxes : with as the Mark group of first , a recursive 10 the is grid marks placement procedure " very suggestive of - the " of Circular Grids recursion ; and second, notice the occurrence of polygons nesting inside circles nesting inside polygons . This nesting is called " inscribed " polygons . That is, a polygon is inscribed, or drawn, to fit within another shape. You will see this nested-shapes recursion in many of the marks : note the two smaller squares nested inside the larger squares in Mark 1; also note the same kind of nesting in the triangles of Mark 2. New procedures will be required here. 6. Straight lines are sometimes polygons - the diagonal used to join the vertices of some of the basic cross inside a square - or the polygons overlap of the basic shapes - the lines joining the intersection formed by the points of the two triangles . New procedures here, too . You will need new procedures for the last three points : 1. Placement of polygons at the vertices of other polygons . 2. Two kinds of recursion: nested/ inscribed polygons and grids . 3. Some special line drawers to connect certain polygon vertices. Recursive design features Let's start with the recursion while your energy is high . Until recursion becomes second nature to you, you will need a lot of concentration to understand how it does what it does. But believe me, recursion will soon become as natural to you as using any other form of shape description . Look at the following four designs. Then look back at Mark 1 and 2. Seehow natural some of these shape descriptors are becoming ? Do you see the kind of recursive procedure that is needed, just by looking at these pictures ? Put your ideas into words, though, just to be on the safe side. Remember to record your thoughts and doodles in your notebook. 119 Chapter4 3. J. If. :2;. Inscribed polygons We need a procedure that will first draw a circle of a given size, and then draw an NGONinside this circle. The NGONis said to be an inscribed polygon if it just fits inside a circle , and this will be the case when the NGON has the same radius as the circle. Next, the procedure needs to know if it should go to another level of inscription : should it draw a circle inside the NGONjust drawn and inscribe another polygon inside this circle ? Let 's use : LEV to be the argument that indicates the number of nested polygons -inside -circles that is required . The procedure will have the following form : 120 Circular Grids TO INGON : N ; INGON stands ; : N ; : RAD ; Set ; If ; : LEV is : C ? ; To IF : C ; Do if you no circles you level decremented the circles to be drawn recursion , as 30 the a Do polygon , and be drawn drawn ? . . . usual : RAD . ] circumscribing circle : RAD : N ; inscribed ] [ CNGON Inscribe ; . the will of [ STOP want : N of want recursion 1 NGON sides . 1 1 = INGON of , the stop ? CNGON ; 1 < nscribed radius = * is : LEV : LEV ~ number its : C ? : C ? for the is IF : RAD polygon ( ? ? ? INGON inside ) : C ? again with : LEV the ( : LEV the - circle 1 . ) correctly calculated : RAD and . END The only radius drawn calculation . problem value of The following the is next , what should smaller little go inscribed diagram in the place polygon should be of in useful the terms as ( ? of you ? the think ? ) . This is the polygon just through this . e : l (3~o/ ~) :; 18olvv J1 . (..ose :. ~ C .oSl \C ()o/",,) =-~ Notice that a polygon has been drawn inside a circle of radius R. What is the radius of the circle inscribed inside this polygon ? To answer this question, we must find an expression for r in terms of R. Then we can handle the ( ??? ) term in the INGONprocedure . Do you see that the angle e (theta) equals one-half of 360/ n, where n is the number of sides of the polygon ? Using the definition of the cosine, we have cos e = r / R. By putting these two expressions together and rearranging terms, we find the needed expression: 121 Chapter4 r = R* cos 180 / n ultirn2lte line becomes : WecannowfinishupINGON . Thepen INGON :N (:RAD *COS 180/:N) : C? ( : LEV- l ) The underlined expression has replaced the (???) . OK ? Let's try it out . INGON 4 100 1 2 Gives design 1 on page 120 . CG INGON 4 100 1 2 RT 45 INGON 4 100 a 2 Gives design 2 on page 120 . . , CG INGON 3 100 1 2 ; Gives design 3 on page 120 . CG INGON 3 100 1 2 INGON 3 100 a 2 ; Gives design RT 4 on 60 page 120 . Grid -of -squares turtle walk Now for the grid of squares that appears in Marks 3, 6, 7, 10, and 16. Let's go through a turtle -walk exercise similar to that introduced to solve the CNGON problem at the end of Chapter 1. Imagine that you are at the center of a circle of radius : RAD and that you want to fill How would you go about doing it? 122 up an inscribed square with other squares . Circular Grids ~AD + ~AD/2 1. Starting at point 1, draw a CNGON 4 : RAD. The radius of this square equals the radius of the circle in which you are sitting . 2. Next, consider dividing this square into four smaller squares. You could draw these four squares by first going forward, after picking up your pen, by : RAD/ 2, putting down your pen at position (2) and running a CNGON4 : RAD/ 2. Then, get yourself back to point (1) with your pen up . Turn right 90 degrees and get over to position (3). Run another CNGON 4 : RAD/ 2 and get back to the center point (1). Do the same for (4) and (5) 3. Ready for the recursion twist ? Suppose you want to divide the square centered on position (2) into four smaller squares . On arriving at point (2), you would want to draw four squares around this spot . You must go forward by an amount equal to half the distance : RAD/ 2, do a CNGON 4 You would ( : RAD/ 2 ) / 2, and then get back to (2). then turn 90 deg! ees in preparation ( : RAD/ 2 ) / 2. The remaining for the second square of radius two squares would follow in similar fashion . 123 Chapter 4 4. But wait . Suppose when you were in position to draw the CNGON 4 with the radius ( : RAD/ 2 ) / 2, you considered yourself to be in the center of a square that should be divided again into 4 smaller squares. This is recursion . And here is the Logo version of the words above : TO SQUARES : SIZE : LEV ; Grid maker of squares in groups of four . IF : LEV < 1 [ CNGON 4 : SIZE STOP] ; Draw a square if you wish to recurse no deeper . REPEAT 4 [PU FD : SIZE / 2 PD ; Get to center of a square . SQUARES ( ; Consider ; squares PU Get ; preparation ; squares SIZE / 2 ) current ( : LEV - l position ) - as center of 4 . BK ; : : SIZE back / to 2 PO RT center and for moving 90 ] turn to 90 the degrees next in center of . END Another recursion diagram STEP SQUARES100 2 Watch the turtle read each instruction and then carry it out . The STEP command slows the action of the turtle so that you can watch both the screen and the procedure . Use the following diagram to follow how the different levels of recursion are linked . This recursion diagram is similar to the one you saw when you worked on RECGON. Remember ? If you have trouble comparing on the screen with this recursion diagram, turn your printer what you see on to print out what Logo is doing . Compare this printout, line by line, with the recursion diagram . 124 Circular Grids SQUARESrecursion diagram The following recursion diagram describes what " happens " after you type SQUARES 100 2. The level of recursion here is 2. Don 't forget to type STEP. TO SQUARES : SIZE : LEV (100 2) IF : LEV < 1 [CNGON 4 : SIZE STOP] REPEAT4 [PU FO : SIZE/ 2 PO ( SQUARES ( : SIZE/ 2) ( : LEV- 1) - - PU BK : SIZE/ 2 PO] ") ENO'"J)a'f./E~"f= - - - TO SQUARES : SIZE :LEV (50 1) IF : LEV < 1 [CNGON 4 : SIZE STOP] REPEAT4 [PU FO : SIZE/ 2 PO SQUARES ( : SIZE/ 2) ( : LEV- 1) PU BK : SIZE/ 2 PO] TO SQUARES : SIZE : LEV (25 0) IF : LEV < 1 [ CNGON 4 : SIZE STOP] REPEAT4 [PU FO : SIZE/ 2 PO SQUARES ( : SIZE/ 2) ( : LEV- 1) PU BK : SIZE/ 2 PO] ENO Exploring recursing; squares Now, design an EXPLORE-type procedure to investigate how SQUARESoperates at different: levels of recursion . The following is such a procedure . TO SQ . EXPLORE ; To explore ; different PU SETXY SQUARES PU SETXY SQUARES PU SETXY SQUARES : SIZE : Ll the recursion 70 60 60 : SIZE - 70 : L4 level and at size values . : Ll - : SIZE : L3 procedure PD : SIZE 70 : L2 SQUARES PD : L2 - 60 PD : L3 PU SETXY- 70 60 PD SQUARES: SIZE : L4 END 125 Chapter 4 RT 45 SQ. EXPLORE 80 0 1 2 3 produces the following diagram : More complicated grids Suppose you would complicated like the SQUARES procedure to do something to the squares it gets around to drawing at the lowest recursion level . An example might be to put a cross in each box . The following draws such a cross, but how should it be incorporated more procedure into SQUARES? TO CROSS : SIZE REPEAT4 [FD : SIZE BK : SIZE RT 90 END We will want the cross made just after a square is drawn, so that they both use the same size value . That means that CROSS is placed just after CNGON 4 : SIZE in SQUARES. The following revised SQUARES procedure, called SQUARES. x, incorporates CROSS. Changes from or additions to the SQUARES procedure are underlined . You might guess that any number of alternative pro cedures could replace CROSS . A circle drawer (CNGON30 : SIZE ), for example. 126 Circular Grids TO SOUARES IF .X : LEV < REPEAT : SIZE 1 4 : LEV [ CNGON [ PU FO : SIZE / 2 .X ( : SIZE SQUARES PU BK CROSS :SIZESTOP] 4 : SIZE - PO ( : LEV- l ) 90] / 2) : SIZE / 2 PO RT END The diagrams exhibit on some of reconstruct them Placement of RECGON maybe we really need place shape placement . , . , . , ; PU can break a put . other any this It 's for doing kind of marks ' s getting as is fancy grid well . recursion You words thing , the tips of and orient . should . now any be then notation Here of it is let 's other than a and the but simpler location use of something place to use at into current to kind polygon will easier it this down that turtle than mason of They able to polygons job procedure the examples assemble a polygon . RECGON . CNGON at defined return the turtle talk about Logo to some But All we to a its new : TIPGON :N : RAD : DIST : ROT To place an n- sided polygon of radius : RAD, at a distance : DIST from the current turtle location . : ROT is ~ ation angle of the polygon is relation to the FD CNGON PU will from starting stone procedure that are . on one page of yourself is distance next flavor polygons was procedure TO the the LT turtle ' s original : DIST RT : ROT PD : N : RAD : ROT BK : DIST PD heading . END TIPGON is a building block procedure that fits nicely into others . On the page after next are a few examples of how TIPGON can be so used . You should be able to reconstruct all of these quite easily. By inspection ? 127 Chapter4 Mason mark designs from squares / / - - - -- ~ ,..-----....,.. " " ......._ ~ - - - --...../ 128 Circular Grids Some TIPGON-generated figures 129 Chapter 4 Special line procedures Let 's overlap two similar NGONs to form a regular trigonometry needed to find the rotation star with 2*:N points . The between the t\.A1ONGONs is easy : the angle between points of the composite star will be 360 divided by the number of points or 360 / (2*:N ). So the star operation is : CNGON: N : RAD RT 360/ (2* : N) CNGON: N : RAD An example . Make a six -pointed star from two triangles of radius 100: CNGON3 100 RT 360 / (2* 3 ) CNGON3 100 The star produced is top left one on the next page. The bottom left figure is the star with the intersection points of the two triangles connected. The top right figure shows the star again, but now with the star points opposite each other joined . The bottom right star combines the connections of the top right and bottom left ones. The exercise for you is to think about the trigonometry needed for this exercise and then to design a procedure that will draw these two kinds of lines for any star drawn from a composite of two similar polygons . Try out your own ideas before going any farther . Here is my solution ; I 've called the procedure STRIPES: 130 CircularGrids 3. Y. 2. TO STRIPES ; : ; If ; points ; If IF : N is N : RAD number : Ll ? : L2 ? : of = 1 ? = 1 = 1 Ll ? ngon draw : ' L2 s ? sides lines and : joining the joining opposite RAD is radius NGON . intersection . : Ll draw [ lines RT 90 / : * COS REPEAT ( : : RAD N [ CNGON 180 SETH 1 [ 0 : N [ : N 180 CNGON RT 0 points . ) - / / ( COS : N : N 90 ] / : N ) - - ] REPEAT SETH 2 / RT IF :L2? = star N 2 180 / : RAD ] - - ] END You might want to verify that STRIPES works in a number of situations . Here are two examples from me. The bottom left star was generated by : 131 Chapter 4 CNGON3 100 RT 360/ (2* 3) CNGON3 100 STRIPES 3 100 1 0 The top right star came from this : CNGON3 100 RT 360 / (2* 3 ) CNGON3 100 STRIPES 3 100 0 1 The bottom right star combines the top right and bottom left stars. That 's all . You should now be able to generate most of the stone mason marks given at the end of Chapter 3 using the procedures that have been discussed in this chapter. Want to try a few ? TO MARK . 13 : SIZE INGON 3 : SIZE 1 2 RT 180 (INGON 3 : SIZE 0 2) LT 180 REPEAT6 [TIPGON 30 ( : SIZE/ 2) ( : SIZE/ 2) 0 RT 60] STRIPES 3 : SIZE 1 1 END 132 Circular' Grids Here 's another . Notice that this mark uses both the grid recursion and the inscribed polygon recursion patterns: TO MARK . 16 : SIZE CNGON30 : SIZE REPEAT2 [ SQUARES: SIZE 2 RT 45] STRIPES 4 : SIZE 0 1 REPEAT2 [ INGON4 : SIZE 0 2 RT 45] END Generalized Gothic stone mason mark procedures The procedures we have just looked at, MARK. 13 and MARK. 16, are not very general . They can each produce only one design . Their only generality is an ability to produce fixed designs of different sizes. That isn't very interesting . What about designing a more general mark procedure that would include an additional argument for controlling the shapeof the design produced ? Exercise 4.6 will ask you to design a generalized mason mark procedure with at least 3 arguments . Here is a preview of such a generalizing approach . The following procedure was designed to draw either Mark 1 or Mark 2. I also wanted to see a mason mark figure based on pentagons and hexagons. I therefore added a second argument, : N, that would control the shapes selected to construct the mark . This new procedure thus has an argument that determines the overall shape as well as one for setting the size of the mason mark . 133 Chapter 4 It is often interesting to see what " happens" to designs produced by a Logo procedure as the procedure 's arguments are given more and more extreme values. Sometimes designs produced with such extreme value arguments are very boring . But other times one finds designs that are totally unexpected and very exciting . Here is a start at my generalized mason mark : TO G.MARK :N : SIZE CNGON30 : SIZE INGON :N : SIZE 0 2 RT 360/ (2* : N) INGON : N : SIZE 0 2 LT 360/ (2* : N) STRIPES :N : SIZE 1 END 1 And here is an EXPLORE-type procedure that will show you how G. MARKproduced design change with changing : N values: TO ; M . EXPLORE To PU SETXY G . MARK PU SETXY G . MARK PU SETXY G . MARK PU SETXY G . MARK : SIZE explore 70 : Nl : Nl the 60 : N2 : N3 G . MARK procedure PD : SIZE 70 : N2 - 60 - 70 : N3 - 60 PD : SIZE - 70 : N4 PD : SIZE 60 PD : SIZE END The following diagram is produced with M. EXPLORE50 3 456 134 . : N4 at different : N values . Circular Grids Comment : the extreme values, : N = 6, for example, aren't very interesting . The figure becomes confused and muddied with too many lines . Here is the reason why all of the stone mason designs in the illustrations given at the end of Chapter 3 limited their ngons to a max of n = 4, squares. Circles seem to be a special case. The G. MARKbased on the hexagon above does suggest some work in the following direction . Spider webs, maybe? 135 Chapter 4 The quality of polygon lines Here is a simple pentagon produced by the CNGONprocedure . Look at the five edges of this polygon . They are straight lines and they connect the vertices of the pentagon together . 11 Must we use a straight line ? Suppose we want the vertices to be connected with a line whose quality qualities is different from that of a straight line . Different line could mean wavy, jagged, or dotted lines . Or maybe we might decide that we want the vertices of a polygon to be joined shape . Why not remove the FD edge command together with a special from CNGON and replace it with some other procedure that draws a new shape between the vertices . Once whatever shape the new procedure draws between one vertex and the next is completed, the turtle must be placed at the second vertex facing the same direction it faced at the first . The new procedure must operate exactly like FORWARDin terms of the turtle 's starting and ending state . In other words, the turtle must be left in the same heading state in which it was found, and the distance between the two vertices must remain equal to : EDGE. If this were not true, we could not replace the FD : EDGE command with our new procedure . Why ? In fact, we can replace FD : EDGEwith any procedure as long as it follows FORWARD 's starting and ending conditions . Are you happy with this? 136 Circular Grids Can you state the conditions necessary for us to replace one part of a procedure with an alternative part ? How must the parts relate ? How is this business like the notion of state transparency ? Stars Let's consider drawing stars. Look at the sketch below . A star is a polygon with a different quality of edge. Instead of a straight -line edge, the star has an edge with a " kink " in it . If we could write a procedure to draw " kinked " edges that follow the beginning and ending state conditions of FD, we could exchange the FD : EDGE in CNGONwith the kinked line procedure . This exchange will create a new gon-drawing machine called STARGON . If we are careful, STARGONwill be a more general form of CNGON becauseit will draw stars as well as polygons . ~ 0 ~ 0 "\: 't : ~ P&' ~ 137 Chapter 4 Let's call the new procedure that will draw the kinked line STAREDGE. Before we do a turtle -walk description of the staredge, let's decide how we will characterize its major feature, kinkiness, in terms of an argument called : KINK . Suppose we say that if : KINK = 0, there will be no kinkiness to the staredge and so the star drawn will look exactly like a polygon . That 's fine : a star with no kinkiness is a polygon . On the other hand, if : KINK = 1, then the kink in the staredge will extend down to the center of the figure . The shape of this star will look like the spines of an umbrella . A : KINK of .5 should produce something midway between a polygon and an umbrella frame. Turtle walk through the staredge 1. The turtle begins at position (1). It is facing the next vertex at position (7). 2. The first thing that STAREDGEmust do is to turn right by the angle labeled : TANGLE (for lop ~ngk ) at (2). Don 't worry about the calculations yet; we can work those out later . 3. Now, go forward by the amount labeled : SLOPE . (3) 4. N ow, turn left by the anglelabeled : BANGLE(for Qottom@g1g) at (4). 5. Go forward by the : SLOPE . (5) 6. Turn right : TANGLE . (6) 7. The turtle is now in position (7). STAREDGE hasmoved the turtle from vertex 1 to 7, and the turtle heading at 7 is the sameas it was at 1. This correspondsto what FORWARD accomplished , so we canexchangethe two procedures. 138 CircularGrids Staredge calculations Here are the calculations that will be needed . I 've written a supporting procedure called SQ that squares its argument ; your own version of Logo may already have this command . SQRTis my Logo's command for square root . I am pleased that this project will encourage you to review a little more geometry and trig . You will need to remember the arctangent and its associated ARCTANcommand ; we use this to calculate the angle : TANGLE. Also, you might n ~ n I.:.:. ~ :::r . 0 :=' cn recall the Pythagorean theorem : in a right triangle, the square of the length of the hypotenuse equals the sum of the squared lengths of the other two sides. We ..tIjc../) .. .. .. I-3:I: tx :J :ZOZ l;.rt-t :l;.r1-31 :J ):J G ) t"CJG ) G tx t-ttx :Jt-t tx :J tx :J II II II II II use that to find the : SLOPE. TO SQ : A ; To square OP : A* : A END a number . 2* : RAD* SIN 180/ :N :KINK* : RAD* COS 180/ :N ARCTAN: HT : EDGE /2 SQRT (SQ ( : EDGE / 2) + SQ : HT) 2* : TANGLE Putting STARGON together Where shall we carry out these calculations ? We could place them inside the new procedure STAREDGE. But this wouldn 't be very efficient since the math needs to be done only once, not every time a STAREDGEis drawn . So let 's place the calculations at the start of the procedure STARGON. Here are the two new procedures. 139 Chapter 4 TO STAREDGE: TANGLE: SLOPE RT :TANGLE FD : SLOPE LT 2* : TANGLE FD : SLOPE RT : TANGLE END TO STARGON : N : RAD : NOTCH ; Centered star exercise . (LOCAL " EDGE " HT " TANGLE " SLOPE) MAKE " EDGE 2* : RAD* SIN 180 / : N MAKE " HT : NOTCH* : RAD* COS 180 / : N MAKE " TANGLE ARCTAN : HT : EDGE/ 2 MAKE " SLOPE SQRT (SQ ( : EDGE/ 2 ) + SQ : HT ) ; These MAKE commands calculate the values that ; will use below . PU FD : RAD PD RT 180 - (90* ( : N- 2 ) / : N) REPEAT : N [ (STAREDGE : TANGLE : SLOPE ) RT 360/ :N] LT 180 - ( 90* ( : N- 2 ) / : N) PU BK : RAD PD END STAREDGE Global and local variables Notice that I have made the staredge variables all local variables . We don 't need the value of these staredge calculations outside of STARGON. Do you remember the difference between local and global variables ? Global variables have an existence outside as well as inside the body of the procedure that created them . These variables never go away, in fact, until they are erased. The command NAMES lists all global variables currently in your workspace and EDNAMEallows you to edit a specific variable . Check your Logo language manual to verify these commands in your own Logo dialect. Local variables, on the other hand, exist only inside the procedure that defines them . A local variable is, however, available to any procedure that is used within the body of the procedure that defined the variable .l 1. Most traditional Logos, including the dialect used in this book, apply this approach, but some recent implementations such as Coral Object Logo favor an 140 Circular Grids Logo isn't very good at " number crunching ." Because Logo is so slow with mathematical calculations, structure your procedures to calculate as few times as possible. Group the " dirty " math work in one place using MAKE commands, so Logo can go on to what it does most quickly : moving the turtle about the screen. If possible, LOCALize all the MAKE-created variables . A look at STARGONswith different My recommended : KINK values way to explore a new procedure is to design an EXPLORE-like procedure . Each of the following diagrams shows a set of five stargons . The value of the : KINK factor is noted on each individual Note that the stars produced stargon . with a kink value greater than 1 are pulled " inside -out ." Why is this ? Look carefully . Perhaps you would like to use the STEP command to slow the turtle down as it draws one of these inside - out things . alternative approach in which local variables are available only to the procedure that created them and not to any others. Your Logo manual should describe the method it uses to define the range or " scope" of local variables . If it applies the second approach, you will need to make some (relatively simple ) modifications to the procedures given in this book . 141 Chapter 4 142 CircularGrids STARGON -produced designs Below are produced designs , but several designs that explore shapes . I won ' t give you it has much in common the the with : KINK argument effect on actual procedure used CONGON of 3 . Re ~ ember Chapter to STARGON create - these ? 143 Chapter 4 Fractalgons Put off for a moment asking what a fractal might be. Instead, consider yet another way of altering the quality of the polygon edges drawn by CNGON .. Recall how we built STARGONfrom CNGONin order to draw kinked lines between polygon vertices . Here is a turtle -walk description of another line shape that can replace FORWARDin CNGON : take the distance between vertices and call it : DIS T. Now have the turtle go forward by one-third of : DIS T and turn left 60 degrees. Then go forward another one- third of : DIS T and turn right 120 degrees. Now go forward another : DIST / 3, turn left 60 degrees, and finish up with FD : DIST / 3. Here is the shape of this new kind of line : - - _/ ! \ \ _---And here is a triangle with ordinary straight sides: What if you now replaced the straight line sides with the new shape? And after you have done this, what if you could replace all the straight line elements within the new shape with a smaller version of the new shape? And then, what if you could replace the remaining straight line segments with smaller versions of the shape . . . What is this? Recursion, again. 144 Circular Grids 145 Chapter 4 FRACTALGONS: a new recursion Look closely at the following machine two procedures . You should have a feeling for what is going on as soon as you scan the lines . But what will that argument do ? Notice, too, that the kind of recursion used in FRACTAL is not exactly the same as that used in RECGON . There are four FRACT AL where FRACTAL recursion diagram " calls " itself for yourself : DIR places within the procedure (makes use of recursion ) . Make a and use STEP to verify that your recursion diagram arrows are correct . Can you now give a definition, based on FRACTALGON, of a fractal design ? Of a fractal ? Try . What is the quality of the edge line in a fractal design ? TO FRACTALGON : N : RAD : LEV : DIR ; If : DIR = 1 turn outward . ; If : DIR = - 1 turn inward . LOCAL " EDGE MAKE " EDGE 2* : RAD* SIN 180/ :N PU FD : RAD PD RT 180 - 90* ( : N- 2 ) / : N REPEAT :N [FRACTAL:EDGE : LEV : DIR RT 360 / : N ] LT 180 - 90* ( : N- 2 ) / : N PU BK : RAD PD END TO FRACTAL IF FRACTAL LT 120 FRACTAL LT 146 : DEPTH : DIR 1 [ FD : DIST ( : DIST / 3 ) ( : DEPTH STOP - l ) ] :DIR / 3 ) ( : DEPTH - l ) : DIR / 3 ) ( : DEPTH - l ) : DIR / 3 ) ( : DEPTH - l ) : DIR ( : DIST * : DIR ( : DIST 60 * : DIR FRACTAL END < 60 * : DIR FRACTAL RT : DIST : DEPTH ( : DIST CircularGrids SomecuriousFRACTALGONS 147 Chapter 4 Observations Have you noticed that most of the designs in the first three chapters have been " circular " ? These circular patterns reveal a symmetry based on a central point, and that 's why I've called them circular grids . There is one final example of circular grids in the chapter . It is another example of how a complicated figure can be unpacked into its components and then restructured . This example shows how a generalized model of the basic component can lead to a wide variety of recomposed images based on the theme of the original . While all the images share the same original characteristics, they are surprisingly different in feeling . Nephroids "Nephroid " means kidney -shaped. It is a nice example of a complex circular grid . Look carefully at the following diagram . Can you decompose the design into its polygonal components as you did with the stone mason marks? Could you draw a nephroid on a drawing board with a straight edge and compass? Most important, could you do a turtle -walk scenario? That walk might begin to form in your mind as soon as you start scanning the design with your eyes . . . 148 Circular Grids Nephroid walk scenario Here is a little sketch that might help . Imagine a circle whose center is labeled (1) . Begin to walk along the circumference Stop at equal intervals of this circle starting along the circumference at point (2) . (3, 4, 5, ...) and draw a circle - one at each stopping place - whose center is your current position . The radius of each circle will diameter be such that its circumference of the big circle that you are walking will just touch line AB, the on . How can you calculate the radius of each of the circles that you must draw ? A tEroJTErz . Av(", ~ ()~ u ' TTL :!E: CI~c.LE: = : ~ D *" <;,.J 9 Look at the right -hand diagram above. The thing that must be calculated is labeled " radius of the circle to be drawn ." You know the : RADof the big circle, and you could probably figure out the angle 8. If you know these two things, then trigonometry will again supply you with help . The radius you need is simply : RAD* SIN e. The same simple relationships are useful over and over again. We can use TIPGON to move out from the center (1) to a position on the circumference, draw the circle, and then move back to (1). You can then turn the turtle at (1) an appropriate amount in preparation for using TIPGON again. 149 Chapter 4 What about that angle e? You need that in order to calculate the radius of each of the circles that TIPGON places out there on the circumference of the big circle. You can use the command HEADING. HEADINGgives you the turtle 's current angular orientation as measured in degrees from the straight -up position . Straight -up is 0 degrees; pointing toward 3 o'clock is 90 degrees; straight -down is 180 degrees; and pointing toward 9 o'clock is 270 degrees. The line AB indicates the straight -up position . SOHEADING will give you the angle you need to calculate the radius for each circle that must be drawn . What about tilting the design with respect to the line AB ? Let : TILT represents the degrees of clockwise tilt . Here it is: TO NEPHROID ; : CIRC ; how ; : TILT ; horizontal RT : TILT REPEAT is many is : CIRC : INC : TILT t-hp r ~rl ; ' ] ~ of the times the clockwise turtle rotation big stops of circle along figure . : INC specifies the circumference from the . . : INC LT :TILT END [TIPGON 30 ( : CIRC* SIN (HEADING RT 360/ : INC] : TILT : CIRC 0 On the next page are a few nephroids . Because the screen resolution is limited, these nephroids look as if they had been knitted rather than drawn . Generalized nephroids Let's consider producing a series of nephroid designs based on a more generalized model of the component part . Instead of circles, let 's use STARGONs. With STARGONswe can still generate circle-based nephroids, but we can also explore nephroids built up from stars . And what will that look like ? 150 Circular Grids 151 Chapter4 First, let 's extend TIPGON to manipulate STARGONS instead of CNGONs . Call the extension TIP . STARGON . TO TIP . STARGON:N : RAD : KINK : DIST : ROT ; To place an n- sided stargon of radius : RAD and ; kink :KINK, at a distance : DIST from the current ; turtle location . :ROT is ~ ation angle of the ; in relation to the turtle ' s original heading . PU FD : DIST RT :ROT PD STARGON:N :RAD : KINK PU LT : ROT BK : DIST PD END Now, we can insert TIP . STARGONinto an extended NEPHROID, called STAR.NEPHROID . TO STAR. NEPHROID: CIRC . , . , . , : CIRC is the : N , kink ; from . RT of the turtle many times how is number : KINK . the : INC radius of sides : N the of ; TILT is horizontal : KINK : TILT big circle stops alonq component . : INC specifies the circumference stargons clockwise . with rotation of figure . : TILT REPEAT : INC [ TIP . STARGON :N ( : CIRC : KINK RT LT :TILT END - * SIN : CIRC : TILT ( HEADING 0 - 360 / : INC ] Unpacking and repacking image packages The images of this chapter ones patterns into simpler chapter better than more challenging 152 words areas . , illustrate the and images . Now these it ' s your power chance of decomposing recapitulate to extend the these complex ideas notions of the into Circular Grids STAR . NEPHROIDs - 153 Chapter 4 More STAR . NEPHROIDS Some curious symmetric images the . The close PIPEGONs 154 things left seem half and others of Chapter to be happening is not the same do not ? 2 . If you . as have the Some of these right half . Why forgotten the term images is are it closure that not some , look at Circular Grids Exercises There are ten exercises this time . The first seven involve more work with circular grids, while the last three branch into the worlds of rectangular and random grids . There are fewer hints included because you should have the basic skills now to be your own designer . Try to create designs that are as different from the ones in this chapter as possible. Exercise 4.1 The nephroid on page 148 is composed of many individual circles. (Can you count the actual number of component circles from the design itself ?) The method for locating and drawing each of these component circles was described on the last few pages of this chapter. Many other complex designs can be built up entirely from circles (or other polygons ). The cardioid (heart shape) is another example of such a composite design . It is illustrated on the next page. Can you suggest how the cardioid is generated ? Note that both the nephroid and the cardioid seem to be threedimensional, at least at first glance. Examination, however, will show that the " depth cues" are ambiguous and not totally consistent with " real " world perspective . This kind of ambiguity, though, can add interest to an otherwise straightforward, geometric design. 155 Chapter 4 Cardioids 156 CircularGrids Now look spheres whose on here ? Are the nephroid Dream nephroids at the fronts following are the 3 -D and cardioid up some , cardioids three transparent methods but used designs elegant , and designs these to . These whose draw seem backs these are globes to illustrate opaque similar concentric . What is going to used those in ? Logo procedures transparent to spheres create designs inspired by . 157 Chapter 4 Exercise 4 .2 I once asked you to design a personal mark . Now we move from the individual to the cosmos. In Hinduism and Buddhism diagrams called mandalas are used to illustrate the structure of the universe and the place of the observer within it . They are also used in meditation and visualization exercises. Two examples are shown below . I would like you to generate a series of mandalas, each based on aspects of your own personalcosmology. Be ready to " explain " your diagrams . 158 CircularGrids Exercise 4.3 While we the are thinking standard begins glyphs at ( 6 ) ( 1 ) Virgo and , ( 12 ) Simplify . each identity . meanings and Libra Pisces the twelve runs , Can ( 8 ) you may the cP , ( 9 ) to so t b can ' V ; following zodiac , drawn by me ( 4 ) Cancer , (3 ) Gemini , ( 10 ) , Capricorn the it of ( 11 a would to them . , form astrology te into . The , ) your series (5 ) circular Leo , , grid its the are Aquarius lose read Here ? visual traditional designs . 4 ( YY ) 1 \ 7 5 9 on incorpora ~ 6 I the into 3 rrQ 5 at @ 2 cfJ look which book n 1 them beyond a you the Taurus of point borrow tha a Sagittarius each the take of ( 2 ) redesign want , through to signs cosmos signs Scorpio symbol You of the for Aries ( 7 ) about ; : ~ 8 : : : ~ * 10 11 12 Exercise 4.4 Playing cards You might hearts , these images deck . who lent offer be and may should you set intrigued spades ( You another the of to redesign . Or maybe the not be be astrology able designs the face as challenging to borrow book that of for deck Exercise be standard cards a for can card King you of structured Tarot 4 .3 . ) , as suits : Queen as the cards Listen diamonds , Jack face , cards from to circular these the , and Joker of same wonderful the grids . clubs , . But tarot person face 159 Chapter 4 card names Chariot : , Strength Temperance The Fool your The you Priestess Hermit , , Tower design a as , , Wheel Star of , Empress , Fortune Moon , Sun , , Emperor , Justice Last , Hierophant , Hanged Judgment , Man World , , and Lovers , Death , finally , clock . sim circular grid pIe as icon possible for one or more of these cards ? Keep each . .5 standard to High . 4 numbers want Devil designs Exercise , , , Can of Magician face Remember change is to the whole a keep circular grid track system of of seconds reckoning . Redesign , it minutes time with , . . symbols and hours rather . But than you may . Exercise 4.6 Design a generalized Gothic stone mason mark that has three arguments . One of these arguments should control the size of the design and the other two should control the shape. Don 't limit yourself to the examples already shown ; produce a series of designs that could be used for late-twentieth -century cathedral building . Exercise 4.7 We didn 't spend much time on fractals in this chapter . Go back and look at the FRACTALGONs. Can you dream up some fractals of your own ? We will look at fractals again in the exercise section of Chapter 7. 160 Circular Grids Exercise 4.8 Design a Logo procedure that will put a shape into a rectangular grid . You should be able to define the number of rows and columns that the procedure will use and the distances between them . You might want to be able to change the shape that goes into this grid as well . Make sure your rectangular placed at different grid can be starting places on the screen . Remember : the secret to success is always to go through the sketch / turtle walk / more sketches scenario . Here is a little design that will get you started on your walk . Break up the tasks into sections, write a Logo procedure for each, and put the sections together into a master procedure that controls the action . '2. =. tJv~ ?>~ or:: 2. owS G :: .JlJ~ ~'6l2- Dr: CoL\.At-"\,JS *- =. Sr\APE - Exercise 4.9 Design a procedure that will place a certain number of STARGONsrandomly on the screen (a random rectangular grid ). Look up the RANDOMcommand in your Logo language manual and carry out some visual experiments with it . Try to say something about how you feel when you look at the " designs" produced by your random machine. 161 Chapter 4 Exercise 4.10 Piet Mondrian was a painter who specialized in rectangular grids . Find one or two postcards, or small reproductions, of Mondrian 's work that you like . The portability is important because I want you to pin them up over your desk or work space. Now, spend a lot of time looking at these Mondrians . Can you characterize, very roughly, the grid themes of your Mondrian examples? Can you translate your characterization of Mondrian grid themes into a Mondrian model ? The end of the chapter at last Sometimes people think that Logo procedures must be complicated to be good . Wrong . Go back and look at NEPHROID; it really has only one line . Here are two rectangular grid procedures that are short and surprising . They should get you into shape for Chapter 5. TO ZIP : SIZE : GROWTH ; Set your pen to the reversing ; and try ZIP 10 5 . REPEAT 2 [ FD : SIZE RT 90 ] ZIP : SIZE + : GROWTH: GROWTH END TO ZIPM : SIZE : GROWTH ; Set your pen to the reversing ; and try ZIPM 10 1 . 05 . REPEAT 2 [ FD : SIZE RT 90 ] ZIP : SIZE* : GROWTH : GROWTH END 162 color, color, Chapter 5 Rectangular and Random Grids "Teased by the crisscross of the world ." John Galsworthy Placement, motif, and symmetry By now you should have an appreciation for the power of visual models to aid your thinking about shapes. Simulating stone mason marks encouraged you to think about clusters of shapes and their relative placement . In these mason mark designs, placement was carried out in reference to a single point that became the center of the final composition . Often, an arrangement of objects around the center was repeated to create a special kind of balanced figure, a symmetric one. But what is symmetry ? Let 's be as simple as possible about this notion . To say that a design is symmetric means that each part of the design has the same organization as some other part . It is the repetition of parts that creates a certain balanced quality in the whole . All balanced designs, however, are not necessarily symmetric . Look back at the Delaunay machine in Chapter 3 for an example of balance without symmetry . Can you imagine a design that is partially symmetric or partially not? Specifically, symmetry describes a correspondence in size, shape, and relative position of parts in reference to a dividing line, or median plane, or Chapter5 about a center or axis. Circular symmetry is a special form of design balance in which the correspondence of parts is about a central point . Look back at the stone mason marks you produced in Chapter 4. How would you describe the nature .of the circular symmetry exhibited in them ? Look, too, at the designs you made to represent your own character in the personal mark excursion, Exercise 3.6. How much symmetry do you find there ? We know something of balanced personalities, but what would a symmetric character be? Put your comments in your notebook. This chapter will investigate another form of balance - rectangular symmetry . Here the correspondence of elements will be relative to the rows and columns of a rectangular grid rather than to a central point . Let me have one last word about symmetry before we move on to modeling it explicitly . Symmetric designs can be viewed on two levels . We can divide the composite design into the motif and the rule of repetition. For example, look back at two symmetric images in the last chapter- STARGONS and NEPHROIDs. The STARGONmotif is the kinked line and the repetition rule is the machinery of CNGON. In the nephroids, the motif is the circle and the repetition rule is stated as the last line of the NEPHROID procedure (see Chapter 4). A small review of list mechanics The first example of rectangular symmetry will be taken from Exercise 4.8. This problem asked you to design a generalized rectangular -grid machine . But first we will need to review some Logo list -handling mechanics in preparation for the approach I would like to take to this problem . Please read the list section in your Logo manual, and I'll quickly go over the most important list operations . 164 Rectangular and Random Grids L-. I List definition Lists are collections of Logo elements enclosed by square brackets [ ]. Be careful not to confuse these square brackets with two other kinds of brackets available on most computers : round brackets ( ) and curly brackets { }. Round brackets are ..... usually called parentheses. Here are some examples of lists that contain one or more elements that are not themselves lists : [ JIM ] [JIM CLAYSON ] -rlOO 200 3 - 201 [JIM LOOKS85 BUT ACTS 16] [STARGON4 40 . 5] [FD 100 RT 45 FD 100] Lists may contain elements that are themselves lists . That sounds a bit recursive, doesn't it ? [REPEAT4 [FD 25 RT 90] ] [ [ [MIT] [CHICAGO ] [LONDON ] ] [ [AMERICANCOLLEGEIN PARIS] [ PARSONS ]]] Lists may also contain no elements. These " empty lists " are very special beasts, and we may find them useful later on: [ The following list is not empty. It has two elemen .ts, each of which is an empty list: [[ ]] 165 Chapter 5 Valuesof variables canbelists The value of a variable can be a list as well as a number or a word . MAKE ; " JIM Variable MAKE ; " JIM Variable MAKE ; " JIM Variable 21 ' s value is a number . " HAPPY ' s value [ STARGON ' s values is a word . 5 50 . 5] is a list . Th ~ READLIST construct Let 's design a procedure to carry out the following tasks : Ask the user to type a special x-y screen location on the keyboard . Put the two numbers typed into a list . Make this list be the value of a global variable . TO GIVE . PT ; To create a global variable named ; : POINT whose value will be a list ; containing the x and y values typed . PRINT [ Give the x and y values of the point MAKE " POINT READLIST END ]] Notice that the PRINT command can be used to print a message on the screen. The message to be printed must be a list, but the outer brackets will not be printed . Type GIVE . PT and it will talk to you by printing the message: "Give the x and y values of the point ." You will notice another new command, READLIS T, on the line after the PRINT statement . When Logo arrives at a line that contains a READLIST command, Logo will wait until something is typed on the keyboard . Whatever 166 Rectangular and Random Grids is typed is placed within a single list, and this list is made available at the location The of the word READLIST . line " POINT READLIST, causes the following three operations to be carried MAKE out : 1. Logo waits until something is typed (for example, 100 200 ). 2. Logo puts whatever has been typed into a list (for example, [ 100 200 ] ). 3. Logo creates a global variable named : POINT and makes its value equal to the list made available by READLIST (for example, typing : POINT would now give [ 100 200 ] ). Try the procedure . Type GIVE . PT, type in two numbers, and check to seeif a variable called : POINT has been created and given the values you typed . Takingindividualelements outof a list Now, let 's send the turtle to the screen address that is now stored within the list named : POINT. You might think that the following should work : SETXY : POINT No . We have to take the numbers out of the list before the SETXY command is happy . SETXYneeds two arguments, not a single list that has two numbers inside it . There are many list manipulation commands in Logo, and you should review them in your own language manual . We will discuss only a few of these commands here . FIRS T list returns the first element of that list ; LAS T list returns the last element; BUTFIRST list returns the list with its first element gone; and BUTLAST list returns the list with its last element missing . Some quick examples : 167 Chapter5 FIRST [A B C ] returns A LAST [A B C ] returns C BUTFIRST [A B C] returns [B C] BUTLAST [A B C] returns [A B] These commands can be used in combination : FIRST BUTFIRST [A B C] returns B LAST BUTLAST [A B C] returns B Two don ' t final commands know how returns the many of , one . concise you don ' t could So TO let GO . ; To ; stored : ' s like send a 5 the : turtle , off a with BF BF to : POINT named . : JIM elements BF Sometimes . you COUNT : : fifth ITEM JIM . : [ stored you But of PARIS as ] the want there element 10 location and BF the though that list many returns to off JIM . list JIM this turtle in list FIRST ITEM something the are the have say : do in you command send there elements suppose You we elements number Finally fifth before : . is JIM Why the . a Be more careful ? list : POINT the command . PT send the turtle as to the list the x value - y position of : POINT . PU SETXY FIRST : POINT LAST : POINT PD END Putting A several single Logo example SENTENCE will [ SENTENCE 168 A B up out a few [ - SENTENCE into make ] 100 Look Carry elements N the M ] 50 list point . returns [ returns in experiments a [ your A - manual to see B 100 and for yourself N M 50 ] ] compare it how they with are different LIST . . Rectangular and Random Grids While you have the manual in front of you, take a peek at LPUT and FPUT . How are they different from SENTENCE and LIST ? These list manipulators may seem a bit ponderous at first, but you will soon get a firm, visual sense of how they work . And that will help you decide when they are useful . Regular rectangular grids Now we can get on with Exercise 4.8. " Design a Logo procedure shape into a rectangular that will put a grid . You should be able to define the number of rows and columns that the procedure will use and the distances between them . You might want to be able to change the shape that goes into the grid as well . Make sure your rectangular grid can be placed at different starting places on the screen ." Turtle - walk sto ~ boarding As usual, the best way to approach a complicated Logo problem is to do a turtle - walk diagram . A turtle - walk diagram is similar to the story boards used to plan TV and cinema advertisements illustrate . The story board is a series of small, sketched cartoons that the major events to be covered individual cartoon is accompanied by a few written we have done with turtle walks : sketch the important in the film . Each comments . Sounds like what " events " and comment on them in words . On the next page is an example of how an illustration and design student used the story board approach to structure the rectangular grid exercise. 169 Rectangular and Random Grids Descriptions of the story board cartoon screens " Cartoon A indicates the preparation that must be carried out before the grid is started . The screen must be cleared and the GET . PT procedure run to define the upper -left -hand -corner starting point of the grid . Somehow, the shape notation of the little figure that will make up the grid needs to be done here, too. I don 't yet know how to do that, though, so I 'll just assume that something, maybe a variable called : MOTIF, 'holds ' the necessary shape notation . GO. PT puts the turtle at the first grid position . " Cartoon B shows the drawing of one individual figure at any point in the grid . I 'll assume that this can be done by using whatever is inside : MOTIF . My notation will be : PAINT : MOTIF . (Still don 't know how .) PAINT will take the turtle from its current grid location, draw the little shape inside : MOTIF, and then return the turtle to the grid location on which PAINT found it . So some kind of state transparencymust be respected by PAINT . " Cartoons C, D, and E sketch the movement of the turtle from one column to the next. The turtle must move over to the next column until it has completed all the columns of anyone row . To do this, the turtle needs to pick up its pen, turn right 90, move forward the between-columns distance, turn left 90, and put down its pen . I'll call this procedure CSTEP, for olumn ~ ping . CSTEP's single argument will be the distance between columns . " Cartoons F, G, H, and I sketch the movement of the turtle from the end of a finished row to the beginning of the next row, if an additional row is required . Cartoon G shows the turtle, after lifting its pen, moving left to the x value of the starting point, : POINT . The turtle then turns right 180 and goes forward by an amount equal to the between-row distance. The turtle turns another right 180 and puts down its pen. The name of this procedure will be RSTEP, for row ill2ping . RSTEP's single argument will be the distance between rows ." 171 Chapter5 Story board cartoons into Logo notation Everything that the illustration student said above is correct. Her intuition was very good and her idea about PAINT : MOTIF (before she knew about lists) is very elegant. Let's use her story board "characters" and translate them into formal Logo notation. The procedureto set up the upper-left-hand starting point has already been written . It's GIVE . PT. Our procedure GO. PT sends the turtle to the starting place. What about PAINT :MOTIF? What is :MOTIF? Let's think of : MOTIFasbeinga list of the Logocommandsthat will draw the neededfigure. For example , supposewe want a grid madefrom individual stars with 7 points. We could make the value of : MOTI F be a list like [STARGON 7 10 . 5] . How do we then"paint" this list? Painting the :MOTIF list We are already command We could could list be simply [ something the familiar ] as follows used say is with RUN : to Make REPEAT the MOTIF REPEAT [ something : get the 1 ] . sure the n list : MOTIF So we [ Logo painted . can turtle is A answer where Here is an example of RUNninga : MOTIF list : 172 . 5] - shorter then RUN the list that defines the motif . MAKE"MOTIF [STARGON 7 10 RUN :MOTIF commands - of saying question want construct drawn way the you or ] on the This screen . REPEAT of the . motif how to 1 to paint be , and Rectangular and Random Grids Don is no the ' t forget problem turtle and how it found to ask keyboard , to place the : MOTIF variable value of : MOTIF ; used list must because be state this transparent procedure . There always leaves it . procedure the GIVE STARGON with MOTIF a tiny on To the this where typed ; , that about Let 's write TO , though that results the elements of the : MOTIF list into list, and to make the be the list be . . MOTIF set up by the the PRINT [ Give PRINT MAKE [ The " MOTIF master the Logo grid that - building commands shape commands READLIST must will be procedure that be define state . the transparent shape ] ] END To verify what we have done so far, type GIVE . MOTIF and then respond with a series of state -transparent Watch the turtle . Everything Let 's name the master Logo commands . Next, type RUN : MOTIF . OK ? procedure that will put the pieces of the grid procedure together FLAG . FLAG will need four arguments : : COLS : ROWS : CDIST : RDIST - number of columns in the grid number of rows in the grid distance between the grid ' s columns distance between the grid ' s rows 173 Chapter5 Before we write FLAG, we can write the much simpler CSTEPand RSTEP: TO CSTEP : C ; To move the turtle ; The between - column PO RT 90 FD :C LT 90 PD END over one column . distance is : C. TO RSTEP : R ; To move the turtle from the end of one row ; over and then down to the beginning of the next . ; The between - row distance is : R. PU SETX FIRST : POINT RT 180 FD :R LT 180 PD END We can now easily fit the pieces together . TO FLAG : COLS : ROWS : CDIST : RDIST ; To create a rectangular grid flag . ; : POINT holds the x - y starting position and ; : MOTIF holds a state - transparent shape . GO. PT The circle notations used above are transposed into the REPEAT commands of the completed FLAG procedure below . Notice that one REPEAT is "nested" inside another REPEAT. This REPEATnesting copies the circle nesting above. 174 Rectangular and Random Grids TO FLAG : COLS ; To create ; : POINT has ; : MOTIF has : ROWS : CDIST : RDIST a rectangular grid flag . the x - y starting position a state transparent shape and in it . GO . PT REPEAT : ROWS [REPEAT: COLS [RUN :MOTIF CSTEP : CDIST] - END RSTEP : RDIST ] That 's it . The compactness of the FLAG procedure is possible because we used lists for " holding " our MOTIF description, nested REPEAT commands, and short, support structures - GIVE . PT, GO. PT, GIVE . MOTIF, RSTEP, and CSTEP. But don 't overlook the difficulty of understanding that double repeat operation . Try getting an intuitive feel for it by running FLAG with STEP turned on; watch carefully what happens. Did you rejoice that none of the procedures associated with FLAG used recursion ? The REPEAT construct and recursion methods are often alternative ways of accomplishing a modeling task. The choice between the two approaches is often a personal one; one method may simply seem more aesthetically pleasing to you for a specific problem . Occasionally, you may feel strongly that recursion is the right visual metaphor for what you are modeling and other times that it is not . Exercise 5.2, at the end of this chapter, asks you to restructure FLAG using recursion, avoiding all uses of REPEAT. You should then be able to make your own comparisons between these alternative styles. On the next page you will see an exploration of grids made up only of squares. Can you guess : MOTIF's value for each of the illustrations ? State transparency in the MOTIF list The FLAG-produced grids on the previous page all used either CNGONor CONGON in their MOT I F lists . Remember how careful we were to design those two procedures so that they both left the turtle in the same position in which it was found ? This is state transparency. If you include procedures in a FLAG MOTIF list 175 , Chapter5 Rectangular grids composed of squares 00000 00000 00 <> <> <> 0 0 00 0 176 Rectangularand Random Grids that are already state transparent, everything is fine . If, on the other hand, you wish to make a grid design from a non -state-transparent procedure you have some additional work to do. Let 's review these ideas by going through the exercise of turning a non-state-transparent procedure into a state-transparent one and then making grids with it . Suppose we want to make a grid ' with a teepeeshaped figure like the following : . . . : . . . . . . . ' . . . Here is a procedure for drawing the teepee shape: TO TEEPEE : SIZE RT 30 FD : SIZE RT 120 FD : SIZE END This procedure is not state transparent because it does not return the turtle to its original position . The starting and ending positions of the turtle are shown below . . . . . . . . . . . .. . b " . " .. ..~..... . .,..<:]... . . . 177 Chapter5 There are two simple ways to make TEEPEE state transparent . The first is the most obvious : simply move the turtle backward to where it began. Call this procedure TPI . TO TP1 : SIZE ; First approach RT 30 FD : SIZE RT 120 FD : SIZE BK : SIZE LT 120 BK : SIZE LT 30 END to making TP state transparent . This method doubles the length of the procedure, and the additional length obscuresthe procedure's design. Proceduresshould be as short and as descriptive as possible; that's good modeling style. Perhaps there is another way to make the statetransparencyof the proceduremore obvious. We really want to say something quite simple to the turtle : "Remember where you started from- and in which direction you were heading- and then go back to that position after you have finished drawing the teepee." The second approach does this explicitly; but we need two new supporting proceduresto make it work nicely. The procedureRECORD . pS assemblesthe turtle's current x-y position and heading into a three-elementlist called : Ps . The operation of RESTORE . pS shouldbe obvious. TO RECORD . POS ; Records the turtle ' s current position MAKE "pS ( SE XCORYCORHEADING) END state . Note : when the command SE has more than two arguments, as in the situation above, parentheses must be placed before SE and after a space left behind the last argument . Verify this in your own Logo manual . 178 Rectangular and Random Grids TO RESTORE . POS ; To restore ; recorded in PU SETXY FIRST SETHEADING the turtle : : LAST to POS the position state . POS : FIRST BF : POS POS PD END Here, then, is an obviously state - transparent teepee maker : TO TP2 : SIZE RECORD . POS TEEPEE : SIZE RESTORE .POS END You will find many more uses for RECORD . POS and RESTORE . POS . A Mayan -inspired grid that vibrates I hope the square and teepee grids make you think about rectangular symmetries and that you are now impressed with the help Logo models give us in exploring visual ideas. I will admit, though, that these grids are not the most exciting images to look at. They lack surprise and " quirkiness ." They are, in fact, too balanced and too symmetric . So I am pleased to present a student -designed grid that exhibits an odd, surprising quality - within a symmetric framework . I' ll let the student describe his own work . " I wanted to make a grid from square-ish spirals that wrapped back on themselves. I needed to use the RECORD. POS and RESTORE. POS procedures because I wasn't sure where my spiral would end up, and I had to make them state transparent . I came up with the Mayan description of the grid only after I looked at my results . I was surprised about the vibrating quality of the grid ; I tried to explore the source of the vibration by changing the arguments that I gave to my procedures." 179 Chapter5 Here are the two procedures the student needed for his : MOTIF list : TO SPIRAL IF : LEG : LEV < : FAC 1 REPEAT 2 SPIRAL ( : LEG [ STOP [ FD : LEV ] : LEG - : FAC RT ) 90 ] ( : LEV- l ) : FAC END TO LAY : LEG . , Position . , intervals : FAC 4 REPEAT 4 : LEV spirals at around [ RECORD a . POS SPIRAL : LEG RESTORE . POS SPIRAL 90 15 12 180 90 15 degree point - END LAY 90 central 12 ..J L I I : FAC :LEV RT 90] . Rectangular and Random Grids Two Mayan grids For both illustrations below, the : MOTIF list was [LAY 30 5 12] . The FLAG arguments were 4 3 65 65. The reversing pen color was used for the second illustration . 181 Chapter5 Adding random components to rectangular grids One effective way to make rectangular designs more visually entertaining add limited amounts of randomness by exploring Exercise 4.9: " Design a procedure that will place a certain number of STARGONsrandomly to them . I would like to introduce is to this idea on the screen (a random rectangular grid )." How did you approach this ? No doubt you looked up the RANDOMcommand in your Logo manual and found that it could produce " random numbers " ; but what are those ? The exercise of generating random grids will give you a visual model of what these random look like . You need a good feel for these things actually random numbers because we will be using the idea of randomness for the rest of this chapter and in several future chapters . Randomnumbers The Logo command RANDOMrequires a single, integer argument . Logo then produces an integer in the range from 0 to the argument minus 1. For example, RANDOM4 would produce a single number that could be 0, 1, 2, or 3. Each of these numbers is equally likely to be returned by Logo, and it is very unlikely that you could correctly guess what Logo would respond every time you type RANDOM argo Guessing a single RANDOM4 outcome correctly is tough . It is even tougher to predict correctly the pattern of the numbers given by Logo if you should type RANDOM4 over and over again. There may indeed be a pattern, but it cannot be guessed easily before it occurs. Unless, of course, you are exceptionally lucky, have ESP, or know the model that your version of Logo uses to generate random numbers. Let's design a Logo procedure to generate a series of random numbers so that we can look at them . Here is an example of such an exploratory tool . 182 Rectangular and Random Grids TO RANDOM . NUMBER: RANGE : N ; To PRINT : N random numbers in the IF : N < 1 [ STOP] PRINT RANDOM ( : RANGE +l ) RANDOM . NUMBER : RANGE ( : N- l ) END Note on the several screen SIN 43 random for the the or that random number Random screen random need have be to to using . You calculation . never to ) be procedure . . Other Second , First , larger than as large as the arg , say - , : RANGE. use of PRINT to display of this would be PRINT examples remember be 0 to tha ~ RANDOM I . If you : RANGE arg want , it you to will outputs a be possible have to use not just . locations random different a of + l numbers correspond this can : RANGE need two about variable number ( next value PRINT RANDOM We things range decide how but random numbers the x - y numbering have RANDOM for function screen each dimensions to make position of , some can positions convention maximum may the let me adjustments be on , and the the screen show used to your screen range of these . Because you the generate . Obviously we numbers must different screen size screens that I will : "2..r;- 0 ,0 -, " 00 '"2.. 00 - \ '2..5"" 183 Chapter5 Notice that the x coordinates of run from - 125 + 125 . To requires negative as produce negative numbers coordinates Generalizing What need Let 's design range how do we is a , we be Logo range a from - 200 random clever . that will to + 200, and position numbers a bit that procedure may include procedure that improves new procedure RR for numbers this random must run pick as positive a new the possible less here a defined Call screen . But on since this RANDOM the y screen will not RANDOM we within well to my and the do it ? . RR will need second to two negative positive integers as RANDOM random numbers within a defined arguments , the first to the end . Call the higher might help . We than and higher than : HI . We ' +\ t - f well number extends a drawing never as a random and define upon Perhaps : LO produce - want random want LO define them : LO to do this . range lower and of end : HI numbers that are these numbers here : - ~ \ - . of . But never - + l...o We no could express less than : LO Perhaps we could : HI and : LO We already difference between RANDOM1 + 184 and and no this a little more than generate random then these know : HI ( : HI add how and to : LO : La ) differently : LO plus numbers to by the saying difference between 0 and that we want between the numbers : HI and difference : LO . between : LO . generate using random RANDOM : numbers between 0 and the Rectangular and Random Grids This expression will produce numbers never smaller than 0 and never bigger than ( : HI - : La ) . The random number we want, the numbers that fall in the range between : La and : HI, could be found with : : LO + RANDOM1 + ( : HI : La ) ure : Wethushavetheideaweneedto writetheproced RR : LO : HI To generate a single random number in the range defined by : LO and : HI . OP ( : LO + RANDOM1 + ( : HI - : LO TO . , . , END Note the appearance of the new command OP, short for OUTPUT. Look it up in your Logo manual . Why do we need OP in the procedure RR? Experiment with RR. Notice that it works fine for negative numbers . For example : RR - 100 RR - 100 - 50 50 But what 's wrong with the following ? RR 100 - 100 Using RR to generate random screen locations We can easily generate a random screen location for my screen with the following : SETXY (RR - 200 200) (RR - 125 125) Let's use this SET idea to send the turtle to a random position on my screen. 185 Chapter5 TO GO. RANDOM . SCREEN ; To position the turtle at a random x - y screen PU SETXY (RR - 200 200 ) (RR - 125 125 ) PD END point Putting the random grid procedure together We can now put the pieces together. GO. RANDOM. SCREENsends the turtle to a random screen position . Next, we want a : MOTIF placed at this point . Then we send the turtle on to the next random position with GO. RANDOM. SCREEN. The : MOTIF to be drawn at each stopping position can be defined, just as we did in the rectangular grid exercise, as a list of Logo commands . We call the master procedure that combines the pieces RANDOM . PLACER. Let's build a few : MOTIF lists to test out RANDOM . PLACER. MAKE" ORNAMENTl[STARGON 5 20 . 5] MAKE" ORNAMENT2 [CNGON4 30 CNGON30 30] 1 or RUN : ORNAMENT2 . Remember Now we could tell Logo to RUN : ORNAMENT that this is equivalent to typing: RUN [ STARGON 5 20 . 5] RUN [CNGON4 30 CNGON30 30] Here is what these two : MOTIF lists look like : ""i:? 186 Rectangularand RandomGrids Naming is power Much of Logo's power comes from its ability to make a name, like : ORNAMENT 1, have the value of- or be equivalent to- something else that is much more complicated . This super shorthand is enormously useful . Once we decide how to do something in Logo, we give it a name. Then all we need to remember is the name of the things to be done and not the complicated bits and pieces actually required to get them done. Building the visual model of random numbers No more TO talk RANDOM here it is . . PLACER ; To ; : MOTIF IF : T GO . RANDOM RUN ; place the : MOTIF shape randomly < 1 [ STOP : T list on given the screen as the : T argument times . ] . SCREEN : MOTIF RANDOM . PLACER : MOTIF ( : T - l ) END Visual experimentation Try running this routine by typing the following : RANDOM . PLACER : ORNAMENTl 25 ~ * ~u W u {:? ~ ~ ~ Uu 187 Chapter 5 RANDOM . PLACER : ORNAMENT225 () Generalizing I the was surprised expected to figures that often of see when I " mess pleasing and from boring if have geometrical , little screen , for Second which the entire the I character of a at . nice I could blend some of , random Instead I of . The balance lively a character another were seen , . First it would let as a 's , wraps found random . of the the subdued . I of grid of some others design collections placement in and grid one of way of giving life clean up the random element the window of screen be able randomly the randomness addition around to this The an of like are . be that , figures screen . The grids margins example , looked : MOTIFs Some general at little . can all : MOTIFs first distinctive the already before more of produced structure But " I was clusters grids while Many were . wondered you saw tangled others and 188 I what : MOTIFs neutral my by a composite of machine different unbalancing a placer were quite grids random . If I little a : figure finishes at to change the . could So far define , of we to a procedure I don 't is too near the top size have the the rectangular randomness animation placer tidiness If bit and and placed . a into into static design and like the the a . make it overlapping bottom of the " window " into . of been " window the using the size " and define size of Rectangular and Random Grids its location on the screen, I could have several " fields " of randomly placed : MOTIFs on one screen. Here is a sketch of what I have in mind . Because wind owing randomness to structured might be useful when we attempt patterns, let 's start working to add bits of on this window business first . Defininga windowasa list Let 's define the size and placement let 's use the following of a window in terms of a list . Arbitrarily , convention : the first element in the list represents the y value of the top of the window, the second element is the x value of the right edge of the window, the third element is the y value of the bottom of the window, and the fourth element is the x value of the left edge of the window . I started at the top of the window and went around it in a clockwise direction . My screen would be represented as a window MAKE" MY. SCREEN [ 125 Here is a procedure 200 with the following - 125 that will take a window characteristics : - 200] list as its single argument and draw the window on the screen. 189 Chapter 5 TO BOX : WINDOW ; To draw the outline of a rectangular ; window list on the screen . RECORD . POS PU SETXY (LAST : WINDOW ) (FIRST : WINDOW ) PD ; Positions turtle at top left - hand corner of window . SETX (FIRST BF : WINDOW ) ; Draw top of window SETY (LAST BL : WINDOW ) ; Draw right edge of window . SETX (LAST : WINDOW) ; Draw bottom of window . SETY (FIRST : WINDOW ) ; Draw left edge of window . RESTORE.POS END Note that BOXbegins by positioning the turtle at the top left -hand comer of the window and then draws the window by moving the turtle around the window in a clockwise fashion . BOXis state transparent, too. BOX : MY. SCREEN will draw a nice frame around whatever images are on my screen. Eliminating theoverlat2 of:MOTIFs near thewindow edge ~ Suppose that the : MOTIF that we are using is: MAKE " PIP [ STARGON5 20 . 5] If we were careful never to let : PIPs be drawn any closer than 20 units from each of the four window edges, we would never have any edge-overlap problem . We could just make the window smaller by 20 units in each of the four directions . A picture helps: ~ ~t' . . . . ~ . . . " . t ~ " ' . . . . ' . : E~ ; cI, vc: I-.a..tA :~ '. . . . . . . . . . . . . . . . . . : "::: W 1.oJ' V0 voJ 190 . ~ ~c. a. ff "J ~ ~,.,.. ~ Rectangular and Random Grids But how do we know how much to reduce the window is changed to something else ? If we knew the number when the : MOTIF list of the element in the : MOTIF list that referred to the " radius " of the : MOTIF to be drawn, we could pluck out this element and use it in our calculations . We are now at a stage in Logo when following Logo notation upgraded is easier to " talk " than English . So look at the RANDOM. PLACER . I have called this new, extended version RANDOM. PLACER . X. : MOTIF : WINDOW : N : T : T : MOTIFs within a given ; : WINDOW with no overlaps at edges . of the element within the : MOTIF list ; : N is the number " radius " of the : MOTIF shape . ; that defines the " BOTTOM " LEFT) ( LOCAL " TOP " RIGHT 1 : WINDOW ) - (ITEM : N : MOTIFJ MAKE " TOP ( ITEM 2 : WINDOW ) - (ITEM : N : MOTIF MAKE " RIGHT ( ITEM 3 : WINDOW ) + (ITEM : N : MOTIF MAKE " BOTTOM ( ITEM 4 : WINDOW ) + (ITEM : N : MOTIF MAKE " LEFT ( ITEM TO ; RANDOM To . PLACER randomly .X place , J , J REPEAT :T [ PU - SETX RR SETY RR PD RUN : LEFT : RIGHT : BOTTOM: TOP - - - : MOTIF] END Note that the procedure GO. RANDOM. SCREENhas been incorporated into the body of RANDOM. PLACER . X and that a REPEAT statement has replaced recursion . I think the procedure " reads" well and needs no more explanation . So let 's try it out . 191 Chapter5 Random grids willi no edge overlap 192 Rectangular and Random Grids Kandinsky grids Wassily Kandinsky (1866-1944) was born in Moscow but trained in Munich . He totally abandoned realistic art for the abstract, a form he consid ~red to be more spiritual . He made great use of simple geometric forms placed within frameworks that could be labeled "randomish ." A good example of such work is " Several Circles, No 323," reproduced on the next page. The original painting is 1.4 meters square, and the circles glow with translucent light, not at all like this tiny and opaque reproduction . It is enormous and transparent . I have also included Kandinsky 's pen-and-ink study for this painting . Stare at this poor reproduction for some time or, far better, go out and find yourself some Kandinsky reproductions on postcards. On the page following the reproductions, you will see a few of my Logo attempts to simulate Kandinsky 's " Several Circles ." They are, of course, pale imitations, but that is not the point . Now it 's your turn . Look at this painting and try your best to simulate several of the visual ideas expressed within it . There is more going on than just randomly placing circles. 193 Chapter5 Kandinsky circles 194 Chapter5 Random grids with multiple windows and multiple motifs Look back at the random grids . There is no single focus of attention, no single place that immediately attracts the eye in any of these designs. A single focal point isn't always wanted in a design, but let's experiment with trying to place one within a randomized The following pattern . experiment is my own . You can certainly come up with different approaches, though your exercise should have the same goal as mine, namely, exploring the visual idea of focusing random grids. I tried to focus a random grid by introducing two different sizes of the same shape (one large square versus many small ones) and by differences in placement (one large window for the small figures and one smaller window for the large figure ). I divided my screen into two windows, one on top of the other. MAKE MAKE " T . FRAME " B . FRAME [ 120 [ - 40 140 140 - 40 - 120 - 140 ] - 140 ] ; ; The The top window . bottom window Here is a picture of the two windows, using the BOXprocedure . BOX : T. FRAME BOX :B. FRAME 196 . Rectangularand RandomGrids Here are MAKE ; two : MOT " ORNAMENT3 A small MAKE ; the larger that [ CONGON square " ORNAMENT4 A IFs filled I will 4 use 5 : 1 [ CONGON 4 30 rimmed in black square 4 ] completely with 1 black . 5 ] . And the procedure that will carry out the experiments : TO R. FOCUS. DEMOl CG RT 45 RANDOM . PLACER. X : ORNAMENT 3 : T. FRAME3 20 4 :B. FRAME3 1 RANDOM . PLACER. X : ORNAMENT END Here is my first experiment (the result is shown on the next page): BOX : T. FRAME BOX :B. FRAME R.FOCUS . DEMOl CG R. FOCUS . DEMOl CG R. FOCUS . DEMOl I then decided to look at the visual impact of a few modifications one focusing idea (two windows, two different sized : MOTIFs to this of the same shape ). Here are my changes in the experiment . Notice that the two windows are now vertical rather than horizontal . MAKE " L . FRAME [ 120 MAKE " R. FRAME [ 120 70 - 120 - 140 ] 140 - 120 70 ] BOX : L . FRAME BOX : R. FRAME TO R. FOCUS . DEMO2 CG RT 45 RANDOM . PLACER .X : ORNAMENT 3 : L . FRAME3 20 4 : R. FRAME3 1 RANDOM . PLACER .X : ORNAMENT END 197 Chapter5 Focusedrandom grids #1 aa a a a a a a a . a a a a a a D a a a . a a a - . . a a. a a a a a a D a a a . a aa a a a a a ~ a a . a a D 198 Rectangular and Random Grids Here is my second experiment (the results are on the next page ) : BOX :L . FRAME BOX :R. FRAME R. FOCUS . DEMO2 CG R. FOCUS . DEMO2 CG R. FOCUS . DEMO2 Addingrandomto theregular A good place to begin on this venture is to look at the Dutch painter Piet Mondrian . Did you try Exercise 4.10? There I asked you to select a few examples of Mondrian grid painitngs, study them, characterize the grid themes, and translate your characterizations into Logo procedures. I selected the painting " Compositie met kleurvlakjes ill . 3" of 1917. I am sorry you cannot see the colors- pale blue / gray, oleander pink, and butter scotch- though you can see the shapes and their placement. Here is what I said to myself . "Those boxes are all upright and almost on a rectangular grid . The dimensions of the boxes themselves are randomly changed in both height and width, but I will simplify that a little, altering them only in the height dimension ." How to do it ? 199 Chapter5 Focusedrandom grids #2 . D . . a . . . . . . . . . . . . . . . . . . . . .. . . . . . D . . . . . . . .. . D . . .. .. . . . . . . . . 200 . Rectangular and Random Grids " Suppose we start with a regular, rectangular grid . The turtle arrives at a point, but before we draw anything, we randomly 'perturb ' the position a little in the x-direction and a little in the y-direction . Then we draw a box that has itself been perturbed a bit in the height direction . Then we go back to the arrival point and let the regular grid machine move us to the next point, and so forth . . . ." The following procedure mirrors this description . Some samples are shown on the next page, along with the real Mondrian . TO . , M : E : DH To . BOX draw a Mondrian The x position y position : DX : DY box based the box on current x - y position . . , for found is . number , from the range - : DX + to : DX by adding to current by adding a random x . . , The ~. number for from the The height from the range The width of box range of the the box : DH to box : DY is is found to + equal + is : DH : DY to to : E a current y plus a random random . number . always equal to : E . " HT ~ . LOCAL the " HT ~ . MAKE : E . POS ~ . RECORD + RR ( - : DH ) : DH PU SETX ( XCOR + SETY ( YCOR + RR (- : DX) : DX) RR (- : DY) : DY) PD REPEAT 2 [ FD : HT RT 90 FD : E RT 90 ] RESTORE.POS END The next operation is to place M. BOX - with appropriate arguments - into a : MOTIF list and then use FLAG to grid the whole affair . Note : M. BOX is state transparent . Probabilistic selection of : MQTIFs The Mondrian boxes exercise was a start toward the integration of random elements into defined geometries . Let 's look at one more attempt at this kind of integration before going on to the exercises of this chapter . 201 Chapter 5 and two grids of Mondrian boxes 00 DO D DO D DO DO ODD 0 DD 0 D DO ODD DO ODD DODD 0 A real Mondrian 0 DD 00 DO ooDDO DO D 0 DDDDD 0000 DO D D 00 DODD 202 Rectangular and Random Grids Suppose we want to produce a regular rectangular grid from several : MOTIFS, but we want the selection between alternative : MOTIFs at any point to be probabilistic . That is, at any arrival point in the grid, we would like the choice between drawing one : MOT I F or another to be based on given probabilities . Let 's think this through using a model . Define a procedure that selects between two lists according to a probability measure. Let the probability P 1 be measured in hundreds units, that is, the number of times an event will occur in one hundred chances. The probability of selecting the first list, : L 1, should then be : P 1 / 1 0 0, and the probability of selecting the second list, : L2, should be 1 - ( : Pl / 1OO) . TO P . GET : P1 : L1 : L2 ; To output one of two lists (either : L1 or : L2 ) when the ; probability of the first being selected is given by : P1 . ; : P1 is given as times in 100, e . g ., 1 in 100 = . 01 . IF : P1 > RANDOM100 [OF : L1 ] <- - - ??? OP : L2 END How does this procedure work ? The real action comes on the line with the question marks . RANDOM100 will give one number selected from the range 0 to 99, one hundred possibilities in all . The chance that the number selected will be 0 is 1 in 100 or .01; the chance that the number selected will be 0 or 1 is 2 in 100 or .02; and the chance that the number selected will be 0 or 1 or 2 is 3 in 100 or .03. Suppose that we set : P1 = 3. Now look back at the marked line above. IF : P1 > RANDOM100 will be TRUEonly if the random number generated is 0 or 1 or 2. As already stated, this will happen only 3% of the time . Therefore, P . GET will output : L1 3% of the time and : L2 97% of the time when : P1 is set to 3. Don 't be alarmed if you have trouble with these ideas. Probability and statistics are difficult subjects, and our intuition generally doesn't give us much help since it hasn't had much experience in a probability laboratory . Let's give 203 Chapter 5 your intuition a little education on how the probabilistic P . GET operates. Here is a procedure to run P . GET1000times to "see" what happens. TO VERIFY :P1 :A ; To test out P.GETfor any value of :P1. ; :P1 is measured in hundreds. So :P1 = 1 ; would mean a probability of . 01 or 1%. ; Always give :A a value of 1 to start . IF :A > 1000 [STOP] IF P. GET :P1 [YES] [NO] ) = [ YES] ) [PRINT :A] VERIFY : Pl ( :A + 1) END ??? Look at the line with the question marks . If P . GET selects the first list, [ YE S], then : A is printed out . If P . GET selects the second list, [ NO], then nothing is printed out . : A is the index that keeps track of the number of times VERIFY has run P . GET. Here is the first experiment . I typed VERIFY 1 1 and the following was printed . Don't be alarmed when you get different numbers for the same experiment . They should be different, shouldn 't they? 40 114 143 234 300 545 838 850 950 988 The interpretation : VERIFY had to run P . GET 40 times before [ YES] was selected. It wasn 't until the 114th time that [ YES] third was selected again . The [ YE S] occurred on the 143rd time, and so on. In summary, 10 [ YE S ] selections were made in 988 runs of P . GET. That indicates a probability of 10/ 988 = .01012, very close to 1 in 100. That was just what we wanted to happen . 204 Rectangular and Random Grids Let's try it again, this time typing VERIFY 1 1. Here's the response: 18 41 170 277 279 300 412 466 498 707 770 844 863 Your turn to analyze these numbers . Change the value of : Pl and experiment a bit more . Are you getting a feel for how random numbers can help us select things probabilistically ? Probabilistic grids Suppose we would like to produce a grid that is a combination of the following two : MOTIFS : MAKE" Ll RUN : Ll [ CONGON30 20 5 2] MAKE" L2 [CONGON 30 RUN : L2 20 1 5] 0 0 205 Chapter5 Our task now is to assemble the : MOTIF list . We certainly will use P . GET in the list to select from : Ll and : L2 . Let's start with : Pl = 50 (a probability of selecting : Ll of .5 or 50%). You might guess that the : MOTIF list should look like this : MAKE " MOTIF [P . GET The reason why discussed 50 : Ll : L2] this is not correct is subtle . Remember when we first : MOTIF lists, we said that the list must contain Logo commands that can be RUN to produce the : MOTIF . The list above does not contain such instructions . How do we get them ? We have to run P . GET 50 : Ll for one of the lists that does have the : MOT I F commands to be output . The following : L2 in order is correct : MAKE " MOTIF [RUN P . GET 50 : Ll : L2] Here is a little experiment that may help you in understanding the double run business. Type the following lines and analyze the results . How do these resul ts rela te to the discussion so far? RUN [P. GET 50 : Ll RUN [RUN P. GET 50 : L2] : Ll :L2] Here is another comparison to explore . Which is correct and why ? MAKE" MOTIF [ : Ll ] MAKE"MOTIF [RUN : Ll ] Designs Below are four probabilistic ring gri ds. The first grid uses this : MOTIF list : MAKE"MOTIF [RUN P. GET 100 : Ll 206 : L2] Rectangularand RandomGrids The second grid uses the same list but with the value of : P1 changedfrom 100to 0: MAKE" MOTIF [RUNP. GET 0 : Ll : L2] The third and fourth grids blend the two : MOTIFs according to the list : MAKE " MOTIF [RUN P . GET 30 : Ll Think about what : L2] ideas are being illustrated here . What does probabilistic mixing of : MOTIFs mean in this context ? We are introducing some amount of randomnessinto a geometric design . What exactly does randomness mean? On the page after next are some samples that illustrate these ideas using square grids, while those on the page following introduce a new design, a tiny spiral, into probabilistic grids . What is important ? This chapter is the longest discussing the machinery random numbers . Don encourage you objects that your amount of the your visual use strike amplify only to aesthetic fancy 't the book needed forget Logo your vision model in fancy , and ; the have to build rectangular , though , that parts to machinery I . Why am satisfaction parts . We model . Be the that careful , after perhaps too grids real explore ? Because certain spent goal the visual and of models give , though , not to get to be aimed generate , patterns is an the and enormous involved at to , and extend you too time book can will always to this images this all, is much with object of . 207 Chapter 5 Probabilistic ring grids 00000 00000 00000 00000 00000 00000 00000 00000 208 0 0 000 0 0 000 0 0 000 0 0 000 00000 00000 00000 00000 Rectangular and Random Grids Probabilistic square grids 00000 <><><>:.0.<> 000 <><> <><><><>~ 00000 .0.<><>-0><> 00000 '<>(>-<><>.0. <} .I( ..o.o <> O /(:);;.(>/(:)t() .().()<><>'<'>' <>. o~ <>() <) . 00 <>.0. <) /(><) () .(> <>-<><>.0.0 <>OI ()<:!I<) 209 Chapter 5 Probabilistic grids with spirals, rings, and squares The little spirals should be easy to reproduce . Can you guess at the : MOTIF lists used for all the designs? What is happening in the last : MOTIF ? There are three : MOTIFs . How could this problem formally . this be structured ? Exercise 5 .5 will ask you to attack . $0>~~ $0>~ $w ~ ~ ooo ~ $0>$0>~ $w (0) $ii > ~ 00 ~ $0>$0>~ $w (0) 0 10o ~ ~ $0>$0>~ $w 0 ~ OJ0 0 (OJ~ ({:I)0 \ 0 ~ . $0> $0>$ w (OJ\ 0 ('0) 0 ( 0 ~ $;a>$0> $0>~ ~ \0) 0 ~ 0 . $;a>(l~ $0>~ ~ (0) 0 ~ ~ . $;a>$0>. . ~ ~ . . . ~ . $;a>$0> $0>CO ) ~ . $0>. ~ ~ $;a>$0> ~ ~ ~ $0>$0>~ ~ ~ (0) $0> ~ . ~ $0>. ~ ~ ~ $;a>. ~ ~ 210 Rectangular and Random Grids Exercises There are eighteen exercises this time . They are not so easy, but you will surprised, I hope, by how quickly forget be ways to start will pop into your head . Don 't the turtle - walk / story -board approaches to developing pops, though . intuitive brain - ' Exercise 5.1 Go back and look at the circular grids you produced in Chapter 4. Review, as well, the personal mark that you created for Exercise 3.6. Add some randomness to these designs. Exercise 5.2 Restructure the FLAG procedure using recursion techniques. A void any use of the REPEAT command . Compare the two methods on aesthetic grounds . You might want to define carefully in words exactly what you mean by "aesthetic." Exercise 5.3 The rectangular directly grid procedures that we have studied so far place one row below another . Design a more general FLAG procedure even -numbered that allows the rows to be indented by some given amount . Use either repeat or recursive methods . 211 Chapter5 Exercise 5.4 Produce a super, razzle-dazzle demonstration of designs never seenbefore by Earthlings using the ideas of this chapter: motif descriptions with lists, placement of these motifs using variations of geometrical repetition rules, random number generation, and probabilistic list selection. During the preparation of this exercise, jot down any designrules that you discover. llIustrate your rules with examplesof designs that "work well" and onesthat IIdon't work at all.1I Exercise 5.5 Generalize P . GET so that it can select any number of lists . Extend the definition of :Pl so that it can specify the probability of selecting eachof the possible lists . Use your generalized P . GETto produce a number of multiple - : MOTIF designs. Exercise 5.6 Although we have designed a procedure called FLAG, we haven't designed any flags yet . Redesign your own country 's flag so that it better represents current life there - as you see it . You might want to find a book on heraldry so that you can break all the established rules and traditions . Or not . Either way, keep the iconography simple . Describe your heraldic symbols and symbolism in your notebook. Exercise 5.7 If flag you have a flair for - machine that will argument 212 values are flag modeling design established a for , design flag the for a generalized any country country . , multiple once the - argument appropriate , Rectangular and Random Grids Exercise 5.8 I found this Design exercise course One of : the function and the a pieces of artwork test pattern numbers to test linear provide they number & is not cH8 - , in there rectangular What a test Exercise test illustration 1962 during tomato too you some of an eventual need is kind on French TV test a Color of and television pattern quality of and black . The picture he the time as have and thin lines image that has . the . main resolution So , as value well as course into include , or another role 8 even call . around a . letters character element tradition scale Channel three design this white . Of designed follow , tuned major been to a broadcast viewer need for slot the thick not used . the , but Be central circular sure to fill the ." pattern with that this ? could the same ; Pop cans this want the . next Take not advantage have Art Each , of of been was , of are perturbed from .) Your characteristics faces will - images the however the realized strengths in Warhol may of message to eyes exhibit maybe Andy . You the ( openness randomly is movement sameness you page characteristics many contain patterns do on soup I exercise broadcast at no classroom technicians being the a any of other Logo and medium . 5 .9 The the , can show design is screen design the , but they judging tell of for broadcasting " Traditionally format in to wall patterns detail ' re - to colors varied the preparing usually pattern though is the patterns of a is of composed of 8 fidelity " Test to " Channel first of pinned Marilyn openness one face series or three , a of to and of mouths , next before 's design grid . different - Monroe each 's the of " Marilyn Warhol Warhol produce a two recall of , 's rectangular soup can , done in grid of is exactly , whose . stylized faces tiltiness ( Recall expressions you ," visually of the eyebrows , etc Mondrian . Don experiment box 't use too . 213 .) Chapter 5 Exercise 5.10 I love Mondrian paintings in several a this . others are simulate characteristics of Some not We of . simulated chapter examples canvas and . I . want you Mondrian the want with are 's use rectangles you them you I several studying to of to of do Logo characteristics more analysis vertical produced select the and by these several characteristics procedures . Clearly of this horizontal of one sort . bars bars to of I include articulate are colored in from these paintings state , in words his , and , the . This kind of exercise in no way trivializes the work of a Mondrian . Rather, you should have a better sense of his artistic genius after you have tried to copy paintings like these. 214 Rectangularand RandomGrids Two more Mondrians I 215 Chapter5 Exercise 5.11 Islamic art offers a treasury of circular and rectangular grid designs. Although at first glance many look complex, a second look will uncover one or two basic motifs that are repeated over and over again according to some grid protocol . Look through the following illustrations ; they exhibit designs of increasing complexity . Find a design that appeals to you . Design a collection of Logo procedures that can produce designs in the style of the one you have selected. Make sure that your procedures are general enough to be able to produce a seriesof designs, all based on a single theme. State the theme in words . You might be able to produce a number of the illustrated tile designs from a single Logo procedure . This exercise is very similar to the stone mason marks of Chapter 4. 216 Rectangularand RandomGrids Islamic tile design #1 217 Chapter5 Islamic tile design #2 218 Rectangularand RandomGrids Islamic tile design #3 219 Chapter5 Islamic tile design #4 220 Rectangular and Random Grids Islamic tile design #5 221 Chapter 5 Islamic tile design #6 222 Rectangularand RandomGrids Islamic tile design #7 223 Chapter5 Islamic tile design #8 224 Rectangular and Random Grids Islamic tile design #9 225 Chapter5 Islamic tile design #10 226 Rectangularand RandomGrids Islamic tile design #11 227 Chapter 5 Islamic tile design #12 228 Rectangular and Random Grids Islamic tile design #13 229 Chapter 5 Exercise 5.12 Are you beginning to see grid patterns everywhere ? This chapter has suggested that grid -thinking is a convenient method for finding and analyzing regular patterns . Furthermore, our work with random components suggested that grid -thinking can be extended into the realms 'of irregular shapes and forms . The design materials used in the chapter, however, were selected from the created worlds of the artist and designer . The final two exercises of this chapter suggest that grid -thinking can also be useful in describing ways of seeing irregular patterns in the natural world . I have a small, seventeenth-century house located in the department of the Sarthe, about 100 miles southwest of Paris. The Sarthe, nestling between Normandy and the Loire Valley, is covered with forests, fields of apple trees, ponds, streams, and marshes. During the long and mild Sarthe summer and autumn, the meadows surrounding my tiny house are filled with the ochre and black and white cattle that are typical of this region of France. But most typical of the area is the ubiquitous wood stack. Every Sarthe farm has at least one, and each stack grows larger after the annual harvest of farm trees and hedgerows . And even though many farms are no longer heated by wood, the Sarthe farmers continue to build new stacks. Although I have often noticed these wood piles in a casual way, it was only recently that I began to sketch them and to think of them as sculpture . Suddenly, I realized that these stacks are magnificent " wood works " ; in fact, they are huge log grids. On the next page is a quick sketch of a stack of logs. What rules might have been used to decide how to stack the various sized logs into this big pile ? Design some Logo procedures to generate log grids based on different stacking rules. 230 Rectangularand RandomGrids '- - - - - ~~ - - - Exercise 5.13 Twenty -five years ago I fled from the Chicago cold to the continuous summer of Southern California . I lived in a funky house high in the Hollywood Hills overlooking polluted - yet gloriously lighted - Los Angeles . Alas, I suffered from one great loss. While my garden was lush with tropical plants, I had no pool . My sense of incompleteness was made only more bitter by the fact that I looked down on a city filled with thousands and thousands of pools . The impression of distant pools is still vivid in my mind . Last summer I visited my Pasadena mother -in -law and her pool . One lazy afternoon, sitting in a deck chair and still a bit high from the pool chemicals, I studied the patterns created inside that pool by LA light hitting the rippling crystalline water . Yes, it was pool -light grids that I saw; and one Pasadena pool was suddenly different from all the other pools. Unfortunately, you may not have a pool at your disposal to study, even one at a distance. As an alternative, the basins of fountains are good ; they contain clear water with plenty of surface disturbances . If you lack both pools and fountains, I suggest that you look at a few paintings by David Hockney . I know of no other painter who has so well caught Southern California pool light . Look closely at the following Hockney painting . Does it suggest an approach to designing watery grids ? Can you generate a series of pool -light grids that are all of your own making ? But maybe you would rather describe the reflective patterns seen in rivers, streams, or lakes ? 231 Chapter5 Exercise 5.14 If you attempted the Hackney grid exercise, you may have found yourself needing an arc drawing procedure. We can draw circles, but what about arcs? Design a left and right drawing arc machine that takes two arguments: the radius of the circle of which the arc is part, and the angle of the arc. Hint : the circumferenceof any circle is equal to 2nR, where R is the radius of the circle. The length of an arc is equal to the circumferenceof the circle from which it is taken times the angle turned by the arc divided by 360degrees. 232 Rectangular and Random Grids Exercise 5.15 Every season of the year has some major festival . Use Logo to help you design an appropriate greeting card for a fete that is coming soon . Don 't forget the envelope; your card and envelope designs must complement each other. The only rule for this exercise is this : produce a card that could not have been easily or appropriately realized in any other medium . You can combine Logo designs with other materials, however, and collages are fine . You might want to add visual remarks with paint, inks, photographs, glitter, whatever, to your Logo-produced images. Or you may want to cut away parts with an Exacto knife . You can photocopy your prints onto different colors and strengths of paper, and you can build cards into the third dimension . But whatever you create, it must reflect the style and flavor of Logobuilt visual models . Exercise 5.16 We have worked wanted only with rectangular to place a motif randomly windows in this chapter . Suppose you into a triangular or circular window . How could you do it ? Exercise 5.17 Suppose you wanted to place a motif randomly into a rectangular window, but suppose, too, that you did not want the motifs to overlap within the window . Any ideas? 233 Chapter5 Exercise 5.18 Are you exhausted by all this ? Or excited, uplifted, depressed, furious ? I think it 's time for you to do some visual modeling of your moods and subjective feelings. Pick an emotion from the list that follows and design a Logo machine to produce images that correspond to your idea of this particular state of being : Love, lust~. greed, enthusiasm, envy, jealousy, happiness, joy, aggressiveness, lethargy, alertness, hunger, guilt, fury, anger, compassion, generosity, arrogance, passivity . In preparation, you may want to jot down the ideas, shapes, colors, textures, and images that come to mind as you freely associate this emotion with the contents of your mind 's baggage. As you think about your selected emotion, try to imagine how you feel about its opposite . Thinking about an opposite or reverse state can often focus your vision of the original state. Let yourself go with this exercise, but be concrete; capture your ideas and feelings graphically . Sketch fast; grab the images as they float by . Don 't worry about how you will explain to others what you have done . Describe simply what you see inside yourself with Logo procedures. Consider the following . Include a two -way switch on your emotion modeling machine . One switch position should direct your machine to illustrate the positive side of an emotion, while the other position will show the negative or reverse side of it . Instead of a switch, you might be happier with a dial that would let you illustrate a series of emotional states between, say, love at one extreme and hate at the other . 234 Chapter 6 Islamic Designs " Know, oh brother . . . that the study of sensible geometry leads to skill in the practical arts, while the study of intelligible geometry leads to skill in the intellectual arts . . . . " From the " Rasa'il," translated by S. H . Nasr . Islamic designs combine circular and rectangular grids In the last two chapters, we have been working on circular and rectangular grids . Within these chapters, the major exercise was to decompose given designs into their basic components so that these parts could be modeled as generally as possible. We then went on to build models to place these parts into forms that were either circular or rectangular . We referred to these two design aspects as the motif and the repetition rule . The goal of this work was to build models that produced not just a single design but a suite of designsall based on one or more themes. The exercises at the ends of these chapters encouraged you to take your design apparatus outdoors, into distant fields, to find and sketch more exotic subjects. Now we turn to Islamic art, an exceptionally rich source of sophisticated geometric designs. We will use a selection of these fascinating patterns to test your modeling style and then to extend it into new dimensions . Indeed, we will end the chapter with three- dimensional designs. Chapter6 Much of combination fact of , these complexity circular into sensed and rectangular are often combinations ordered rectangular rectangular and the . Our job is most useful our is Islamic designs repetitions of multilayered patterns designs modeling in and that to are make tool several recursive in this is turn geometric created by a design motifs . In : circular grids are combined into larger complexity intelligible , . ' The ability rectangular , therefore this end let , a will be using this procedure useful as need another have a first element of the the original list , list , and first list of so element list items on . How original whose of original elements accomplish this as list list they rotation refashion you second could the to might ? You remaining 236 manipulator form , whose a first element think list are : new this to become then , and list was the change third as the output here whose element was of , and FLAG a list the last the is . Suppose element second element kind 's it rather than REPEAT FLAG procedure starting x last list of element of the rotation ; is a keep procedure the of original . Rotate element . Here you was the all possible 5 .2 manipulators We the to general chapter Exercise list really this columns a crucial begin you would of let 's a different . They to methods that , and . asked position Additionally Rotating is ind 's 5 . We as place patterns need it to the first allow will each inden be use Islamic Designs TO ROT : LIST ; OP To put LPUT first FIRST element : LIST of BF a list at the end of the list . : LIST END Note the presence of the command OP. What happens when the argument given to ROT is a single-element list ? When the argument is the empty list ? A generalized rectangular grid machine I think you will understand the following procedures as you read them . I believe, too, that you will find the recursive form of FLAG to be easier to read than the REPEAT fonn introduced in the last chapter. Do you think that " easier to read" is the same as more aesthetic? Here is a summary of the arguments of the revised procedure called RIFLAG in which the RI stands for recursive and indented : : COLS denotes column information and must be a list . Each element of : COLS indicates the number of columns per row . For example, [ 3 2 1 ] indicates that the first row has 3 columns, the second row has 2 columns, and the third row has 1 column. : ROWSis the number of rows . This will normally equal COUNT : COLS. : CDI ST is the distance between columns. : RDIST is the distance between rows . : J. lI denotes indentation characteristics and must be a list . The elements indicate the amount of indentation for each row in relation to the x-position of the left most motif in the first row . Therefore, there is an indentation value for each 237 Chapter 6 row- except thefirst. Positive indentnumbers meanthattheindentation is to theright, andnegative onesindicate leftwardindenting . Forexample , suppose : IN is [20 10 - 10] . Thisindicates thatthesecond rowis indented 20unitsto therightof thestartof thefirstrow, thethirdrowis indented 10unitsto the rightofthefirstrow, andthefourthrow20unitstotheleftof thefirstrow. COUNT : INshould normally beequalto (COUNT :ROWS ) - 1. Why?If we,. wantnoindentation onanyrow, setindentto [0] . Verifythisafteryouhave readthrough theprocedures below . Suppose thatwewanttheoddrowsindented by10andtheevenrowsbyO?Set: I Nto [10 0] . The completed RIFLAG TO RIFLAG : COLS : ROWS: CDIST : RDIST : IN ; Indented FLAG procedure with different ; number of columns per row possible . IF :ROWS< 1 [STOP] ROWER: CDIST (FIRST : COLS) ; Do a row of the IRSTEP : RDIST ; down to ( ROT : COLS ) Move RIFLAG proper column number next row and ( : ROWS - l ) indent : CDIST , if ; ; ROWER IF :N RUN : C < : C ROWER : C 238 1 [ STOP ] : MOTIF CSTEP END :N separated paint a row of : N images distance : C. the between - column To by images ( :N- l ) necessary : RDIST END TO of . : IN ( ROT . : IN ) IslamicDesigns TO PU IRSTEP : R SETX ; Move back , ; point RT 180 FD : R : IN ( FIRST LT to then : POINT ) + x - position move (ITEM 1 : IN ) row ' s starting of the first the over indent amount for the Chapter 5 . next row . 180 PO END TO CSTEP ; This PO RT FD : C LT 90 : C is the same as used for FLAG in 90 PD END TO GO. PT PO SETXY (FIRST : POINT) END (LAST : POINT) Do you understand why ROT and EVAL were used in the RIFLAG procedures ? Why must GO. PT be executed before RIFLAG? Some RIFLAG examples The following examples used the motif list MAKE " MOTIF [ CNGON4 20 ] . GO. PT RIFLAG [ 4 3 2 1] 4 50 50 [ 0] 00 0 0 00 0 00 0 239 Chapter6 GO. PT RIFLAG [ 4 321 ] 4 50 50 [ 25 50 75] 00 0 0 00 0 00 0 GO. PT RIFLAG [ 4 5 4] 3 50 50 [- 25 0] 0 000 00000 0 <>0 <> Starting work on tile design Exercise 5.11 asked you to find an Islamic tile design that appealed to you and to design a suite of Logo procedures that produced designs in the style of the design you selected. Your procedures were supposed to be general enough to produce a series of designs, all based on a single theme. Let me illustrate the approach I would like to see you take by giving you an account of my first Islamic tile exercise. Here is a design that struck my fancy . I saw it in the classic Logo book, Turtle Geometry, by Abelson and diSessa. I photocopied the image and pinned it over my desk. 240 Islamic Designs Finding the minimal design elements The dotted lines enclosewhat I consideredto be the basic design elementof the tile pattern: a hexagonon which six V-shapedarms are stuck. I reckonedthat if I could write a procedure to draw this basicfigure, I could put it into a : MOTIF list and then use RIFLAG to make a tidy grid of it . The finished rectangular design clearly needs indented rows, so the indenting amounts will have to be calculated. 241 Chapter6 The next two sketches show the necessary geometry and trigonometry to design the procedures that will draw the figure inside those dotted lines . ~ oo - . . . -1') co~~o i ~I :r A ~ Putting the geometry together I have defined two characteristics of the basic design, and these characteristics became the two arguments of my procedure . They are : R, the radius of the hexagon, and : I, one of the dimensions of the V-shaped arms design. The main procedure is PIP . It uses two subsidiary procedures, BARS and ARMS . Can you " read " them ? 242 IslamicDesigns TO PIP : R : I CNGON6 : R BARS : R : I END TO BARS :R : 1 REPEAT6 [ (ARMS : R : I 1) (ARMS : R : I END TO ARMS ; :F controls :R ; If : F ; If :F = - 1, = : I : F 1, the the RECORD . POS PO FD : I LT ( 30 * : F ) FD ( : R - : I ) * COS RT ( 30 * : F ) RESTORE orientation arms the arms are are of drawn drawn the - 1) RT 60] arms leftward rightward . . . PD FD 30 : I . POS END Here is PIP 60 20 : Putting PIP into a rectangular grid Before wecanmakea rectangular gridof PIP, weneedto knowthebetween -row andbetween -columnamounts . Thefollowingdiagramsuggests howto calculate : CDIST , : RDIST , andtherowindentamounts needed torunRIFLAG . Doyousee thatthedottedtriangleis an equilateral triangle ? Theedgesareall equal , and theinternalanglesareeach60degrees . 243 Chapter 6 ~+T. ~ Here is a demonstration procedure ; use NEST . DEMO to watch the effect changes in : Rand : I have on the final design. TO NEST . DEMO : R : I : COLS ( LOCAL " EDGE " VERT ) MAKE " EDGE ( 2 * ( : R + : I ) * SIN ; : EDGE MAKE ; the " VERT : VERT MAKE is is between : EDGE the " MOTIF * COS distance . 30 between [ PIP 60 ) - column - row :R distance . : EDGE : VERT : I ] GO . PT RIFLAG : COLS ; how Note the ( COUNT indent : COLS ) list is assembled ( LIST ( - 1 * : EDGE / 2 ) 0) . END A suiteof designs based uponasingletiletheme On thefollowingfour pagesaresomeexperimental resultsfromNEST . DEMO . Eachdiagramhasa differentselection of : I and: R values . Thesmallerfigure is drawnwithPIP : I : R, andthelargerfigurewithNEST . DEMO:I : R. Theactual: I and: R valuesusedfor eachdiagramarenoted.Couldyou haveguessed thesenumbers ?Experiment withsomeothervalues , includingsome negative ones , andthengetonwithyourowndesignseries . 244 IslamicDesigns NEST . DEMOdesigns #1 PIP 36 12 PIP 10 30 245 Chapter 6 NEST . DEMOdesigns #2 PIP 30 15 PIP 25 20 246 Islamic Designs NEST . DEMOdesigns #3 \b/j(\\ ~ PIP 30 5 PIP 20 30 ~ u ;~;><~~ u ~ ~ u~ ~o~ M yy ~ M~~:~~~M~ 247 Chapter 6 NEST . DEMOdesigns #4 Can you guess the arguments used for these two designs? 248 Islamic Designs Another tile design exercise Let 's go through another example of dividing an Islamic tile design into its component parts and writing Logo procedures to draw them . Because your visual sense is far more developed now than it was when we started this game, you should be able to decompose designs very quickly Look now , at the isn ' t design it is edge the elements hexagon basic are has of the next page ; can you say Like many " quickly how to do it # ? It ' s easy ? What basic on and naturally . Test yourself . an the design based odd hexagon element on feature ? hexagons : . American Why do Indian other you Islamic think teepee this shapes designs is are so ? , Here placed the the on each . * How outline of can we the teepee draw this is an figure equilateral ? First triangle , let ' s with handle the a triangular teepee shape bite out . of The one side. Equilateral triangles keep popping up . In fact, the entire teepee shape can be neatly subdivided into tiny equilateral triangles . Let's call the edge length of these tiny equilateral triangles a. That means that the edge of the teepee shape will be 3a. 249 Chapter 6 Islamic tile design #14 250 IslamicDesigns Drawing the teepee shape tQ 0 0 -rt 1 '~tQ 1 -' ~ rt (l. . . 0. . . . ' . . . 0.. 0... rh1 -10 ;-.l3 jh1t i h1t i 01 3 01 3 !~ \)...~0 '\..~0 IN -'N O * JI I I ..~ l .1) Q. . . ( I) \ . ~ RT~ The following MAKEstatement creates a variable called : TP and makes its value equal to a list that includes all the Logo needed to draw the teepee shape. : TP is just another motif list . The shape will be drawn, starting from the turtle 's start position, as shown above, and ending in the same place. So, yes, : TP is a state-transparent list . MAKE " TP . , FD :A LT 60 FD :A LT 120 FD 3* :A LT 120 FD :A] reach point (1 ) reach (2) reach (3) Before you try to RUNthis list, use MAKEto give : A some value. For example, try : MAKE " A 20 RUN : TP MAKE " A 50 RUN : TP 251 Chapter 6 Did you make any mistakes when you typed the value for : TP? If so, you can edit_what you typed instead of starting allover again . Consult your Logo language manual for the commands to edit names. Editing names is similar to editing procedures. Now let 's put the teepee shape on the edges of a hexagon . Look at the following procedure . TPGONis a very simplified CNGON ; it only draws six-sided polygons . It is easy to see that the edge of a hexagon is equal to its radius because hexagons are made from six equilateral triangles . TO TPGON:RAD PU FD : RAD PD RT 120 REPEAT6 [FD : RAD RT 60] LT 120 PU BK : RAD END How can we modify this procedure so that those teepee shapes are placed on the edges of the hexagon? We could express this another way . Remember, back in Chapter 3, when we spoke about changing the quality of the edgesof polygons ? There we changed the straight line quality of a polygon 's edge into a kinked star edge. Later in the chapter, we installed a fractal edge. Now we want to change the straight line quality of hexagon edges into " teepee edge quality ." 252 Islamic Designs Here it is: TO TPGON: RAD PU FD : RAD PD RT 120 LOCAL "A MAKEitA : RAD/ 2 REPEAT6 [RUN : TP FD : RAD RT 60] LT 120 PU BK : RAD PD END And here is an example of its visual output : * What next? We can put TPGONinto an RIFLAG. TPGONgoes into the : MOTIF list, but then we must calculate the values for the : RDIST, : CDIST, and : IN arguments . What we want to end up drawing is shown at the top of the next page. But before we discuss how to carry out these calculations, let 's summarize what we have done so far . After we summarize, we will sermonize, offering a few rules on breaking down designs into their basic components . We might be able to apply these rules to other Islamic designs. In preparation for all this, go back and look again at the teepee grid . 253 Chapter6 Breaking down complex designs When you first looked at this design, it probably looked complex ; the basic design elements were not initially obvious . But a closer look uncovered the basic component : six teepee shapes placed on the edges of a hexagon . Deeper inspection showed that both the hexagon and the teepee shapes could be broken down into small equilateral triangles . The edge dimension of these small triangles conveniently became the basic dimension of the entire design, and we labeled this edge length : A. We defined the teepee shape with a Logo list ; this list was incorporated into a procedure that drew a hexagonal composite, or swirl, of teepee shapes; 254 Islamic Designs and finally, we wanted to make the name of this swirl -drawing procedure the value of the variable : MOTIF . We also planned to use RIFLAG to draw teepee swirl grids . A small review and a few lessons Note the style problem was with do individual the of Logo - now represents - we a pieces usefulness we smaller or Logo in that into procedure commands method solving down Logo something drawing the a the Note problem broken either putting to of the Logo the all list . The the the features . final A complex Each design visual was was structured constructed by . of method . elements together drawing give above design concept like followed naming shape a short of in all of a name the method this . teepee Once we using , like a : but know TP is . how list of The short Logo name and of tidy . Once we name a method, we can forget how its inner mechanism operates. We can concentrate our energies on the next problem . Now for the rules for finding the smallest design elements of a complex figure . Keep your eye open for simple polygonal structures . Triangles / hexagons and squares/ octagons are ubiquitous because they fit, or " tile," together so well . Look carefully, though . You may not see the basic polygons because their edge " qualities " have been altered . Finally, let 's work out the necessary row and column dimensions of these teepee swirl grids . The three diagrams on the following page illustrate the calculations needed. We are again manipulating the elements of equilateral triangles . Do you see that the edge of the large equilateral triangles linking the centers of the teepee swirls equals six small equilateral triangle edges? We called the edge of the small equilateral triangle : A. Recall that the height of any equilateral triangle is equal to either : EDGE* SIN 60 or : EDGE* cas 30. Why are these two forms equivalent ? 255 Chapter6 Grid placement calculations for teepee swirls \0 E -.~-\. ~/j~ 256 Islam]c Designs Let 's use this geometry to write a demonstration procedure that will fit the teepee figures together . This routine should work for any size teepees . TO TP . DEMO : SIZE . , . , : COLS : SIZE is the radius of the hexagon on which the teepees will be placed . Remember that : A is : SIZE / 2 . : COLS must be a list whose elements define the columns per row . (LOCAL " EDGE " VERT) MAKE " EDGE 6* : SIZE / 2 ; : EDGE is the between - column distance MAKE " VERT : EDGE* COS 30 ; : VERT is the between - row distance . . MAKE " MOTIF [ LT 30 TPGON : SIZE RT 30 ] GO. PT RIFLAG : COLS (COUNT : COLS) : EDGE : VERT (LIST ; Note how the indent list is assembled . END (- 1 * : EDGE/ 2 ) 0 ) Compare TP . DEMO with NEST . DEMO. Why are they so alike ? Because both demonstration procedures place design elements at the vertices of equilateral triangles . TP . DEMO can produce designs similar to those on the next page . TP . DEMOis generalized only in terms of the size of the design, the number of rows, and the number of columns per row . That 's not as interesting beginning as the designs shown at the of the chapter, is it ? How could TP . DEMObe further generalized, more in the spirit of the NEST . DEMO designs shown earlier ? A star and saw blade design Let's try your eye on Islamic Tile Design #4 from Exercise 5.11. Note several things . First, note where the turtle starts drawing the saw blade . This is not arbitrary . The turtle begins at the vertex in the saw blade that will touch each of the vertices of the underlying hexagon. (Go back and look at the STARGON discussion in Chapter 4 where we talked about polygon edge qualities and the rules that govern the replacement of one kind of edge with another .) Look at the 257 Chapter 6 Teepee swirl grids 258 Islamic Designs sketch below . The dotted figure is this underlying hexagon . Remember that all hexagons are composed of little triangles . Let 's have the turtle go to each of the hexagon vertices in turn ; we can use a CNGON 6 : RAD to do that . Therefore, the starting place in the saw blade list must correspond to where the saw blade figure touches the vertices of the small, dotted b.exagon . MAKE" SAW [REPEAT3 [REPEAT3 [FD :A LT 60] LT 60 FD :A RT 120 FD :A RT 60 FD 2* :A 60] ] LT The second thing to note about the list : SAWis that it is state transparent . Why is this necessary? Finally, note the uses made of the nested REPEAT commands within the list . The saw blade figure is actually a composite of a simpler form that is repeated three times. Do you see this hook form ? You might test yourself by writing your own alternative list structure for the saw blade figure . Start your list at a different point or draw the figure in a clockwise rather than a counterclockwise direction . Remember, though, that the start of the : SAW list must correspond to the hexagon drawing procedure . Remember that the : SAWshape is being placed on the edge of a hexagon. 259 Chapter 6 Putting the saw blade into a hexagon swirl The following procedure, SAWGON , is similar to TIPGON from Chapter 4. Rather than retracing the shape of the underlying hexagon, placing the sawblades on each edge (which is what TPGONdid ), SAWGONbegins at the hexagon's center and moves out to each vertex in turn . Once there it runs the SAWlist and then returns to the center. It then turns to face the next vertex and moves out to it . This is repeated six times. TO SAWGON: A To place six sawblades on the edges of a hexagon . Note that the turtle must turn right 60 degrees before RUNning the list : SAW. After RUNning : SAW the turtle turns left 60 degrees . The radius of the underlying hexagon is : A . Why? REPEAT 6 [ PU FD : A PD RT 60 RUN : SAW LT 60 PU BK : A RT 60 ] . , . , . , . , . , PD END Putting SAWGONinto RIFLAG We must now calculate the distance between rows and columns of these SAWGONs so that they will fit neatly together . We want the hooks of the design to close properly - one hook just inside another . The design will have indented rows, so this amount must also be calculated. Look at the design on the next page and compare it with the previous teepee grid calculations . We are again faced with large and small equilateral triangles . The SAWGONswirls are centered on the vertices of equilateral triangles . This geometry has been incorporated in the demonstration procedure SAW. DEMO . It is just like NEST. DEMOand TP. DEMO . 260 Islamic Designs TO SAW . DEMO : SIZE : COLS ; : SIZE is the dimension of the small ; equilateral triangle a. ( LOCAL " EDGE " VERT ) MAKE " EDGE 5 * : SIZE ; : EDGE is the between - column distance MAKE " VERT : EDGE * COS 30 . ; : VERT is the between - row distance . MAKE " MOTIF [ LT 30 SAWGON : SIZE RT 30 ] ; Why the 30 degrees GO . PT RIFLAG : COLS ( COUNT ; Note how the indent END tilting : COLS ) list of SAWGON? : EDGE : VERT { LIST is assembled . ( - I * : EDGE / 2 ) 0) 261 Chapter 6 Composite designs that hook nicely together 262 Islamic Designs Simplifying the SAWGONswirl You may have noticed that we should modify the SAWGON procedure since it draws too many SAWshapes . Several SAWsare repeated, one on top of another . In fact, SAWGON needs to draw only two saw blades rather than six for the composite design to mesh . The two diagrams below should convince you . * 263 Chapter6 Overlapping designs Go back and look at Islamic tile designs 11-13 at the end of Chapter 5. Notice that these designs look as if they were woven from a pliable material . Part of the design passes behind other parts, and this woven quality seems to follow consistent design rules . Can we simulate these designs with the techniques some we have To actually developed start look interlocking so your at circle far ? thinking , make interlocking , triangle , and some sketches polygon rings square rings of . a few Here interlocking are a few rings . Let ' s sketches of : Suppose we want to draw these designs using Logo. Is it possible to break the design down into smaller component parts that can be defined by lists or small procedures? Are these basic design elements placed around some invisible shape- as the teepeesand saw blades were placed around an invisible hexagon? Perhaps the following exercise will give you some ideas. 264 Islamic Designs A grid of interlocking square rings Look closely at the grid below . Would the component design elements be different if the grid had only a single row ? Why ? 265 Chapter6 An animated assembly of square rings into a grid Now look hard at the following . ~ 266 Islamic Designs The basic design components The following two diagrams illustrate what we want . The first shows the basic element and the second shows the element placed around a square. * * 267 Chapter6 Overlapping square rings calculations The characteristics the radius that will be needed to draw the basic design element are : of the square rings, the thickness of the rings, and the distance between the rows and columns of these rings in a final ring grid . Let 's start with equal row and column distances . The following modeling be happier diagrams illustrate one way of this ring problem . It isn 't the only way of doing it . Perhaps you would with another method . That 's OK . As long as you create " ringy " shapes . Build a model of these shapes in a manner that is most natural to you . r- ()~ ~ \ "<> t >IST - " 2. , ~IiJ 4 $0 = .je ..E:"""t- ~1S -s.o - rc~ - E1 - ~!:.oJE ~ - ::., &~ ' C'\)&"f, (:~6) ':: ~ 'DIJ~ I ~"J 4-So L.\"rTL-t;- e.v~ C: LE .) ': l ~~PIl.\~ - 't>'ST12' ) J<;,-J 4-C.o '.\' H =. -rHit ~,JE ,S~ 268 Islamic Designs Overlapping square rings procedures The procedures below individual square an component . You should element TO . , follow the , and RINGS the similarity see around a square WING : BE State - transparent : LE used by diagrams on places the this between , while TPGON previous page component RINGS places an . WING around and TPGON element around radius of draws an the invisible . RINGS places a hexagon . : TH element that is . , RINGS procedure RT 135 FD ( : BE - : LE ) FD ( : BE - : LE - : TH ) RT FD ( : LE - 2 * : TH ) RT 90 LT 45 FD 90 . FD It RT : TH RT 90 90 90 FD : TH ( : LE - : TH ) END TO RINGS : RAD ; Interlocking ; : TH ; horizontal ; centers ( LOCAL : TH : DIST square the thickness and of " BE square rings of vertical rings . the : RAD rings is , distance in a and : DIST between grid squares , the the . " LE ) : RAD/ (SIN 45). . MAKE" LE ( : RAD- ( : DIST/ 2) ) / (SIN 45) REPEAT4 [PU FD : RAD PD WING :BE : LE : TH PU BK : RAD RT 90] PD END MAKE " BE TO RING . DEMO :RAD : TH : DIST :COLS MAKE " MOTIF [RINGS :RAD : TH : DIST] GO. PT RIFLAG : COLS (COUNT: COLS ) :DIST : DIST ( [ 0] ) END 269 Chapter6 An alternative structuring of WING and RINGS You probably compared latter elements were You will Logo . Below some time find one MAKE TO come to think " WING RINGS design designed to realize is the more the list lists alternative the to the procedures on the previous between the two approaches [ RT 135 - FD ( : BE - : LE ) FD ( : BE - : LE - : TH ) RT ( : LE - 2 * : TH ) 90 LT 45 ] : RAD : TH ; Interlocking ; ; : TH the horizontal thickness and ; centers of 90 RT : TH 90 90 interchangeable RT 90 . Do - : TH - - : DIST rings . the rings distance of vertical rings in : RAD a , grid radius of and : DIST between is the the squares . (LOCAL " BE " LE) MAKE" BE :RAD/ (SIN 45). . MAKE" LE ( :RAD- ( : DIST/ 2 / (SIN 45) REPEAT4 [PO FD : RAD PD RUN :WING PO BK : RAD RT 90] END . The procedureRING. DEMO is the same for both of the approaches 270 page . Take - FD . in ? FD LT ( : LE - : TH ) square square ? Why two as a procedure often other RT is structured TP . The are than FD SAW and procedures differences the WING with and aesthetic FD WING as lists, while that about element , you IslamicDesigns Three ring grids of differenIt thicknesses, with all other characteristicsfixed 271 Chapter6 Three ring grids with different separations, with all other characteristics fixed 272 Islamic Designs Three ring grids with II extreme value " arguments 273 Chapter 6 Exercises Exercise 6.1 The TP and saw you design a single You would have equilateral blade designs Logo to triangles were procedure draw of alternative in a grid by produce either design also Start that in a basic , your together equilateral characteristics characteristics nicely of tiny find these a series composed procedures designs , equilateral triangles . Print paper may to consider blowing photocopy a sheet over paper , structuring designs into Carry the the polygons Exercise 6 .2 recently by the Dover design 274 with in ? Can words components you we the . And of values of they could fitting based on triangles and all a large rectangular grid of small a good grade grid up onto your triangle of translucent out experiment Daniel images designs placement changing design ? new - grid image tracing tile designs triangle properties with other shapes Dye 's book heavy with an paper and the translucent on tiny of , place . Translate your that tile together . Lattice Designs , ; I offer you do ? you tile . Trace same here . Can several either designs . several produce this a pad grid discovered republished to draw . Find triangular out Which I machine procedures , by the . Can . interlocking enlarging draw , all of these describe . Then could a procedure want that element designing . You could triangles Sheets 1974 . This use the book design procedures shown have studied with in feeling between the difference 1200 methods that of the designs has are generalized lattice Islamic Chinese illustrations of this ? See if you the , chapter enough can combine designs designs to analyze so that some only these they can of the Islamic below . Can you and those shown express in below ? IslamicDesigns Lattices for Exercise 6.2 DDDDDDDDD DD DD DD DDDDDDDDD D8D ~ D8D ~ D8D ~ DDD DDD DDD~ ~ ~ ~ ~ [ffi DDD DDD DDD D8D ~ D8D ~ DBD ~ DDDDDDDDD 8 ~ 8 ~ 8CUJ DDDDDDDDD ~ DBD ~ DBD ~ DBD 275 Chapter6 More lattices for Exercise 6.2 O~ OOODOOOOOOOOO B Qon L - nOQQ U~ o O[=== ~U - 01 I1 01 ~ I I 10 10 01 I 01 1 ~ 01 01 I 1 ooDu uD ~ = JD O[:= =~JC=: ~ 0D c::=J0d c::=J00 DO [O~ :=[~~ :] 01 ------1[4~ :=] 0 ~~~~~:JL-~ O[~=~=~] D0d c:::::::J0D D c::] CJoD c::::::Jo d c::::::J0D DO [~~~~:=] 01 ------1[4==] 0 01 276 ~ D ID n[=::===~ O DODDODDDDDDDDc ~ ~ 10 ~ I O~ n ~DoD ~ 10 I 1 I =~~ II 101 I CJDDCJDDCJDDD DD DD DD Do oDD ODD DD DbJDDbJDDbJDD 0000000000 0000000000 DDDDDDDDDDDDD DD DD DD Do ODD ODD DD DDDDDDDDDD DCJ DCJ DCJ IslamicDesigns Exercise 6.3 Every city has oriental rug merchants. Visit one of these vendors, but remember to take your sketchbook along with you . Record several rug designs that strike your fancy. Explore these designs with a suite of Logo procedures. Hand color the results and place them in your notebook. Exercise 6.4 Mostlargecities , anywhere in theworld, nowhaveat leastonemosque thatcan bevisitedby non-Moslems . Visita localmosque , takingalongyoursketchbook , andrecordseveral motifsthatstrikeyourfancy.Later,overa glassof minttea, exploreyoursketches with Logoprocedures . Handcoloryourresultsandplace themin yournotebook . Exercise 6.5 Go Work back on To design and look one of encourage # 12 of at these the or you Chapter overlapping on a design , I have 5 ) done tile designs at the end of Chapter 5. Islamic of your included by own here a French . an overlapping architectural design ( inspired student at by Parsons School of Design in Paris. It is the most elegant Islamic design done in Logo I haveseen. The studentnevershowedme his procedures; he wanted to keepthem "secret." He did show me a few illustrations of the componentparts he isolated in his design. I have also included his visual investigation of the effect of varying the width of thesebasic design elements. 277 C) V CD0) E CD Cl ) CDC Cl) CDo . IslamicDesigns Component parts of the student design ~ == ~I' ,~'--= =:=~ " /~:= "" ~ - // // ~ // // "" /.\;'l---'" ,.-~'.\.cl ,.",./'.~ "'~ ) ---:. . . : = 0 . . ; = : ~ '~"" \-,.;//,- '" ~ . ~(--=~.). /~~::~~ Jl . / ~ ' A _~\. LJ7~ 279 Chapter 6 Visual exploration 280 of different design element thicknesses Islamic Designs Exercise 6.6 Celtic art used overlapping patterns extensively. Th~ forms are based, obviously,on the directobservation of knottedropeand othermaterials . Try the empiricalapproach . Getsomerope or heavytwine and tie a few knots. Sketch what you seeand try to reproducethe resultswith Logoprocedures . I include someCelticexamplesto get you started. This illustration is takenfrom Celtic Art: themethods of construction by GeorgeBain(Dover, 1973 ). 281 Chapter6 Exercise 6.7 One could characterize most of the work illustrated in this book so far as totally geometric . Some of you might go so far as to claim that these designs- although visually surprising and intellectually interesting - are excessively geometric, that they lack " life " and have no organic qualities . You might be ready to ask whether the shape notation capability of Logo can produce designs that share visual characteristics with pieces of the living world . Chapter 7 will argue that this question can be answered "yes." This exercise introduces a tree-drawing problem that will be developed at length in the next chapter. I want you to think about it on your own, though, before you see my presentation; so don 't read ahead into the next chapter. A recursive definition : atreeisabranch attached - ~~~to ~- a ~tree ~--Branching is not the only characteristic others, and we will eventually that make trees trees ; there are many investigate some of them . But branching is perhaps the most noticeable feature of trees . Look at the sketches on the next page, taken from a nature guide book . 282 IslamicDesigns " ., Goat " 'illo'" Ilornhcam ScssilcOak Pcduncul31C 03k Ah, the branchy of trees . So let 's start with Logo procedures that draw trees . Here be tried branchiness . - . -_.)':ngli,;h 1.:1111 is a simple , but let 's start geometric with branch . A more complex simple one . the first branching pattern could , (\\'',.,\''\". T4 Let's start building a tree according to the recursive definition . Draw a branch and attach additional branches to it . Make each successive branch a bit smaller than the branch to which it is attached . We can describe these attachments in terms of recursion level : 283 Chapter 6 ~ )- y }-- -< L ( \l'E: L I t : """" LCI/E ::L 3 These diagrams don't look very much like real trees yet . But remember- we are only trying to produce designs that share some visual characteristics with real trees; and we are starting with a single characteristic : "branchiness ." Moreover, we have simplified branching into a geometric "Y " shape. We will come closer to producing realistic trees as we add more real tree characteristics. Be patient . Your exercise is to design a recursive Logo procedure that will draw these Ybranching trees. The basic procedure, BRANCH, will draw a single branch . You may not be surprised to hear that BRANCHmust be state transparent . You will be asked to explain why this is so at the end of this exercise. Be warned . Here is the BRANCHprocedure : the two arguments are as indicated in figure 1 above. Notice that state transparency is accomplished by moving the turtle back to its starting point with turtle movement commands. Using RECORD. pS and RESTORE. pS in this situation will be discussed in the next chapter. TO BRANCH :A : T a state ,. Draw transparent FD : A RT : T FD : A BK : A LT 2 * : T FD : A BK : A RT : T BK : A END 284 branch . Islamic Designs Yourwork Expand BRANCH into a recursive procedure that can draw the Y-shaped trees sketched in figure 2. Allow for an argument that scales succeeding branch size and another that controls the levels of branch attachments, that is, the level or depth of recursion . Hint : find the places within the BRANCHprocedure where you would like an additional BRANCHcreated. Finally, why must state transparency be respected in this tree drawing design? Be specific. 285 Chapter7 OrganicDesigns " Painting is a science and should be pursued as an inquiry into the laws of nature. Why, then, may not landscape painting be considered as a branch of natural philosophy, of which pictures are but the experiments?" John Constable Tree experiments I will use Constable 's words to state this chapter 's goal . He suggested that making pictures of our natural environment is an effective way to to see it more clearly . Although I would substitute the term visual modeling for Constable's landscape painting, I seek the same end and suggest similar means: visual experimentation with segments of our personal world can school our eyes the better to enjoy the richness of the larger world . In this chapter I will offer you an essay on several characteristics of trees: first, their "branchiness," and second, their quality of randomness -within -astructure . The illustrations should suggest other tree signatures to model . The exercises at the end of the chapter will ask you to justify the title of this chapter by looking at some nontree plants and beasts. As you read through this chapter, please remember that I am showing you my experiments with trees; this is the way I did it . Why trees? Every Logo book has at least one recursive tree design, but few books play with the visual idea of OrganicDesigns recursive trees . I hope my exercises illustrate the visual implications how tiny tree machines can explore of such an idea . Simple recursive trees Exercise 6.7 introduced you to the idea of drawing simple trees composed of Yshaped branches . Let 's complete that exercise so that we can get on with drawing more realistic trees and other landscape designs. Review the BRANCH procedure introduced at the end of Chapter 6. The following procedure follows that discussion but adds an additional argument, : B. The diagram shows how : B, the branch length, relates to : A, the trunk length . Why might it be useful to have two length arguments, : A and : B, rather than just : A? TO BRANCH : A : B : T To draw a state - transparent FD :A RT : T FD : B BK : B LT 2* : T FD : B BK : B RT : T BK : A . , To Y shape . A END BRANCHis reproduced again below with the symbol (* * * ) inserted to indi cate the places in the procedure where the turtle arrives at the tip of a branch. BK ~ 287 Chapter7 These are the two turtle positions where we would like to place another branch . This is, therefore, the position to insert some recursion apparatus . Remember that recursion only means that a procedure uses itself in its own definition . In other words, a recursive procedure asks that it be run again. You might want to refer back to the recursion diagrams of previous chapters . Once we have made BRANCH recursive, we will want to stop the recursion at an appropriate level . We can do this by adding an argument to control the depth of recursion . Because we may also want the branches to decrease, or increase, with the level of recursion, we will need another argument to scale the : A and : B arguments as they are passed from one level of recursion to another . To keep the names short, call the level argument :L and the scale factor argument : F. You should find the following procedure easily understandable in terms of Logo syntax . But you may not be able to guess exactly how Logo will draw the shape on the screen until you do some experimenting . Since we are making .:?imple ~ s from individual branches, let's rename our procedure S. TREE. Here it is: TO S. TREE :A :B :T : F : L ; To draw a simple, recursive Y- branched tree . IF : L < 1 [STOP] FD :A RT : T FD : B (S.TREE ( :A* : F) ( : B* : F) : T : F ( : L- l ) ) BK : B LT 2* : T FD : B (S.TREE ( : A* : F ) ( : B* : F ) : T :F ( : L- l ) ) BK : B RT : T BK :A END That 's it . But to use it creatively will take some imagination and play . You might even be tempted to look at a few trees before you start your exploration . Two pages of tree experiments follow . My intent was to present a series of designs that folded and unfolded . I began with an unfolded and proceeded toward a more folded -up one, a cypruslike designs with the folding / unfolding 288 design, a Mondrian -ish tree, RECGONsof Chapter 3. tree . Compare these OrganicDesigns Simple tree experiments ~. .). " ~ .,.- 't - . . . ~ ...- 't - - 289 Chapter 7 More simple tree experiments 290 Organic Designs State transparency Let ' s be respected and go back to in down turtle . with this fast more STEP current , of of the very transparency from marks in needed . any sense Multiply our Can , - is needed does defined ? ? draw a we saw is sketch of it a ? not the familiar print many use one the during . recursion . Gothic stone state State Recall mason transparency was grids we are term what does the good place to making the design affair design the or out of NGON that Would at transparency because And Here are of ? rectangular again follow in with within here speed you centered to shapes that the dealing , for state began 5 the to useful , exercises the lets procedure procedure this book we If command you lag introduced Chapter list time lag been this . come a sketch . drawing trees really to mean ? grips of with a concept trees forking the in a accomplish We If up answer This control . climbs ? two multiply the Later you trees producing and transparency branched far . why . when why and concept make defines in transparency state far . you insert time L an it . to has exercises placed But : first and as with dialects this printing so , transparency turtle command time is state you manual want explored must the Logo down Would 3 a some transparency 4 . TREE reintroduced we recursively this . Chapter State . " Why STEP Logo might Chapter when Why You at your have was RECGON . state we in : Watching the line . 7 supply using in S level that down it " should one slow 6 ? trees TRACE it idea exercises So to recursion it review inside The slow called command way your procedure is places one , Exercise procedure of a Another of drawing branches through stepping question tree too step last the the moves you the have had new simple branches one number a ? of To branches . do so Y Why , - shaped not let leaving ' s pattern expand add to a fork ; this S . TREE each single an branch forking additional forked design argument once , into a that . 291 Chapter7 Call this extended procedure M. TREE, for .m ..ultiply branching ~ . Its additional tree characteristic, the number of branches from a fork, will make M. TREE more general than S . TREE. M. TREE will be able to draw everything that S . TREE could draw, and more . Perhaps, too, M. TREE will create designs that look more like real trees. Let's call the new argument : N; it will specify the kind of forking to be used within a tree drawing . Specifically, : N defines the number of branches that leave the fork . Let's redefine the argument : T as the .tilt angle that the first of these branches makes with the vertical . The new argument, : BT, will be the tilt angle Qetween branches. The following diagram illustrates these new arguments: ~ iO ". : : " ~T Unfortunately this new procedure will have sevenarguments . You will need to be organized to experiment with different combinations of these arguments . You might want to design an EXPLORE-type procedure to run your experiments and place multiple trees on a single screen. (Look back at Chapters 3 and 4 if you have forgotten this powerful idea.) TO M. TREE :A : B : N : T : BT : F : L ; To draw multiply branched recursive trees . IF : L < 1 [ STOP] FD :A RT : T REPEAT : N [ FD : B M. TREE ( :A* : F) ( : B* : F) : N : T : BT : F ( : L- l ) BK : B LT : BT] RT ( : N* : BT) - : T BK :A END 292 Organic Designs A few examples of multiply branched trees 293 Chapter7 Placing fruit at the branch tips Suppose we drawn by want to put M . TREE . Lacking procedures , texture TEXTURE and dependent texture then change upon machine - setters . Here 's small colored color shapes , I will . ON and it back to nontextured and Logo dialect a TEXTURE little fruit ( fruit need a . OFF , that ?) machine the textured set black , you at tips the I ' ll invent fruit . pen color the . Because will of have to figures to two a pen textures write your fruity are own : TO FRUIT : SIZE TEXTURE . ON REPEAT6 [FD : SIZE BK : SIZE RT 60] TEXTURE . OFF END Where should we turtle reach the tips Where does the turtle turtle decide that it located in first line TO the M . TREE : A insert of this the branches decide has not recursed of : B fruit : N machine ? to draw enough M . TREE and : T : F : BT Another is more into M . TREE way to ask branches ? You should marked with ? ? find the Where this : When this spot is : does easily symbol To IF draw multiply :L < 1 branched . : L [ ( * * * ) STOP recursive trees . ] . END The expanded procedure is a multiply TO ; MF . TREE : A To multiply draw IF : L < FD :A RT REPEAT 1 :N : D [ FRUIT : T : BT : F : L branched recursive : D STOP] ~ . : N trees with : T [ FD MF :A/ 2 . TREE BK RT ( : N * : BT ) - : T BK : A END 294 branched, fruiting :A/ 2 ( :A* :F) : D : N : T LT : BT] : BT : F ( : L- l ) fruit the ; it . , the question Or ( * * * ) does . is OrganicDesigns Notice a few of the changes. First, I have removed : B, the second branch size argument, and replaced it- within the procedure - with : A/ 2. I found that I really didn 't need : B. Second, I have introduced a new argument, : D, the size of the asterisk -shaped fruit . Different fruit shapes We can change the fruit shapes placed at the tree tips by altering the FRUI T procedure . But in fact, we can be more elegant than this . Recall our work with rectangular grids in Chapter 5. We broke grids down into two elements: an underlying placement mechanism that structures a grid, and the image motif to be placed within this grid . We defined the image with a list . We could consider the current exercise to be tree grids . The M. TREE procedure is the underlying placement mechanism, and FRUIT is the image to be placed by it . This suggests the following restructuring of MF. TREE. : FRUIT is now an argument that must be a state-transparent image list . TO FRUIT . , ; . LIST To draw defined IF :L ; Note FD :A REPEAT < . TREE multiply by a list 1 [ RUN the RT :N :A : FRUIT change : FRUIT branched , placed here : N : T : BT : F : L recursive trees with at the branch tips . : FRUIT, STOP ] . : T [ FD :A/ 2 FRUIT. LIST . TREE ( : A* : F) : FRUIT :N : T :BT : F ( : L- l ) BK :A/ 2 LT :BT] RT ( : N* : BT) - : T BK :A END 295 Chapter7 A few asterisk -fruit trees 296 OrganicDesigns More asterisk -fruit trees - - " " " - " " " " " " " - - - 297 - (t) ~ ~ ~ ..... ~ . -< (t ) ~ 2 ~ . ..... (/) <: , - - ~ I (... -.L. Chapter 7 > . . . . . '" (0 (0 (") ...... ........ ..... ro - C /) ~ ~ ~ ~ ~ (") 2" ~ ~ ~ Q. ~ ~. ~ p.. ~ p.. o-J .-to ro '"1 ~ ~ ~ 1 ~ C .... .-to ~::1 ~ ~ ro /) .-to ~ 'ij..... .-to '-< .!J; '-" ....-- Q ~ c. ~ ""' ~ "' ~ ~ '" b g ~ ro ~ ~ 0 O 'Qo :::::. O 'Q 'ij""" p .. :::::. .... ro '"1 g. O 'Q ""' .... 'ij'"1 rox s- C /) ..... ~ p .. ro S ~ ~ ..... '"""' 0 ~ ~ O 'Q .-to ':"': 0 (") 2: .-to ...... ~ ~ ...... ro ...... 0 '"1 H ...... p.. cr .....' .-to ::J"" ~ .... - ~ 0 ~ .-to ro <; ~ p.. ~ ~ ~ ~ ~ ~ ~ @ " ~ S. ~ O C p/).. p .. ~ ~ O 'Q U ) ..... ~ .-to ro .-to tIj ~ <; '"1 ro p.. tIj p.. ro ~ ro :::;: p.. ro 0 ? ~ rn .-to C /) . g. O 'Q ~ . ~ O Q :r: '"1 0 O 'Q > g p.. ~ . ro ro ~ ..... ~ ~ ~ O' .-to '"1 (") .r O 'Q ro ~ .-to ~ "0 ro ~ <; ~ U1 0 ~ - ~ ~ '"1 < ..... ~ ';1'. .-to ~ ~ ro : ro (") ~ .....,. ro ~ .-to ro ro ~. .... ro ~ ~ 'ij .e:: g ~ S ~ p.. '"""' ~ ~ .-to ro '" C /) ..... ::+ ~ C /) ::J"" 10M~ U1 ro ~ . ro ~ ~ ro .-to !1 p.. - ...... ~ p.. ';) ,",,", .-to ;:J ~ C /) "". /) ro ::J"" ro .-to ~ p.. C 1::1 ~ ~ 'ij ~ rn o ~ C ~ ...... .-to 0 ...... /) p.. .-to ~ ro S ~ ...... ~ ~ - ~ p.. ~ 'ij 0 ~ ~ .-to p .. (") ...... ~ 1::1 < ; ~ (") ' 0 ro 0 ~ ~. .... ~ C /) ~ .-to .... "" """ """ cr' ro ur ~ O 'Q ro ro 0 0,-< ...... ro C /) .-to .-to '"1 p.. ~ ~ '-< '"1 ~ H ~ ..... '" 0 ~ .-to ..... ~ ro . 0 ~ O 'Q .-to ::J"" Q .-to p.. ~ .-to 0 ..... ro ro - .-to ro p.. C /) ~ '"1 cr' 1 ro ~ ro IJ ~ ~ 0 0 ~::1 0 1::1 ~ H ro ~ ~ .... 1 ::1 ro ~ ~ '"~"' O .,.,.. p .. ~ '"1 ~ ""' ro .-to 0 ~ p.. ~ :=: S ~. q '"""' ~ ~ 0 ~ ro ro .-to .- ro ~> 0 '"1 '-< ...... ::J"" C /)- V ro ~ ro ..... OJ ::= ro c7 : 0" .-to '"1 '"1 ~ ro ';1 'Q 0'. O 0 ~ S' O 'Q 0 "~ ...... ro ~ C /) ...... 0 0 ~ ~ .-to .-to ::J"" ro 'ij '"1 0 (") ~ ~ '"1 ro ~ ~ .-to 'ij '"1 0 p ~.. (") ro '"~"' .-to ::J"" ro '"""' 0 ...... ...... 0 ~ ..... ~ O 'Q .,.,.. ~ ~ ~ p. S 8~ A cO p) ::J 0. _ 0 CD ~. (Q ::J U > Chapter7 SEE'D IvEA N~ = tJIJ.t"\; EQ . . OF bflA..JC .+-\ 't.S F = ~c A L ffic .~~ L'f:v :: ~~ ~ fL~ 0t0 ..J SEED . , . , To : SL Try SEED IF : LEV FD : SL LT : AA / 2 REPEAT : NB : AA dandelion model < : NB LT :AA/ 2 BK : SL END 605240 : LEV flowers . 6 4. : F [ STOP ] [SEED ( : F* : SL) :NB :AA :F ( : LEV- l ) RT :AA/ :AD] " I liked how the figures produced were not perfectly symmetric . I could have put the following turn command into the REPEAT list structure of SEED: RT : AA/ ( : NB- l ) . But I didn 't like what this produced . I liked my original slightly wonky pattern . /IAfter running SEED with various argument values, I decided to plug two seed designs together. I wrote a little EXPLOREprocedure to do this ./l 300 0 - (0£1) C)ciCD l)C (0 (I) Cl)CD CD Chapter7 Double seeds 302 OrganicDesigns Seeds as tree clusters " I thought I was designing seeds, but I suddenly saw the outlines of a cluster of trees in the first image below . I erased some of the lines to make it look more like several bushy trees growing closely together . I still don 't like the thin trunks, though . I' ll draw in some better ones with India ink ." 303 Chapter7 Introducing random " OK ," I hear life . Real Let more trees are lifelike : T and the trees " these trees are interesting, but they still lack a feeling of not as regular some shapes into into say, 's introduce component angle you components the the ones randomness . How can drawing between as - branch of into we the angle do : A presented these this ? We lengths above .1I designs and see want to introduce , and perhaps if into that produces a random the turning : BT . We might be able to use the procedure RR that was developed in Chapter 5 to generate random grids . Recall that RR takes two arguments, : La and : HI, and outputs a random number that falls in the range defined by these two arguments. TO RR : LO : HI ; To output a random number in the range : LO to : HI . OP : LO + RANDOM(1 + : HI - : LO) END What happens if : La and : HI are not integers ? Try some funny numbers . FD RR ( . 5 * : A ) ( 1 . 5 * : A ) would add some randomness into one of the tree components . The actual branch length drawn would range from .5 to 1.5 times the original value of the argument . Obviously, .5 and 1.5 are arbitrary ; you can experiment with other values when we put everything together . The problem now is how to insert RR into M. TREE. A first guess might be to put RR after every FD, BK, and RT command . Would this be correct ? We can answer this question by posing another : Is the following state transparent ? FD RR 5 10 BK RR 5 10 It certainly isn 't. RR 5 10 will probably give a different value in the two situations . But we must move backward the same amount that we moved 304 Organic Designs forward . Otherwise transparency require FO : 0 BK : 0 the are several " 0 RR MAKE RECORD . POS FD 5 RR don 't get back to the that we always get back to random ways of number doing this be Let ' s use REPEAT where we used for the FD and the FD :A BK , started the BK and state from . We command . 10 back the first method to handle list structure . The RECORD . POS and to the of the branch after all base . RR will be used in conjunction command , and the LT commands within be careful But RESTORE . . POS procedure . Why level of recursion tied to each and global lifetime happy about this are arguments . I have for : D can make by in making your the other movements the FD procedure list S these two : POS .) the have been unique their : B variable . It each unique and . ( Review variables them the for variables gave : T inside variables Local RT . be local handle , the ( created . POS ) must manual that structure within can : A command : PO : D and Logo situations . POS and ? We :A RESTORE REPEAT RESTORE level value exist only . you Are ? , that procedure arguments the by this the with needed is of , again following value variables the Notice The and recursion within the point : completed local starting 10 . POS getting same 5 RESTORE the we demands that There , not needed replaced I have . As , and the removed I the have said I also wanted : B with : AI previously to 2 as I did , cut in I doesn found ' t appear that down on the the MF . TREE in two size number of procedure . 305 Chapter7 Randomized TO trees RAND ; To ; with . : ( : A : N : L < " [ STOP . RR ( RT FD RR F : L recursive . " D ) reasons transparency . 5 * ( : N : A ) . 5 * [ MAKE ( : T 1 : D BK : D LT RR RAND . . 5 ) ( " FD RESTORE : . POS FD REPEAT BT ] POS state RECORD : branched components 1 LOCAL For T multiply randomized IF ; TREE draw * : A ) 1 . 5 * D : RR T ( ) . 5 * : A / 2 ) (1 . 5* : A/ 2 ) - . TREE ( : A * : F ) : N : T : BT : F - ( . 5 * : BT ) ( 1 . 5 * : BT ) ] POS END Again, please notice the use of the LOCAL command in the procedure 's second line . We must have a value for : POS and : D for each level of recursion . These variables will not, typically, be the same for each of the branches that make up the tree. LOCAL tells Logo to keep the variable indicated tied to each level of recursion . There will be a different : POS for each level , and there will be a different : D for each level . Logo then uses the proper value for : POS and : D CD CD cn It H according to the turtle 's recursion status. This application of local variables is extremely important, but not obviously so. How do you feel about it ? Can you set up an experiment to test out the logic of its use? You might want to run RAND. TREE with line two removed (the line that makes : POS and : D local variables ). What happens to the turtle and why ? 00 t-i I ..... - I Make a print of the result and put it in your notebook . 306 OrganicDesigns Three series of random component crees How will the random machinery introduced into the procedure RAND. TREE actually work ? What will the designs look like ? In order to see the effect of this randomizing, we must produce a series of designs, with the arguments fixed . The differences between the individual designs will be due solely to the random effects . This exercise is similar to the random grid work we did in Chapter 5. Remember the random placement of stars? Go back and take a look . I've written an EXPLORE-type procedure to produce a series of designs. I have indicated the arguments used at the start of each of the series. Recapitulation What have we done new in this chapter? I believe we have caught some of the mystery of a living form when we mixed a little randomness into some strict geometry . What are the implications of these tree machines? Whether or not you choose to be philosophical about all this, I hope you can extend the image ideas of this chapter to simulate the shapes of some other organic shapes. 307 Organic Designs RAND . TREE series lb 309 Chapter7 RAND. TREE series 2a RAND.TREE 30 3 30 30 . 75 5 310 OrganicDesigns RAND. TREE series 2b I 311 Chapter 7 RAND. TREE series 3 RAND.TREE 30 3 30 15 . 9 5 312 Organic Designs RAND. TREES with fruit I installed a RUN : FRUIT component into RAND. TREE and added a : FRUIT argument. The following were produced using FRUITED. RAND. TREE 60 : FRUIT 3 30 30 . 6 4 with : FRUIT set to asterisks, then to circles, and then to squares. .' :h OJ - ; -~~ . - J - . ~ 313 Chapter7 Exercises Exercise 7,1 Our randomized trees look more like weeds so thin . In " real " trees, the branches Design Make a Logo sure that examples example was consciously produced by it . The second design job illustrate of changing as different trunk planned is to design interesting from that as the level that of recursion by a student , and you randomized thickness trees . The first two designs to its designer . or nonrandomized thickness . changes . Here are given was " a mistake," according are shorter . exhibit in nonrandomized in trunk / branch the examples the branches as they become branches thickness either variations thinner draws decreases are two Your become tree procedure this thickness than trees because . Try trees that to do something as possible . Exercise 7.2 How about and creating trees explored designing forest or scientist He , ; ( Exercise see of ; the length , the flower palms ! , even the northern might tree " to essay find done reminded sticklike weeds European expect palm tree in . in by him terms segments of right ; and the the trunk You the of a Paul Let ' s tropical , , try rain a holidays be may the of . notice number in ; number could . of changed composition arguments ' s far distinctively they palm length or a So computer blue skies , . " these left Paul to ) ? you because which . 1 that is countries bend and are Here palms at 7 , 314 . a rate , begun oasis exotic orientation chapter " characterized the vegetation something selected to examples tropical this desert and tendency recursive leafy a Paul trunk " in . seas has in a blue some " as " fronds in procedure either fixed that the curviness palm The size of in trunk of the second random the trunk tree ' s and head Below three their made are of its , was . cluster its lengthened structure or the segments five trees OrganicDesigns Examples for Exercise 7.1 ~ 315 Chapter7 Paul's palms for Exercise 7.2 316 OrganicDesigns . . 317 Chapter 7 Paul then used a random placement of palm trees to simulate oases. The viewer must be in an airplane . \, it;. ;"i' ;1, ~ ~,. -:Ij' .~(' ~I 'r . ' I ],;.: 'y.;: 'f" I J'" ';111 ': I r ~'. h;.. \ ~i' I!. f: ,: ' ;'1:. , ';!; -j 'I'i -i \" ' . . . 318 .. . 'r ! :. ~ 1. .. (',. "\ J.. )' ."." _ \ .... j OrganicDesigns Exercise 7.3 Design a Logo tree -drawing procedure that prints a message on the screen to indicate the level of recursion currently being drawn . Make sure that your tree - drawing procedure has been slowed down, if necessary, so that the message can be easily read . You may want to use different pen colors to indicate the different levels of recursion . Produce a complete graphic recursion ; your package that visually package could be an effective recursion to those with no previous knowledge teaching illustrates one kind of tool for introducing of it . Exercise 7.4 What about leaves? One interesting way to try capturing the color and texture characteristics of " leafiness" is to design pointillist trees. What are these? The Penguin Dictionary of Art and"Artists tells us that "According to the color theory of neo-impressionism, it is possible to obtain brighter secondary colors, such as green, by making a series of tiny blobs of both primaries (which in the case of greens would be blue and yellow ) so that the blue and yellow blobs are very closely intermingled but are not actually mixed . In this way, the colors mix in the spectator's eye at a certain distance from the picture, giving a much brighter and clearer green than is possible by actually mixing the pigments on the palette ." At least two other sensations are felt by the " spectator" when he or she looks at a pointillist painting . First, the clouds of dots give the impression that a surface texture exists; the eyes can feel it . And second, the individual dots float in space, giving an illusion of depth . This floating occurs partially because of the natural tendency of reds and yellows to move forward and blues to recede from the viewer . 319 Chapter7 Pointillist paintings for Exercise 7.4 320 OrganicDesigns George Seurat (1859-1891) is the best-known pointillist neo-impressionists painter, but other of the late nineteenth century experimented technique . Pointillist paintings with the are hard to " read " in black and white reproductions ; the color mixing and dot floating don't work ! But you can get an "impression " of the method and the textures produced . I have reproduced here Seurat's " La Seine a la Grande-Jatte" ; and second, Henry van de Velde 's (18631957) " Faits de Village VII - La ravaudeuse." One student saw the problem of building a pointillist machine this way : "OK, let 's use colored dots to represent the flash of color that might be reflected from the tree's leaves. I will draw the reflected dot -lights and not worry about drawing the individual leaves. Perhaps I can mix a number of different colored dots together in the manner of Seurat. I can place the dots randomly, too, to give a fluffy, organic shape. The randomness may give the tree a feeling of depth as well . I think I will also try to indicate the direction of the light source - from the sun; the side of the tree facing the sun should include more red dots, while the side that would be in the shade could have more blue dots." Hint : Rework the procedures placed into the : FRUI T list . Make them capable of randomly placing a certain number of colored or textured dots in the " vicinity " of the current turtle position . The procedure RRwill be useful for this . For the selection of colors or textures, you may want to give a probability of picking one color or texture over another . Look back at the procedure P . GET in Chapter 5 for some ideas on probabilistically picking things from a list . Don 't forget to make the : FRUIT list state transparent . Exercise 7.5 What about curved sterns and branches? The following illustration is an example of Japanesepen-and-ink drawing . Does it suggest Logo procedures that use arcs to simulate plants? Review the arc procedures you were asked to work on in the exercise section of Chapter 5. 321 Chapter7 Japanesepen-and-ink trees for Exercise 7.5 322 OrganicDesigns Exercise 7.6 What about curved roots? Here are two technical line drawings of plants, both tops and bottoms ! Can you characterize these plants in terms of a few arguments? How can you design and use arc drawing procedures? Hint : The procedure RRmight be used to generate random arguments for your arc drawing commands. /' Exercise 7.7 There are dozens of other tree characteristics that you could model . The manner in which architects draw trees should suggest some of these alternative tree qualities to you . Architects surround their model buildings with model trees, and the next several pages show some typical architectural renderings . Note the different approaches to treeness. Pick one that strikes your fancy and design a Logo model to do it . These designs are taken from Bob Greenstreet's Graphics Sourcebook (Englewood Cliffs, NJ: Prentice-Hall, 1984). Warning : The best illustrations to use for drawing trees are real trees. Go outside now and look at some. 323 Chapter7 Architects ' trees for Exercise 7.7 :;~.:-:':'. , . , \ . " , :,'.:' .' .' ..'ff;.;:."':...,::.,'.' .',' . , " " . ' . . . . ~ :~,'.:~...,.:,:.::,:.3}~~~,~~::',::::..' :', . ', . " vl ' ~( . " " ' .' . . '- ... . '. ' " . . " . . ~,.~ .,", .~", 1, ., ',. " ." [!:"A( .! ....;";";'l "t :!;~ ~,' -'):.~ ~ ~.:';.: ~>::::::.,\.'.' , ' ... .tit. ' . ' . " " . . . " ' ', , . ' , . 1: . ' , . - .- ., . .. ' . .. ~ ., , , , .t" . " " . " " ~." '(o\ "."' "" ." " ", " . " . ' . .. . " / : " .,' .., ' : , I " i "~ .".\" "" '-:.... ;;"" ! "" .~ "" .V o;o':..." ; 324 ~ ' ~J, ~ . ' ' ; ? '" ' , . " . " " ., " -, '.., .,, ' .. " . ... ~,,"," .< ' --1 .. '':""_ ...")o: " "' ..'~ ... . ; Organic Designs Exercise 7.8 Imagine yourself looking acrossa small lake. A single tree is growing on the shore just oppositeyou. It is night, but a full moon illuminates the tree and this image is reflected in the water. A breeze agitates the surface of the water. Design a Logo model that draws both the tree and its reflection in the lake. Include an argumentfor the velocity of the breeze. Exercise 7.9 Former students have done some very interesting " Logo jobs" on fruit and vegetables. Some vegetables literally cry out for recursive techniques. You don't believe me? Go look at some artichokes, cauliflower, broccoli, asparagus! Others scream for the " oid " treatment introduced in Chapter 4 with nephrQi. d.s and cardiQi.d.s: go look at apples, pineapples, oranges, carrots, bananas, carrots, radishes, leeks, and turnips . Design Logo procedures to produce a suite of designs based on the characteristics of a single favorite (or hated) fruit or vegetable. No visual hints here: go look at the real thing . Exercise 7.10 Pick two different fruits, vegetables, or trees. Show how a single Logo procedure can draw either of the two items, as well as shapes exhibiting characteristics of both . For example, suppose you picked a pine tree and a cauliflower . Your Logo procedures must be capable of drawing both a pine tree and a cauliflower . But your procedures must also draw figures (" caulipines " ?) that are transitional between a pine tree and a cauliflower (a pine tree on its way to becoming a cauliflower ). Or a cauliflower metamorphosing into a pine tree. 325 Chapter7 Pick your two objects and fill several pages of your notebook with sketches before you do any Logo programming . Do something thoroughly ridiculous, but correctly so. Exercise 7.11 What about flowers and gardens and fields of flowers ? As you may have noticed, I usually suggest two ways to begin Logo projects like this one. First, you could go out and look at nature. In this case that would be studying " real" flowers and gardens. Second, you could look at a drawing or painting of flowers and gardens. Paintings of flowers are, of course, also real and help us to seebetter the garden behind our house. Let me suggest one artist who uses flower fields in almost all of his work . As always, I offer you my own taste in artists . You may see something in these reproductions that will start you off in some interesting direction . Then again, you may want to find your own artist to explore. Gustav Klimt (1862-1918) was an Austrian painter who worked in turn -ofthe-century Vienna . I am sure you have seen paintings like " Poissons rouges" of 1901/ 2, which is reproduced on the next page. Here Klimt contrasts flat geometric motifs with the molded skin textures of the very human forms . The contrast, even in this black -and-white reproduction, is striking . Each pattern type, the human flesh and the geometric forms, is made more vivid by the presence of the other. On the page following is a painting in which Klimt uses only flower patterns; it is " Rosiers sous les arbres" of 1905. This sort of painting lacks visual excitement . There is no focus, no contrast. No surprises ! Study this decorative work, though, to see how the artist has placed his flower patterns on the surface of the canvas. I would like you to Logo- produce Klimt -like flower fields, but add a surprising point of contrast . If you use naked ladies, model only a few characteristics . 326 > OrganicDesig :)> U Klimt .~.. -~ n 0 -~ ~ U1 -~ .~.. OQ -r'J ~ = ~ rU1 'J CoA ) ~ "'..J ~ N Q ) Chapter7 A decorative Klimt Organic Designs Exercise 7.12 Try modeling one specific flower . Pick personality, one that can be easily identified a flower from sunflowers, hollyhocks, iris, daffodils, tulips, that a distance daisies , has . lilies a Some vivid visual suggestions : . Exercise 7.13 Surround your plants with a few insects . Butterflies, moths, ladybugs, dragonflies, beetles, and fireflies might be nice. Exercise 7.14 We 've avoided animals so far . But what about some odd sea creatures ? There is a snail -like creature illustrated among the imaginary P IPEGONS of Chapter 2. Find an text on sea creatures and model something urchins, or sea anemones . Something living like squids, jelly fish, sea inside shells might be a challenge, too . Keep the modeled sea creature characteristics few in number - at the start . Exercise 7.15 What could be more organic and more relevant to visual modeling than the human eyeball? Take a close look at your own eyes in the mirror . Make special note of the colors and patterns in your irises. Usually, on close inspection, you will find that your two eyes are different from each other and quite irregular in themselves. Design a Logo model of your own eyeballs. Generalize it to simulate a wide range of eyes that include those of your cat and tropical fish . 329 "l W Chapter7 Exercise 7.16 Recall the FRACTALGONsof Chapter 4. We changed polygons into FRACTALGONs by changing the nature of their edges. We replaced the polygon 's single, straight -line edge with an edge composed of four straight -line segments. We then replaced each of these four straight -line segment with a smaller, four segment edge. And then each of these segments was replaced with smaller, four segment sections. We continued to break down - or fractal- single line segments into multiple line segments until we arrived at the odd, fuzzy shapes illustrated under the heading "Some curious FRACTALGONs " in Chapter 4. There was nothing special about replacing the straight polygonal edge with a four -segment shape; we could have used other pattern combinations of straight -line segments. But no matter what edge shape we selected, we would have followed the fractal scheme of replacing the parts of an edge with miniaturized versions of the overall edge pattern . Let's experiment with an alternative edge pattern, and let 's also introduce some randomness into fractal designing . Take a look at the following figures . Can you guess what is happening before reading the description below ? 2 5 330 8 OrganicDesigns Start with the large triangle, figure 1. Imagine that a circle is drawn on the midpoint of each of the three triangle edges (figure 2). Now pick a random point within each of these three circles (figure 3), and use these points to break ("fractal " ) the original triangle of figure 1 into the four triangles of figure 4. Look at each of these four triangles . Imagine that a circle is drawn with its center placed on the midpoint of each of the edges that define each of these triangles (figure 5). Now pick a random point within each of these nine circles (see figure 5), and use these points to fractal the four triangles of figure 4 into the sixteen triangles of figure 6. We could continue this fractaling to any level and see what happens. But, first, what about those circles? How big should they be? The radius of a circle should be related to the length of the line on whose midpoint it rests. Therefore, the circles should get smaller as the fractaling progresses . The specific relationship of the circle size to the edge length could be given by some factor, call it F. The larger the value of F, the more deformed the figure could become. Now suppose we begin with a double triangle, similar to figure 8. What will the fractaled figure 8 look like ? Here are four examples. The F factor was kept constant for each. The differences between the figures are due solely to the random component. Can you guess what level of fractaling was used? What do these images look like ? 331 Chapter7 Fractallandscapes 1 332 Organic Designs Fractallandscapes 2 333 Chapter7 Fractallandscape before and after some rain Here is one further level of fractaling . I' ve also decided to allow some rain to fall on the landscape. What is happening ? 334 (..) (..) U1 OrganicDesigns ~ , More rain Chapter7 What 's going on here? Are these scenesreally mountainous ? The last figure looks like a scene you might see flying into Hong Kong . Why does the eye read these figures as three-dimensional ? Where is the eye in relation to these scenes? How would you color in all those little triangles so that they won 't look so much like chicken wire ? How many triangles are there, by the way, in those figures? Recursion is obviously being used; can you give the number of triangles in terms of recursion level? Can you put together a plan for experimenting with these visual ideas? What about a fractal mountain machine; would that be possible? What do you think the major problems would be? Put together some exploratory building plans . 336 Chapter 8 Space "The question [is] whether spaceis real apart from space-filling objects." W. T. Harris Reading objects in space Most of our work so far has been flat and two -dimensional . Our only real excursion into planning depth characteristics was the overlapping Islamic tile designs of Chapter 6. But even this was really only two -dimensional motif manipulation . However, even though we haven't been much concerned with spatial modeling, some of our line drawings occasionally seemed to float into three dimensions : recall some of the lacy, random tree shapes of Chapter 7 and- especially- the nephroid designs of Chapter 4. Take a look at the series of circle-based nephroids below . Even though you know that these are perfectly flat figures, do you have the impression that they are also three-dimensional and that one nephroid can actually be placed inside another? Why is this? Nephroids are ambiguous shapes (flat and rounded ), but because the brain lives and works in a three- dimensional world, it resolves the two -dimensional ambiguity of nephroids by placing them fully into 3D space; nephroids are good examples of the brain adding space in order to read an object better. Spend some time following the lines of these odd images. Chapter 8 Intentional depth cues This chapter will concentrate on some of the ways in which depth characteristics can be explicitly designed into object scenes. Art students already know how two -dimensional paper and canvas can be made to simulate space through a wide variety of methods and systems, many quite arbitrary . They know this because they have played with alternative spatial systems and conventions . If you are not an art student, you may be coming upon these ideas without such first -hand experience. So, before you are ready to incorporate depth cues into modeled scenes, you need to explore how your eyes read and interpret different forms of depth information . We will be looking at several depth cues in this chapter : placement, shading, size variation, shape overlapping, and vanishing point perspective . The models of the chapter provide environments in which you can watch yourself reacting to messagesfrom things in space. 338 Space Enclosing nephroids 339 Chapter8 Surface shading The following design element was much used by the Dutch artist and designer, M . C. Escher. How should the eye read this figure ? Is it a flat design, a box seen from the outside, or a box seen from the inside? The design is ambiguous, and the eye switches from one interpretation to another. The placement of several objects into a scene can sometimes resolve ambiguity . The Escher box, however, becomes more ambiguous when it is placed into a composite of similar shapes. 340 C) CD co Space Modeling a shaded Escherbox Let's write a procedure, E . BOX, to draw an Escher box and then shade it . We will want the procedure to be general enough to draw different -sized boxes and to alter the quality of shading on each of the three visible surfaces. The figure itself is easy enough : a hexagon in which a Y shape is placed . The procedure E . BOX has two arguments, : SIZE and : SLIST . : SIZE is the radius of the hexagon that encloses the Y shape; it is also the length of the three arms of the Y. : SLI ST is a list that has three elements , one for each of the three visible faces of the box. The order of the faces is: top, right, and left . The shading is to be accomplished by drawing equally spaced parallel lines on each of the faces. Of course, the number of shading lines can be different for each face. The number of spacesbetween such lines, one number for each face, is to be placed inside the : SLI ST. For example, an : SLI ST of [ 1 1 1 ] should draw the unshaded box; each face will have only one space since an unshaded face has no lines . An : SLIST of [ 2 2 2] should produce a box with two stripes of space on each face: If the elements in the list are equal to the : SIZE argument, each of the faces should be filled completely with the current pen color- black, in my case. Here is what E . BOX 50 [ 50 50 50 ] should look like . 343 Chapter 8 The Escherbox procedures TO E . BOX : SIZE : SLIST ; To draw a simple Escher box with parallel ; line shading . : SLIST must be a three - element list ; Each element gives the number of between - line ; stripes on one face . LT 60 PD REPEAT 3 [ SHADE : SIZE (FIRST : SLIST ) - . MAKE" SLIST BF : SLIST RT 120] RT 60 CNGON6 : SIZE END TO SHADE : SIZE : STRIPES ; To shade a single face of an Escher of ; with parallel lines . The number ; actually drawn will equal : STRIPES LOCAL liD MAKE liD : SIZE / : STRIPES box lines . RECORD . POS REPEAT: STRIPES [FD : D RT 120 FD : SIZE BK : SIZE LT 120] RESTORE.POS END I didn 't go through a turtle walk for the shading, but the method is clear. Next, let 's put E . BOXsinto a grid . This is similar to work we did in Chapter 6. In the following diagram the asterisks mark the centers of the E . BOXS. We need to calculate the appropriate horizontal, vertical, and indent distances between these asterisks in order to build a demonstration procedure using RIFLAG. 344 Space Because the E . BOXs are placed at the vertices of an equilateral triangle, we need to recall the relationship of the height of an equilateral triangle to its edges: height = edge*cos 30. Go back to Chapter 6 a minute and review the mechanics of NEST . DEMO, TP . DEMO, and SAW. DEMO. These three procedures were also based on the equilateral triangle . Verify the calculations used in the following TO ; : SHADED To . DEMO grid : SIZE a series : COLS of ( LOCAL " EDGE " VERT ) MAKE " EDGE 2 * : SIZE * COS -MAKE " VERT : EDGE * COS MAKE " MOTIF [ E . BOX : SLIST shaded E . BOXs 30 30 : SIZE : SLIST ] GO . PT RIFLAG : COLS ( COUNT : COLS ) : EDGE : VERT ( LIST ( - 1 * : EDGE / 2 ) 0) END One final note about my kind of surface shading . I could have used other conventions. On the next page is one example of an alternative scheme. 345 . Chapter 8 - . - - " ~ Placement ambiguity Look at the following grid of shaded Escher boxes . The grid is clearly composed of three rows of boxes, but how are the rows related in space ? Is the top row floating in space above the middle row, or is it sitting on a surface and located behind the middle row ? And if the three rows are sitting on a surface, is that surface flat, inclined, or stepped ? This row placement is clearly ambiguous . 346 Space C> e Size variation One of the easiest ways to control the illusion of objects in space is through size variations . An object close to us is bigger than an object farther away . So differences in size can be read as differences in distance. This works fine for the space placement of objects of the same diIriensions; but it is more difficult to force a single space interpretation of objects of different real dimensions, and ambiguity creeps in . For example, try to read the following two scenes. Because the shading on the boxes is the same, the eye guesses that the boxes have the same real size. Hence, the size variations are read as cues about the scene's depth, and the top row becomes the farthest away from us. But there is an alternative reading . The top row might be small boxes that are floating above the slightly larger boxes of the middle row that are floating above the slightly larger boxes of the bottom row . Force your eyes to read the scenesin these two alternative ways. Which way seems to be the eye's preferred view ? Why ? 347 Chapter8 ~ ~ Multiple motif grids Can you guess how the last scenes were produced ? I tinkered with the generalized grid machine RIFLAG so that it could draw grids of multiple motifs . I wanted to have a different motif on each row . Then I could draw rows of different -sized (or shaded) E . BOXsto explore the illusion of receding objects . . . or whatever . I include my modified procedure to remind you about the usefulness of tinkering with the machinery you already possess, to make procedures do their jobs a little differently . The modified machine is called RIM . FLAG for recursive, indented, multiple -motif flag . It expects a composite motif list that is composed of several list elements: there must be one motif list for each row . For example, this was the motif list used for one of the previous scenes. MAKE" MOTIF [ [E. BOX . 5* : SIZE [ 3 6 9] ] [E. BOX . 7* : SIZE [ 3 6 9] ] [E. BOX : SIZE [ 3 6 9] ] ] Here is RIM . FLAGand its supporting procedures. 348 - Space TO RIM . FLAG : COLS : ROWS : CDIST : RDIST : IN ; RIM . FLAG expects : MOTIF to have multiple ; motif lists : one for each row . IF : ROWS RIM.ROWER RIM.RSTEP RIM.FLAG END < ( 1 [ : CDIST : RDIST ROT STOP ] ( : : FIRST : COLS ) IN COLS ) ( : ROWS TO RIM . ROWER: C : N IF : N < 1 [ STOP] RUN FIRST : MOTIF ; To handle the multiple CSTEP : C RIM . ROWER: C ( : N- l ) END - l ) motifs : CDIST : RDIST (ROT : IN ) . TO RIM.RSTEP : R : IN PU SETX (FIRST :POINT) + (COUNT1 : IN ) RT 180 FD :R LT 180 PD MAKE" MOTIF ROT : MOTIF ; To place the next motif into position for RIM.ROWER . END TO CSTEP : c PO RT 90 FD :C LT 90 PD END Overlapping shapes Look at location the the of bottom following the row boxes . But . how grid of The top can Escher row we draw boxes is clearly these . There is no ambiguity about the behind and slightly higher than figures? 349 Chapter 8 The painter's algorithm What we need is the so- called painter 's algorithm . Why so-called? Because the method was dreamed up by computer scientists; this is how they think painters handle overlapping scenes. Hence the algorithm 's instructions for the painter turtle . First, determine which objects are farthest from the viewer and paint these onto the canvas. Then determine the objects just in front of the painted objects and paint those onto the canvas. Continue with this layering until you have included everything in the scene up to the viewer 's nose. Use opaque paint, though, so that no object appears peeking through a layer of paint . Is this how human painters really work ? Could they do it this way if they wanted to? Whether or not this is the method real painters use, let 's build a visual model using it and then draw some overlapping shapes. The first problem we encounter is how to make the turtle paint shapes that are totally opaque. Here is one way . Select the screen position where you want to draw a shape. Erase everything within the outline of the shape and then draw the shape onto this " opaque spot." The following procedures handle these tasks for E . BOXs. TO BLACK ; To LT 60 . BOX erase REPEAT 3 [ NIGHT RT RT 60 END TO : SIZE everything NIGHT . SHADE the : SIZE outline of an E . BOX . - 120 ] . SHADE RECORD within : SIZE . POS PENERASE ; Depending ; you ; to REPEAT RESTORE PENPAINT END 350 on may your have erase the : SIZE . POS computer to box [ FD and increase fully space 1 RT FD : SIZE LT 120 Logo the pen . 120 BK ] : SIZE dialect width , you may Space Overlapping grids Let's organize a three-row, rectangular grid scene according to the following depth convention : the top row will be the most distant, the middle row will be in the middle distance , and the bottom row will be closest to the viewer . Our grid machine must paint the top and farthest -away row first, and then the second row of intermediate -distance objects, and lastly the row of nearest objects. If any objects in the second row overlap objects in the first row, the painter 's algorithm should take charge and paint one figure over the other . We will need this help, too, with the third row, in case any third -row objects overlap any first - or second-row ones. How can we make this happen ? By defining the : MOTIF list in the following manner: MAKE : MOTIF [ BLACK . BOX 50 E . BOX 50 [3 6 9] ] This assures us that if any image falls on top of a previously drawn figure, the overlapped segment is fully erased before the second object is painted onto the spot . Let's try RIFLAG [ 3 3 3] 3 (lOO* COS 30) 50 [ 0] . 351 Chapter 8 Oops. The figure is interesting but hard to read. Try moving the objects about in space a little to see if you can eliminate the ambiguities of the first image. See, for example, if it is easier to read RIFLAG [ 3 3 2] 3 (10 + 100* COS 30) 50 [- 20 40] . 352 Space A short box play 353 Chapter8 Ambiguity again Once all the figures cease to overlap, even the painter 's algorithm fails us. What is happening below ? It 's hard to say. We need some additional indicator that says whether all those boxes are sitting on the same surface or whether the top tier is floating over the bottom tier . What we need is perspective. (0 lS:J Perspective Most of you are already familiar with the jargon of the perspective systems invented during the European Renaissance. You may have some notion of what foreshortening means, as well as an idea about vanishing points . But let 's investigate perspective empirically, with a few experiments . Find or make a wire frame model of a cube with edges of about 6 inches. Hold the cube so that you are looking directly at the middle of one of its faces. 354 Space Make sure that you hold the cube so that your line -of -sight forms a right angle with the face you are looking at . Hold the cube very near your face and record in your notebook what you see. Now hold the cube as far away as possible and record what you see. Your sketches should look something like these : 0 D Now, again look directly at the center of one face held at a right angles to your line -of -sight . This time, move the box horizontally to the left . Record your views . 0 Do the same as above, but with the cube moved to the right . 0 Do the same again, but lower the cube and move it to the left and then to 355 Chapter 8 the right : 0 0 You have just beenwitnessto the operationof one-point perspective . The following sketchesindicatethe constructionof a cubedrawn with one-point perspective . Whereis the viewerin eachof thesedrawings? 0 356 < ~ 0 (D - ( D n ~ ( D ~ ~ . . ~ ~ - I 0 ~ ~ 0 (D 0 Space Two -point perspective Carry out the same experiments again, but rotate the cube so that you are looking directly toward an edge rather than a face . Keep the edge vertical . The following is what happens . Where is the viewer located in this scene? G <:) \ \ ' " .........~/ ' /" / 50 \.10 Cu BE Three -point perspective Finally, carry out the drawing experiments again, but rotate the cube so that no edges are vertical and no faces are at right angle to the line -of -sight . Yes, you 've guessed it : three-point perspective. But where are you in this scene? Why are vanishing points called vanishing points ? Can you generalize the perspective rules of the last several pages? 357 Chapter 8 0 0 ~ ' " / ' " / / SOl-It>CI-\&E: 1 0 ~ Modeled one-point perspective (almost) ~ How could we draw a one-point perspective version of a cube? But let's be more general than that . What about polyhedrons ? Suppose that a single vanishing point has been defined as a two -element list . Let's make it a global variable and name it : VP. The two elements will be the x and y coordinates of the point . Now let's draw a 3D CNGON . Whenever the turtle arrives at a vertex of the polygon, it should record its current position and then point toward the vanishing point . Next, send the turtle forward by an amount that corresponds to the CNGON 's thickness and then return to the recorded position . Now go on to the next vertex, and so on. In Logo terms, these rules would translate into something like the following : 358 space TO NHEDRON: N : RAD : THICK ; To draw a " kind " of one - point perspective ; rendering of a 3D CNGON . LOCAL " EDGE MAKE " EDGE 2* : RAD* SIN (180 / : N) PU FD : RAD RT 180 - (90* ( :N- 2) / :N) PD REPEAT:N [FD :EDGERT 360/ :N RECORD . POS SETH TOWARDSFIRST : VP LAST :VP FD : THICK - RESTORE .POS ] LT 180 - (90* ( :N- 2) / :N) PU BK :RADPD END This procedure will draw figures similar to the following : Drawing the NHEDRON 'S back face Now, how do we connect the ends of those lines that have been drawn toward the vanishing point ? If we knew the x-y positions of those ends, we could draw a line from the first end to the second, from the second to the third, and from the third back to the first . How ? Maybe we could store these end point locations in a list . If we could put them all into a list, we could join them all together somehow. The following procedures will let us do precisely this. 359 Chapter8 TO EMPTY .BAG ; To create a global variable ; sure that it is empty . MAKE" POINT. BAG [ ] END TO ADD. POINT i To put the turtle ' s current named : POINT. BAG and make x - y location : into the :POINT. BAG. MAKE" POINT. BAG (SE : POINT. BAG XCORYCOR ) END 360 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TO CONNECT : LIST ; To connect the x - y point stored IF EMPTY? : LIST [ STOP] SETXY (FIRST : LIST ) (LAST : LIST ) PD CONNECT (BF BF : LIST ) END in a list ,- . Space Completed NHEDRON Let's put the new list apparatus (indicated by <- - - ) into the body of NHEDRON : TO NHEDRON ; To ; rendering : N draw a : RAD " : THICK kind " of a of 3D LOCAL " EDGE MAKE " EDGE LOCAL " POINT . BAG < - - 2 / EMPTY . BAG PU FD : RAD RT 180 - REPEAT < - - ( 90 * : N one CNGON - point perspective . 2 * : RAD * SIN ( 180 / : N ) - - ( : N - [ FD ) : N : EDGE RT ) PD 360 / : N RECORD . PO.'> SETH TOWARDSFIRST : VP LAST : VP FD : THICK ADD. POINT - < - - RESTORE . POS] LT 180 - (90* ( : N- 2) / : N) PU BK : RAD PD RECORD . POS PU CONNECT < - SETXY ; ( FIRST Connect RESTORE - - : POINT . BAG : POINT last . POS end . BAG point < - - ) (FIRST BF : POINT . BAG) to first end point . < - - - < - - - END One - point perspective experiments The images in the left column of the next page are drawn with a vanishing point that can be marked on the screen with an asterisk . The vanishing point was created by MAKE " VP [ 2 0 0 150 ] . The images in the right column are drawn with a more distant vanishing point that cannot be marked on the screen. It was created by MAKE " VP [ 800 600 ] . Explain the differences between these two scene sequences in words . Be specific . 361 Chapter 8 Near and distanIt vanishing points ~i- ,..;' 1 It :" ? l~ -:,.~ / ~\- ~ 2..~ 2. ~ ,....;" ~ \* ..;" 4-0:- 362 .f,) Space More one -point perspective experiments Explain the following in words . How do you interpret the placement cues? How were the images created ? .~ --,, * l' [IIJ[] [ ] [IJ[ ] [I] [ ] [J][Q ~ * l' []][IJILIJ [][][] [ ] [ ] []J] ~* .,,?I 363 Chapter8 Tumbling NHEDRONs ~ ~ ~ ~ !l:JJtl:ll tl:l; ~ ~ !]:J) {t:JJ lDJ ~ ~ ~ 1lJJ [] Q; ~ ~~ ~ ~ ~ ~ ' lf~~}ull'"t:", ~ ' U7{\ "\Jv h = a*SIN a. 3. cas a. = bI / a ---> bI = a*CaS a. 4.b = bI + b2 b2=b - b1 - -> 5. TAN= h/ b2 ---> 4> = arctangent 6 . The angles of any triangle sum to 180 degrees (180- ~ ) = 180 interior --- > a. + + -- > a. + - ~ = 0 --- > ~ = a. This gives 7 . SIN = + us ~ hI c ---> c = hlSIN This gives us h / b2 < ---- c < ---- Now look back at figure 3. How do we calculate cl and c2? The parallel " c" s divide the large triangular face into smaller but similar triangles . Remember the business about parts of similar triangles from geometry ? Using the idea of similar triangles, we can say that cl is to c as al is to a (cl / c = al / a). So cl = (al / a)*c. Finally, note that the turtle (already pointing downward ) must turn right by the angle e before drawing the "a" edge of the first triangular face. 370 Space Exercise 8.2 Shading techniques light sources would arguments into placement of light The Escher light related within box source a scene as to well the scene . model as shadows that different Try to incorporate . You will need the intensity light to and kinds think quality of source about ( color ) the of the . 8 .3 Escher alternative box motif ways visual idiom the be create an produced Exercise should idioms is , and for only I have representing one symbolic included cubes way one in below space to express a . Devise . Design cube a a . There number model are of to many different speak , your . Exercise 8.4 Cubism was an art movement of the early twentieth century that attempted to give a visual account of the entire structure of objects in space. In practice this meant superimposing and combining several views of the object, all within a space limited by the dimensions of two -dimensional canvas. The goal was to project the idea of an object in space without being constrained to show it from a single point of view . Cubist practitioners included Picasso, Braque, and Gris . 371 Chapter8 Find a few postcard reproductions of cubist works that you like and explore the images with Logo models. Comment on how you have characterized cubist space in your work . Exercise 8.5 What is the room that you know best? Perhaps it is your bedroom, workshop, or study ; but it could also be an outdoor enclosure: a greenhouse, gazebo, or garden shed. Build a Logo model to document the shape and spatial qualities of this room . Keep your spatial vocabulary spare but expressive. Here is the most expressive example of a personal room model that I have in my postcard collection : Van Gogh's asylum bedroom . 372 Space Exercise 8 .6 Produce a shaded sphere, cylinder, or prism . Be innovative . Don 't rely on the shading ideas of the chapter; invent some new ones never seen by Earthlings . Exercise 8 .7 Produce a landscape of a variety of shapes, all consistently shaded and perspected. Explain what you mean by consistently, though . Exercise 8.8 What Logo doing about ? Can it Exercise How space that impossible . two - be done it Then 8 about do it three at all - point with perspective Logo ? ? Try to Can explain this be how you done easily with would go about . .9 designing your creations they and by are space " the space Hungarian impossible grids own ? artist . " Compete On the Tamas with following Farkas Farkas pages . by Don you ' t designing believe will see some the claim your own . 373 Chapter 8 Farkas grids 1 374 Space Farkas grids 2 375 Chapter8 Farkas grids 3 376 space Exercise 8.10 We have drawn figures that look as if they have three dimensions . But what about four (or more ) dimensions ? Let 's review everyday space with a few drawings . We can start with a single point : see (I ) below . No dimensions in a single point, right ? If it 's very tiny . Next, draw a horizontal line from it toward (2). We have a one-dimensional line . C, ) ( 2. ) . ) Now, pull toward the line is two - dimensional . this line downward (4)- (3 ) . Connect . We could it 's clearly two - dimensional Obviously , we must from two - dimensional the eye dimensions about , parallel the vertices . Now call it by a fancier . Next, let 's pull rely on some drawing (5 )- ( 6) - (7)- (8) . Connect this the that name, a plane, but either way, plane into three it, parallel the vertices . We have dimensions . to force three dimensions of this chapter plane, ( 1) - (2) - (3 ) - (4 ), " forward this by pulling shade, figure conventions to itself, down a three - dimensional ( \) <\ > a window we have a square paper . We can use the conventions this . So, pull : illustrate to itself, like " into to fool three and to the left : cube . ( 2 ) ( ' 2. ) ( 5) ( ~ ) ( 4- ) . . ( 4- ) (3) ( 8 ) 3) ( ~ ) Now, for the fourth dimension. Of course this can't be done. But let's diagram the ideaby pulling the three-dimensional shape, the cube, parallel to 377 Chapter 8 itself , right into another angles to We Let 's can the the long let ' s pull stylized the eye the cube fourth four whatever only is given I ( 1 ) - ( 2 6 each of them fourth were , aren depth ) - ( 5 Connect we cube ' t cue so ) - ( 6 ) - ( 7 ) - ( 8 the vertices We that the . we OK be the do all right . to have the this Why anything be what is ? want read right ) . into So the known as 2- ) ~ ( 4 - ) lB ) " " - Play scheme with for What a shaded into about hyperpyramids to wings 378 . hypercube looking hyper remember dra this convention four your with space bit scenes , - NHEDRON state - dimensional a conventions Can , perspective invent hypercylinders ? in you an alternative Can you ? hyperspheres nice . words Do so ? some that 4D people modeling can draw , read . not we can at ? represent drawing and and other to can down must to and ? ) each want down they dimension to convention the ) - ( 4 the . ( ( as that pulling ) - ( 3 . ) ' 5" ) , some hypercube ( Remember conventions dimension - dimensional . visual of are as three convention systems as other choose select Spatial dimension your but a Chapter 9 Closure " Purpose shapes special process purposes person . are D . N . years the us in by ago Center class . next to and I My results , for the methods when creative or She We on ordinary special processes mental appropriately ' grimly to but processes in unreasonable determined spot something did from , a , of the to find the horns bin ' accident report rue Lepic , fish and . were on an able intentions . " slammed rushed a . poetry workshop There were questioned and her we were return and slavishly . And the ridiculous following feelings of teaching to structured by five , her then she tasks . gave the . a local class on , I I overly vividly " , my on for but week vindicate it and woman they would up Raspail exercises poem " signed each remember blew of the silly short I boulevard liked the how I a I found , write afternoon shopping I , on exercise convinced ; Paris Artists . her assignment in specific . show was arrived teacher solution were late the a to I I and assigned planned " after plus our , soon Students - read accident fallen occurs not intentions at my depends Perkins Fifteen the Discovery Creating marshaled Unreasonable " . accident , I some . returned to street hoping that down my only of I thought I city around happen slip - covered On the wandered to fish . of would street table , section . something a trite mishap the into How . on And some ice ice : , an Chapter 9 accidental meeting with fish . That was the title I found on the street. I went home and got on easily with the exercise. I am no poet, but class . The reason own form I wrote that intentions . Problem finders Jacob Getzels problem I would have and Mihaly Institute of Chicago them ; the results were longitudinal study of problem , these provided of the drawings and structure after ever written in that sought out my the form would were them studied a book to select in preparation with to track with the ways were vision : a from a number a still life . The qualities the students used to approach followed the students their success . The form of their what the authors their called to York, 1976 ). For a set of objects the methods assigned The creative Wiley, New for drawing unreasonable male art students that called in art (John asked it . Very the problems in finding I found for seven years success, or lack " problem finding of it, styles " in art school . Can you guess the results ? Getzels working and found a relationship and both the success seven years later . The most and later - came most draw . They in fact, they from students time arranging began organizational the objects Csikszentmihalyi procedures professional 380 before the exercise . The researchers was then compared spent I have I wasn 't sure what explored were compared graduation while to explore published students and arrange . Although Csikszentmihalyi at the Art example that for my success was, I think, that I passionately for each given be, I knew the best poetry their structure seemed and selected and manipulating work without they wanted to discover moving who quality them of any that specific they drawings 's and his work - in art school unusual in their a student work objects these objects before to capture about . As their student effective the most having a structure his between and who they started conception to of the arrangement of objects ; liked through handling progressed , the more Closure imaginative students tended to rearrange their objects, to introduce new elements or to eliminate others . They changed paper, switched drawing media, and changed their drawing position more often than their less successful classmates. And when they were finished, these students said that elements in their final drawings still might be changed without destroying its character. In addition to working styles, these researchers found that a concern for fundamentals also affected creative production . The effective problem findersGetzels and Csikszentmihalyi 's label for those students who found and structured their own problems - tended to describe their work as being based on matters of deep personal concern to them, even when these themes were not visually present . It seemed as if the energy for the realization of the problem finders ' exploratory style was funded by their passions. Exploratory facility I wrote this book with the conviction that a personal problem -finding ability is necessary for real creativity . But how can this ability be encouraged in the realm of visual problems when most students suffer from a lack of exploratory facility ? They may have the passions, but they lack a sufficient visual vocabulary and the most basic artistic skills and will that could have helped them start fashioning a personal vision language. I am convinced tha t visual modeling can substitute for these lacks. How ? Visual modeling is an environment in which you can offer yourself the gift of seeing on your own terms. The attendant luxuries - design skills, rich visual word -images and metaphors - are all there, inside that space. The substance of this book is to offer you sight of this kind of environment . But you must not stop here. You must extend modeling into your own worlds . 381 Chapter9 Premature closure We haven't spoken of closure since Chapter 2. As a design spreads itself onto the surface of your screen, it may eventually repeat itself or close on top of itself . Closure may come very soon, or only after many " rotations " of your visual machinery . Be on your guard, though . Premature closure, like death and entropy, must be fought . Change your arguments, or change the models, or find another problem . But always look through closed figures ; there may be others, just behind them, that are far more intriguing . All the images in this book are now closed, or are they? A final illustration I wanted to end with the same simple polygons we have labored with throughout this book but in a design that did not, and would not, close. It is a nonperiodic tile pattern . Reading list I am sure that the character of this book would not be changed if I, like Getzels and Csikszentmihalyi 's problem -finders, changed some of its elements. I feel the same about the following list of books. I present a relatively short selection 382 Closure of some of the differently it is about a gra my that mind , - in of the Abelson extended and Logo the , you third Harold for if should book Brian Harvey Seymour Papert Read book a useless for that the books I . There are three quite different explore me I have to think offered mentioned in you the have never read the in , this the book word . ideas are be Logo of about from , could your study read reasons and while exceptions mathematics - careful Andrea diSessa , The , Computer , 1985 Ps ~ cholog diSessa mathematics , New encouraged else mathematics exercises and Cambridge Books them , text . the The of computer not easy by 's philosophy Seymour science . . , the Both However , reading would be . behind Papert second selected books the the style Harvey , uses reads aided however first while programming Brian , the inventor invention himself , in . Abelson exploring of repeated programming by you everything to the enriched , each with and Finally of - on Like are Logo work Each language familiarity your . not geometry require most have books through useful . Logo Logo turtle investigates I wonderful of books the most found modeling . and quite notion I selection ~ hics are that visual personal Turtle To books , 1986 MIT , 1980 geometry , Cambridge Logo style , 3 : the computer , 1981 . volumes , The computers and powerful is a short selection as a medium MIT Press , . , Mindstorms York Press science , 1987 , Turtle ; children , ideas , Basic . ):: anything by Rudolf Arnheim . Here : Visual thinking, University of California Press, Berkeley and Los Angeles, 1969. 383 Chapter9 Entropy and art, University of California Press, Berkeley and Los Angeles, 1971. Art and visual perception: a psychology of the creative eye, University of California Press, Berkeley and Los Angeles, 1974. The power of the center: a study of composition in the visual arts, University of California Press, Berkeley and Los Angeles, 1982. New essayson the psychology of art, University of California Press, Berkeley and LosAngeles, 1986. Next, a hodgepodge of titles that I found of interest . They will lead you to other sources. Carl Jung, editor, Man and his symbols, Doubleday & Company, New York, 1964. E . H . Gombrich representation , Art and , Princeton University Press , Princeton , Cambridge the psychology of , New Jersey , 1960 . of graphic production processes , Cambridge University Press, Cambridge, cognition : , 1981 pictorial van and Press in Peter Drawing MIT study studies , , The a Block Sommers , Imagery : Ned 1984 , editor illusion descriptive . and experimental . D. N . Perkins, The mind 's best work: a new psychology of creative thinking, Harvard University Press, Cambridge, 1981. Ellen Winner, Invented worlds: the psychology of the arts, Harvard University Press,Cambridge, 1982. William J. J. Gordon, Synectics : the development of creative capacity, Harper & Row, New York, 1961. 384 Closure Liam Hudson, Contrary imaginations: a psychological study of the English schoolboy, Methuen, London, 1966. Mildred L. G. Shaw, On becoming a personal scientist: interactive computer elicitation of personal modelsof the world, Academic Press, London, 1980. Other design books I like : Peter S. Stevens, Handbook of regular patterns: an introduction to symmetry in two dimensions, The MIT Press, Cambridge, 1984. 385 Chapter 9 Charles Bouleau, The painter 's secret geometry: a study of composition in art, Harcourt, Brace & World, New York, 1963. Magnus J. Wenninger, Polyhedron models, Cambridge University Press, University Press, Cambridge, 1971. Magnus J. Wenninger, Spherical models, Cambridge Cambridge, 1979. D 'Arcy Wentworth Thompson, On growth and form, Cambridge University Press, Cambridge, 1961. Dover press publications are a treasure trove of design ideas . They are located at 180Varick Street, New York, NY 10014.Write them for their catalogue. Finally, find a library that takes the following journal . It is quirky and quite wonderful : Leonardo: journal of the international society for the arts, sciences, and technology. Art his t ! : X Go to museums and galleries and buy lots of postcard reproductions . A mixed bag of things Judith Wechsler, editor, On aestheticsin science, The MIT Press, Cambridge, 1978 . Benoit Mandelbrot, The fractal geometry of nature, W . H . Freeman and Company, San Francisco, 1977. Douglas R. Hofstadter, Cadel, Escher, Bach, Basic Books, New York, 1979. 386 Closure Douglas R. Hofstadter, Metamagical themas: questing for the essenceof mind and pattern, Basic Books, New York, 1985. Rudy Rucker, The fourth dimension, and how to get there, Rider and Company, London, 1985. William Poundstone, The recursive universe: cosmic complexity and the limits of scientific knowledge, William Morrow and Company, New York, 1985. Istvan Hargittai, editor, Symmetry: unifying human understanding, Pergamon Press, Oxford, 1986. Edward R. Tufte, The visual display of quantitative information, Graphics Press, Cheshire, Connecticut, 1983. Christopher Alexander, Sara Ishikawa, and Murray Silverstein, A pattern language: towns, building, and construction, Oxford University Press, New York, 1977. 387 Index ADD.POINT, 360 copying, 4 A. PIPEGON , 49 crescent machine , 68 CROSS, 126 Csikszentmihalyi, Mihaly, 380 CSTEP, 174 cubist space, 371 Delaunay, Robert, 83 Delaunay experiments, 89 Delaunay machine, 83 depth cues, 156, 338 dialects of Logo, 6 DOUBLE . RINGS , 85 E . BOX, 344 emotion grid, 234 EMPTY . BAG, 360 enclosing nephroids, 339 equipment, 5 Escher , M . C ., 340 Escher box, 340, 343, 366 EVAL, 239 exploratory facility, 381 EXPLORE , 73 eye's conception of space, 366 Farkas , Tamas , 373 Index FIVE . TARGET , 88 hyperpyramid, 378 FLAG, 174, 175 hypersphere, 378 flag modeling, 212 FLASH, 51 focusingrandomgrids, 196 FOUR.TARGET , 88 fractal, 144, 146 imaginary machines, 54 impossible space grids, 373 INGON, 121 IRSTEP , 239 Islamic art, 216, 235 FRACTALGON , 146, 330 fractal landscapes , 330-336 Japanese pen -and -ink trees, 321 fractal mountain machine, 336 Kandinsky, Wassily, 193 FRUIT, 294 Kandinsky grids, 193 FRUIT. LIST . TREE,295 Kelly, George, 58 generalize, 164, 212 Klimt generalizedGothicstonemason LAY, 180 mark, 133-135, 160 , Gustav , 326 LAY . HEX . TILES , 82 generalizednephroids, 150 LAY . SQ . TILES , 79 generalizing, 12, 16, 69, 133, 184, 188 LAY . TR . TILES , 81 Getzels,Jacob, 380 light source arguments, 371 GIVE. MOTIF, 173 lists, 165 - 169, 172 - 173, 189, 236 - 237, GIVE. PT, 166 295, 321, 359 - 361 global variables, 140 local G.MARK , 134 log grids, 230 GO. PT, 168 Logo mechanics, 2 GO. RANDOM . SCREEN , 186 L . PIPEGON grid machine, 237 grid of stylized faces, 213 variables mandalas , 140 , 51 , 158 MARK . 13, 132 Hackney, David, 231 MARK . 16, 133 hypercube, 378 mason mark designs, 128 hypercylinder, 378 Mayan -inspired grid, 179 390 Index M.BOX,201 PIP, 243 M.EXPLORE , l34 PIPEGON MF. TREE, 294 placement (as perspective device), minimal designelements,241 , 46, 47 163 modeledone-point perspective,358 placement ambiguity, 346 modeling, 115 pointillist models, 34 pool -light grids, 231 Mondrian, Piet, 162, 199, 214 premature closure, 382 motif, 164 probabilistic grids, 205 MOTIFlist, 172 probabilistic selection, 201 M. TREE,294 problem finders, 380 NARROW . SPLINES, 86 problem -solving style, 64 NEPHROID , 150 procedure presentation style, 22 nephroids, 148 NEST. DEMO , 244 trees, 319 procedures, 10 programming as craft, 3 NGON , 17, 47 pyramid graphics, 366 NHEDRON , 359, 361 quality of edges, 255 NIGHT. SHADE , 350 quality of polygon lines, 136 one-point perspective, 356 random components, 182 one-point perspectiveexperiments, 361 randomized trees, 306 randomness - within ONE.TARGET , 87 RANDOM . NUMBER, 183 overlapping designs, 264 random overlapping grids, 351 RANDOM . PLACER , 187, 188 overlapping shapes, 349 RANDOM . PLACER . X, 191 painter's algorithm, 350 personalmark, 111-114 perspective, 354 P. GET,203 numbers - a - structure , 286 , 182 random rectangular grid, 182 random screen locations , 183 RAND. TREE, 3q6 reading objects in space, 337 391 Index RECGON , 94, 96 RECORD . Pos, 178 size variation (as perspective device ), 347 rectangulargrids, 169 stone mason marks, 107 - 110, 117 recursingpolygons, 94 SPIN, 70 recursingsquares , 125 SPIN . CONGON, 70 recursingtrees, 287 recursion, 20, 92, 97, 119, 124, 144, SPINGON, 20 288 S . PIPEGON, 50 SPIRAL, 180 recursiondiagram, 99-101, 124-125 SQ, 139 recursivedesignfeatures, 119 SQ . EXPLORE, 125 RESTORE .POS,179 SQUARES, 124, 125 RIFLAG, 238 star and saw blade, 257 RIM. FLAG,349 STAREDGE, 140 RIM. ROWER , 349 STARGON, 140 RIM. RSTEP , 349 STAR . NEPHROID, 152 RING. DEMO , 269 stars, 137 RINGS,269, 270 state transparency ROT,237 , 65, 70, 175 - 179, 287, 291 ROWER , 238 stopping RR, 185, 304 story boards, 169 - 171 RSTEP , 174 S . TREE, 288 rug designs , 277 STRIPES, 131 SAW . DEMO , 261 surface shading, 340 SAWGON , 260 symmetry , 163 - 164 SEED , 300 tarot Seurat, George, 321 TEEPEE, 177 SHADE , 344 teepee sha pe, 177 SHADED . DEMO , 345 Terrapin shadedpyramids, 366 three - point shadingschemes , 340 tile design, 240 392 recursive procedures deck, 159 - 160 MacLogo ,6 perspective , 357 , 22 Index zodiac, 159 tiling spinning : shapes, 78 tinkering, 4 TIPGON, 127 TIP . STARGON , 152 TP1, 178 TP2, 179 TP . DEMO, 257 TPGON, 252, 253 tree experiments, 288-290 turtle reference commands turtle space, 7 turtle walk , 8 , 25, 41 - 46, 122 - 124, 138, 149, 169 TV test pattern, 213 two- point perspective, 357 TWO . TARGET , 87 unreasonable intentions , 379 van de Velde, Henry, 321 vanishing points, 361 VERIFY , 204 visual experiments, 72-73 visual sensitivity analysis, 75 Warhol, Andy, 213 weed model , 299 WIDE . SPLINES , 86 windowing, 188-189 WING, 269 ZIP, 162 ZIPM, 162 393 The MIT Press, with Peter Denning, general consulting editor, and Brian Randell, European consulting editor, publishes computer science books in the following series: ACM Doctoral Dissertation Award and DistinguishedDissertation Series Artificial Intelligence, Patrick Winston and Michael Brady, editors Charles Babbage Institute Reprint Seriesfor the History of Computing, Martin Campbell-Kelly, editor Computer Systems, Herb Schwetman, editor Exploring with Logo, E . Paul Goldenberg, editor Foundations of Computing, Michael Garey, editor History of Computing, I . Bernard Cohen and William Aspray, editors Information Systems, Michael Lesk, editor Logic Programming, Ehud Shapiro, editor ; Fernando Pereira, Koichi Furukawa, and D . H . D . Warren, associate editors The MIT Electrical Engineering and Computer ScienceSeries Scientific Computation, Dennis Gannon, editor