2. Exercises
2.1 Triangle Subdivision
Place the caret in the Gargoyle viewer that is associated with the MatchTool (see section 1.1). Click "Triangle" in the Shapes Menu. In the MatchTool, click the leftmost Fetch button (right above the word CHARACTERISTICS). You may need to put the input focus back in the Gargoyle viewer (ShiftLeftMouse will do this). Probably nothing visual will happen. You have fetched the triangle into the Search pane of the MatchTool, but it is off the screen. Click the CenterSel button to the right of Fetch in the MatchTool. You should now see the triangle. You have specified the search pattern.
In Gargoyle build the following picture so that its three extreme vertices coincide to the vertices of the original triangle (each of these new triangles has half the edge-length of the original):
[Artwork node; type 'Artwork on' to command tool]
Select these three triangles (and nothing else) and click the rightmost Fetch button on the MatchTool. Then hit the rightmost CenterSel button in the MatchTool. The three triangles should appear in the Replace pane of the MatchTool.
In the set of options near the right edge of the MatchTool, turn on "ScaleInv". This allows the MatchTool to search for triangles regardless of size. You have specified the replacement pattern.
Back in Gargoyle, delete everything but a single triangle. Scale it up (Gargoyle scale, not BiScrollers Scale) to almost fill the viewer. You have specified the starting illustration. It is time to try searching and replacing.
In Gargoyle, deselect everything (LeftMouse in empty space) and place the caret above the triangle (ShiftLeftMouse). In the MatchTool, click Find. The triangle will become selected and the caret will move down to be at the same height as the top of the triangle. In the MatchTool, click Yes. Your triangle should be replaced by three triangles.
Again, place your caret above all of the triangles in Gargoyle and click Find in the MatchTool. In the MatchTool, click Yes three times. Each of the three triangles should be replaced by three more triangles.
Again, place your caret above all of the triangles. This time, click ChangeAll in the MatchTool. You should now have a picture that looks like this:
[Artwork node; type 'Artwork on' to command tool]
Experiment further. Place the caret at an intermediate height and do a few Finds. Notice that the MatchTool finds the first triangle at that height or below. Try clicking the Find button with the Right mouse button a few times. Now the search goes up from the caret position. If you Middle-click ChangeAll the caret is automatically moved above all shapes before substitution begins, so all shapes participate in the search. Otherwise, only the shapes below the caret participate in the search.
If you make a mistake, you will want to clear the Search and Replace areas of the MatchTool and try again. You can do this by placing the input focus in these areas (LeftMouse will do) and using CTRL-D followed by DEL.