Server IP : 195.201.23.43 / Your IP : 18.217.163.75 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/groff/html/ |
Upload File : |
<!-- Creator : groff version 1.22.4 --> <!-- CreationDate: Sat Mar 21 12:27:30 2020 --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="generator" content="groff -Thtml, see www.gnu.org"> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="Content-Style" content="text/css"> <style type="text/css"> p { margin-top: 0; margin-bottom: 0; vertical-align: top } pre { margin-top: 0; margin-bottom: 0; vertical-align: top } table { margin-top: 0; margin-bottom: 0; vertical-align: top } h1 { text-align: center } </style> <title>pic-3.html</title> </head> <hr> [ <a href="pic-2.html">prev</a> | <a href="pic-4.html">next</a> | <a href="pic.html">top</a> ] <hr> <h2>3. Basic PIC Concepts <a name="3. Basic PIC Concepts"></a> </h2> <p style="margin-top: 1em">Pictures are described procedurally, as collections of objects connected by motions. Normally, <b>pic</b> tries to string together objects left-to-right in the sequence they are described, joining them at visually natural points. Here is an example illustrating the flow of data in <b>pic</b> processing:</p> <p align="center" style="margin-top: 1em"><img src="img/pic1.png" alt="Image img/pic1.png"></p> <p align="center" style="margin-top: 1em">Figure 3-1: Flow of <b>pic</b> data</p> <p style="margin-top: 1em">This was produced from the following <b>pic</b> program:</p> <p style="margin-left:10%; margin-top: 1em"><small>.PS <br> ellipse "document"; <br> arrow; <br> box width 0.6 "\fIgpic\/\fP(1)" <br> arrow; <br> box width 1.1 "\fIgtbl\/\fP(1) or \fIgeqn\/\fP(1)" "(optional)" dashed; <br> arrow; <br> box width 0.6 "\fIgtroff\/\fP(1)"; <br> arrow; <br> ellipse "PostScript" <br> .PE</small></p> <p style="margin-top: 1em">This little program illustrates several <b>pic</b> basics. Firstly, we see how to invoke three object types; ellipses, arrows, and boxes. We see how to declare text lines to go within an object (and that text can have font changes in it). We see how to change the line style of an object from solid to dashed. And we see that a box can be made wider than its default size to accommodate more text (we’ll discuss this facility in detail in the next section).</p> <p style="margin-top: 1em">We also get to see <b>pic</b>’s simple syntax. Statements are ended by newlines or semicolons. String quotes are required around all text arguments, whether or not they contain spaces. In general, the order of command arguments and modifiers like “width 1.2” or “dashed” doesn’t matter, except that the order of text arguments is significant.</p> <p style="margin-top: 1em">Here are all but one of the basic <b>pic</b> objects at their default sizes:</p> <p align="center" style="margin-top: 1em"><img src="img/pic2.png" alt="Image img/pic2.png"></p> <p align="center" style="margin-top: 1em">Figure 3-2: Basic <b>pic</b> objects</p> <p style="margin-top: 1em">The missing simple object type is a <i>spline</i>. There is also a way to collect objects into <i>block composites</i> which allows you to treat the whole group as a single object (resembling a box) for many purposes. We’ll describe both of these later on.</p> <p style="margin-top: 1em">The box, ellipse, circle, and block composite objects are <i>closed</i>; lines, arrows, arcs and splines are <i>open</i>. This distinction is often important in explaining command modifiers.</p> <p style="margin-top: 1em">Figure 3-2 was produced by the following <b>pic</b> program, which introduces some more basic concepts:</p> <p style="margin-left:10%; margin-top: 1em">.PS <br> box "box"; <br> move; <br> line "line" ""; <br> move; <br> arrow "arrow" ""; <br> move; <br> circle "circle"; <br> move; <br> ellipse "ellipse"; <br> move; <br> arc; down; move; "arc" <br> .PE</p> <p style="margin-top: 1em">The first thing to notice is the <i>move</i> command, which moves a default distance (1/2 inch) in the current movement direction.</p> <p style="margin-top: 1em">Secondly, see how we can also decorate lines and arrows with text. The line and arrow commands each take two arguments here, specifying text to go above and below the object. If you wonder why one argument would not do, contemplate the output of <b>arrow "ow!"</b>:</p> <p align="center" style="margin-top: 1em"><img src="img/pic3.png" alt="Image img/pic3.png"></p> <p align="center" style="margin-top: 1em">Figure 3-3: Text centered on an arrow</p> <p style="margin-top: 1em">When a command takes one text string, <b>pic</b> tries to place it at the object’s geometric center. As you add more strings, <b>pic</b> treats them as a vertical block to be centered. The program</p> <p style="margin-left:10%; margin-top: 1em">line "1"; <br> line "1" "2"; <br> line "1" "2" "3"; <br> line "1" "2" "3" "4"; <br> line "1" "2" "3" "4" "5";</p> <p style="margin-top: 1em">for example, gives you this:</p> <p align="center" style="margin-top: 1em"><img src="img/pic4.png" alt="Image img/pic4.png"></p> <p align="center" style="margin-top: 1em">Figure 3-4: Effects of multiple text arguments</p> <p style="margin-top: 1em">The last line of Figure 3-2’s program, ‘<b>arc; down; move; "arc"</b>’, describing the captioned arc, introduces several new ideas. Firstly, we see how to change the direction in which objects are joined. Had we written <b>arc; move; "arc"</b>, omitting <b>down</b> the caption would have been joined to the top of the arc, like this:</p> <p align="center" style="margin-top: 1em"><img src="img/pic5.png" alt="Image img/pic5.png"></p> <p align="center" style="margin-top: 1em">Figure 3-5: Result of <b>arc; move;</b></p> <p style="margin-top: 1em">This is because drawing an arc changes the default direction to the one its exit end points at. To reinforce this point, consider:</p> <p align="center" style="margin-top: 1em"><img src="img/pic6.png" alt="Image img/pic6.png"></p> <p align="center" style="margin-top: 1em">Figure 3-6: Result of <b>arc cw; move;</b></p> <p style="margin-top: 1em">All we’ve done differently here is specify “cw” for a clockwise arc (“ccw” specifies counter-clockwise direction). Observe how it changes the default direction to down, rather than up.</p> <p style="margin-top: 1em">Another good way to see this via with the following program:</p> <p style="margin-left:10%; margin-top: 1em">line; arc; arc cw; line</p> <p style="margin-top: 1em">which yields:</p> <p align="center" style="margin-top: 1em"><img src="img/pic7.png" alt="Image img/pic7.png"></p> <p align="center">Figure 3-7: Result of <b>line; arc; arc cw; line</b></p> <p style="margin-top: 1em">Notice that we did not have to specify “up” for the second arc to be joined to the end of the first.</p> <p style="margin-top: 1em">Finally, observe that a string, alone, is treated as text to be surrounded by an invisible box of a size either specified by width and height attributes or by the defaults <b>textwid</b> and <b>textht</b>. Both are initially zero (because we don’t know the default font size).</p> <hr> [ <a href="pic-2.html">prev</a> | <a href="pic-4.html">next</a> | <a href="pic.html">top</a> ] <hr>Private