|
|
1.1 ! root 1: .EQ ! 2: delim $$ ! 3: .EN ! 4: .TH IDEAL 1 ! 5: .SH NAME ! 6: ideal \- troff preprocessor for drawing pictures ! 7: .SH SYNOPSIS ! 8: .B ideal ! 9: [ ! 10: .BI \-p ! 11: ] ! 12: [ ! 13: .BI \-4 ! 14: ] ! 15: [ ! 16: .BI \-n ! 17: ] ! 18: [ ! 19: .BI \-a ! 20: ] ! 21: [ ! 22: .BI \-s ! 23: ] ! 24: [ files ] ! 25: .SH DESCRIPTION ! 26: .I Ideal ! 27: is yet another ! 28: .IR troff (1) ! 29: preprocessor for drawing figures on a typesetter. ! 30: When invoked with the ! 31: .I \-s ! 32: option, ! 33: it tries to decompose the figure into sorted short ! 34: straight lines for fast typesetting. ! 35: A line beginning `.IS' marks the start of an ! 36: .I ideal ! 37: program. ! 38: An ! 39: .I ideal ! 40: program ends with `.IE' or `.IF'; ! 41: `.IE' leaves you below the bottom of the picture, ! 42: while `.IF' (flyback) ! 43: leaves you at the same place you were when you said `.IS'. ! 44: .PP ! 45: When invoked ! 46: with the ! 47: .I \-p ! 48: option, ! 49: .I ideal ! 50: produces ! 51: .IR plot (1) ! 52: instructions. ! 53: The erases come at every `.IS', and they come fast and ! 54: furious, so you might prefer using the ! 55: .I \-4 ! 56: option, which produces instructions for a Tektronix ! 57: 4014, and waits at each `.IE' for an input character ! 58: before erasing and starting the next picture. ! 59: The ! 60: .I \-n ! 61: option produces raw ! 62: .IR ideal ! 63: output, which passes unharmed through ! 64: .IR nroff (1). ! 65: The ! 66: .I \-a ! 67: option produces output suitable for processing on the Autologic APS-5, ! 68: instead of the Mergenthaler Linotron 202. ! 69: .PP ! 70: The building block for ! 71: .I ideal ! 72: programs is a ``box''; ! 73: boxes look like C functions, ! 74: in that they are named, and delimited by braces. ! 75: They may include the following kinds of statements, ! 76: each terminated by a semicolon: ! 77: .TP ! 78: .I var ! 79: declares one or more complex variables local to the box. ! 80: Variable names are made up of letters and digits, and ! 81: start with a letter; do not use any of the following ! 82: keywords as variable names: ! 83: at, ! 84: bdlist, ! 85: boundary, ! 86: box, ! 87: conn, ! 88: construct, ! 89: draw, ! 90: exterior, ! 91: interior, ! 92: left, ! 93: opaque, ! 94: put, ! 95: right, ! 96: spline, ! 97: text, ! 98: to, ! 99: using, ! 100: var ! 101: .TP ! 102: .I equation ! 103: declares relative positions of significant points of the box ! 104: .TP ! 105: .I conn ! 106: asks for a straight-line path through named points ! 107: .TP ! 108: .I pen ! 109: asks for a box to be replicated along a line between two points ! 110: .TP ! 111: .I left ! 112: left-justifies text with respect to a point ! 113: .TP ! 114: .I text ! 115: centers text with respect to a point ! 116: .TP ! 117: .I right ! 118: right-justifies text with respect to a point ! 119: .TP ! 120: .I spline ! 121: draws a spline guided by the named points ! 122: .TP ! 123: .I put ! 124: asks for an instance of a box to be drawn ! 125: .TP ! 126: .I opaque ! 127: asks for a box to erase lines already in the picture that ! 128: are covered by its bounding polygon ! 129: .TP ! 130: .I boundary ! 131: specifies the bounding polygon for an opaque box ! 132: .TP ! 133: .I construct ! 134: builds a partial picture on a separate ``sheet of paper'' ! 135: .TP ! 136: .I draw ! 137: adds the contents of the named constructed box to the current picture ! 138: .PP ! 139: .I Ideal ! 140: expects all components of a picture to be specified as boxes; ! 141: instructions to draw the entire picture should comprise a box called ``main.'' ! 142: Boxes are remembered across .IS-.IE boundaries; ! 143: if you won't need a box again, you can reclaim the ! 144: space it requires by including the command ! 145: `...forget boxname' on a line between any .IS-.IE ! 146: pair after the last use of boxname. ! 147: Box ! 148: .I main ! 149: is an exception to this rule: ! 150: it is always forgotten when the .IE is processed. ! 151: .PP ! 152: During its first pass, ! 153: .I ideal ! 154: solves all the equations to determine the locations of all points ! 155: it needs to know. ! 156: These equations must be linear equations in complex variables, ! 157: although they may include non-linear operators: ! 158: .I ideal ! 159: plugs in for as many variables, and does as much function evaluation, ! 160: as it can before solving the linear equation. ! 161: It waits until it has absolutely no hope of reducing an equation ! 162: to a linear equation before complaining. ! 163: .I Ideal ! 164: knows about the following functions: ! 165: .TP ! 166: $ alpha [ z , w ] $ ! 167: $ ~ == z + alpha ( w - z )$, $alpha$ of the way from $z$ to $w$ ! 168: .TP ! 169: .I re (z) ! 170: real part of complex number ! 171: $z$ ! 172: .TP ! 173: .I im (z) ! 174: imaginary part of complex number ! 175: $z$ ! 176: .TP ! 177: .I conj (z) ! 178: complex conjugate of complex number ! 179: $z$ ! 180: .TP ! 181: .I abs (z) ! 182: absolute value (modulus) of complex number ! 183: $z$ ! 184: .TP ! 185: .I cis (x) ! 186: a unit vector in the direction of the real part of its argument $x$, ! 187: which is an angle in degrees ! 188: (radians if the line `...radians' appeared more ! 189: recently in the file than the line ! 190: `...degrees') ! 191: .TP ! 192: .I E (x) ! 193: $== cis ( 360 x )$ ! 194: if $x$ is measured in degrees ! 195: .TP ! 196: .I int (x) ! 197: integer part of the real part of its argument $x$ ! 198: .TP ! 199: .I angle (z) ! 200: arctangent of $im ( z ) / re ( z )$ ! 201: .PP ! 202: During the second pass, ! 203: .I ideal ! 204: draws the picture. ! 205: .PP ! 206: To draw a circle, ! 207: include the line `...libfile circle' between the .IS and .IE lines, ! 208: and ! 209: .I put ! 210: the box named ! 211: .I circle, ! 212: giving enough information that ! 213: the circle can be determined; ! 214: for instance, give the center and the radius, ! 215: or give three points through which the circle passes, ! 216: or give the center and a point on the circle. ! 217: The circle has center $center$, radius $radius$, and passes ! 218: through $z1$, $z2$, and $z3$. ! 219: .PP ! 220: To draw an arc, ! 221: include the line `...libfile arc' between the .IS and .IE lines, ! 222: and ! 223: .I put ! 224: the box named ! 225: .I arc, ! 226: again giving enough information to determine the arc; ! 227: for instance, give the center, radius, and starting and ending angles, ! 228: or give three points on the arc--where to start, where to end, and somewhere ! 229: in between. ! 230: The arc has center $center$, radius $radius$, ! 231: starts at point $start$ at angle $startang$, ! 232: passes through point $midway$ at angle $midang$, ! 233: and ends at point $end$ at angle $endang$. ! 234: If no $midway$ is specified, the arc is drawn counterclockwise ! 235: from $start$ to $end$. ! 236: .PP ! 237: The picture will be scaled to a default width of four inches ! 238: and centered in a column of six inches. ! 239: The default width can be changed by a `...width' command, ! 240: which includes a number in inches. ! 241: The default column width can be changed by a `...colwid' command. ! 242: To defeat ! 243: \f2ideal\fP's ! 244: notion of the size of the picture, you can include lines of ! 245: the form `...minx', `...miny', `...maxx', or `...maxy'; ! 246: these give the various coordinates of the bounding box of the ! 247: picture in the coordinate system used by the picture. ! 248: .PP ! 249: .I Ideal ! 250: supports both C-style comments (between /* and */ brackets, and they nest), ! 251: and shell-style comments (between # and newline). ! 252: .SH "SEE ALSO" ! 253: C. J. Van Wyk, ! 254: .I "A Graphics Language for Typesetting" (TM 79-1274-10), ! 255: C. J. Van Wyk, ! 256: .I "A Graphics Typesetting Language" (TM 80-1272-20), ! 257: C. J. Van Wyk, ! 258: .I "A Language for Typesetting Graphics" (Stanford Ph.D. Dissertation), ! 259: .SH BUGS ! 260: .I Ideal ! 261: is relatively unforgiving about syntax errors. ! 262: Bounding box computation is naive for arcs and text strings.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.