Alpha_1 User's Manual


a1ps program - Hardcopy With PostScript

Table of contents for this page:

Description of the a1ps Program

a1ps is a utility program for converting Alpha_1 data (".a1" files) into PostScript files for printing on the Apple LaserWriter (or any device that understands PostScript.) The program pushes lines, polylines, polygons, curves and surfaces through any viewing transformations in the input stream and through the perspective transformation. Lines and polylines go into the output stream as is. Curves and surfaces are turned into polylines which represent control polygons and meshes, smooth curves, or isoparametric lines using the same routines that view now uses. The output form is controlled by the flags described below.

The viewing programs should be used to position the objects to be printed; a1ps expects the data to be in the usual [-1,1] space. The program attempts to make some intelligent adjustments for the positioning of the [-1,1] box on the page, centering it horizontally and vertically as appropriate. A1ps does set a clipping box to the [-1,1] boundary, so you will not see parts of the image that lie outside this area. The output of the a1ps program includes the bounding information required for Encapsulated PostScript support.

Runing the a1ps Program

Usage:
a1ps files
Output
postscriptfile A PostScript file which will generate an image of the input data.
files
objectstream The objects that should be in the image.

Option switches for the a1ps Program

The switches for a1ps are described below. Values can be set either on the command line or in a state file, using the a1defaults mechanism . Default values are shown in parentheses.
a1ps.centerposn
(0.0)
a1ps.height
(11.0) This sets the height in inches which the figure is to occupy on the page. The default is normally 11 inches, unless scribe mode is specified (see below) in which case the default is 9 inches because the usual top and bottom margins in scribe are 1 inch.
a1ps.width
(8.5) This sets the width of the figure.
a1ps.scribemode
(off) Positioning of the figure on the page will take into account 1 inch margins on all four edges of the page. The lower left corner of the figure (-1,-1) will be in the bottom of the figure area you tell scribe to use and flush against the left margin. The spacing command you give to scribe should be the same as the psheight value given to a1ps.
a1ps.narrow
(off) If on, indicates that the figure is tall and skinny. Normally, a1ps wants to scale your figure according to the height you give it. However, if the height is greater than the width available on the page, scaling by the full height will lose some of the edge area of the [-1,1] space. So a1ps scales only up to the available width of the page. If you know that your figure is mostly in the middle (horizontally), or if you don't care if it falls off the sides, then setting the narrow flag gives you maximum scaling in the vertical direction.
a1ps.perspective
(on) A1ps normally applies a perspective transformation to the input data. (2D input points are augmented to 3D with a Z value of 0.) If you need your data treated as 2D data, this flag causes the z coordinates (if present) to be ignored and no perspective to be applied. This is important for data that is truly 2D, because the implied Z=0 causes the perspective to shrink the picture.
a1ps.plusvertex
(off) If on, draw points as little "+" marks.
a1ps.plussize
(0.01) Size in object space of "+" marks to be drawn if the "a1ps.plusvertex" option is on.
a1ps.vertexsize
(0.005) Size in object space of dots drawn for vertices.
a1ps.translatex
(0.0) Translate the figure the specified number of inches in X.
a1ps.translatey
(0.0) Translate the figure the specified number of inches in Y.
a1ps.polyborder
(off) Draw polygons with borders instead of filled.
a1ps.isolines
(on) As for viewing programs.
a1ps.meshes
(off) As for viewing programs.
a1ps.polys
(off) As for viewing programs.
a1ps.reversenorms
(off) As for viewing programs.
a1ps.scale
(1.0) As for viewing programs.
a1ps.crvfineness
(5.0) As for viewing programs.
a1ps.smoothcrvs
(on) As for viewing programs.
a1ps.srffineness
(30.0) As for viewing programs.
a1ps.minrefinement
(0) As for viewing programs.
a1ps.srfnorms
(off) As for viewing programs.
a1ps.timenow
(0.0) As for viewing programs.
a1ps.usecolor
(off) If on, pay attention to the "color" attribute of objects and output color PostScript. Note that PostScript has a default background which is the same as the color of the paper used, usually white. Setting a white color attribute will make an object invisible on the white background. Objects without color attribute are printed in the default foreground color, which is black. On black and white PostScript printers, such as the Apple LaserWriter, colors are printed in the equivalent grey scale values.
a1ps.linewidth
(0.0) Width in object space for line drawings. The default width is 0.0 which produces the thinnest lines the device is able to do. This can be overriden by an individual object with the attribute "width."
a1ps.hiddeneps
(-1) A positive epsilon value turns on the hidden line detection option. The epsilon value is used in the ray/surface intersection and visibility test. This can be overriden by an individual object with the attribute "hidden_eps."
a1ps.hiddendash
(null) Like the dash attribute (see below), but is for hidden lines only. The default hiddendash is NULL which turns off any drawing of hidden lines. This can be overriden by an individual object with the attribute "hidden_dash."
a1ps.hiddenwidth
(-1) Like the linewidth option, but is applied to hidden lines only. A negative value, the default, uses the same value set by the linewidth option or the width attribute. This can be overriden by an individual object with the attribute "hidden_width."
a1ps.hiddensplit
(on) If on, the default, line drawings are intersected and split to properly clipped between hidden and visible potions. For better results, intersection curves and silhouette of surfaces should be included in the input data. There is really no good reason to turn it off in normal operation.

Data for the a1ps Program

A1ps interprets several special attributes in the input stream which may be helpful in generating figures.

Text objects may be included in the input stream as well. These can be constructed and output easily from c_shape_edit, but are not used by other system utilities (like the viewing programs and render). A1ps will map the position of the text string in the same way as other geometric data.

Several special attributes may be associated with a text_string or placed at the top-level in the input stream to set text parameters globally. The "text_justify" attribute has an integer value. A value of 0 indicates that the text is to be left justified at the given position, 1 indicates that it is to be centered, and 2 indicates that the text is right justified at the given position. The "font" attribute has a string value indicating the name of a font to use, and the float value of the "font_size" attribute specifies the font size in the normal object definition space.

     setAttr( LJ, "text_justify", 0 );   % Left justify.
     setAttr( CTR, "text_justify", 1 );  % Center.
     setAttr( RJ, "text_justify", 2 );   % Right justify.

     setAttr( FN, "font", "FontName" );  % Use given font.
     setAttr( FS, "font_size", 0.016 );  % Size in object space.
Other attributes which are useful for controlling the appearance of a figure are "gray_level" and "width".
    setAttr( Gray, "gray_level", 0.1 );    % Intensity, in [0,1].
    setAttr( Width, "width", 0.02 );       % Width in object space.
The default width is 0.0 which produces the thinnest lines the device is able to do. Normally, lines must be very wide in order to look good with intensity values less than 0.0 (black). Default width lines may disappear completely with any other intensity value than black, depending on their slope.

You can make dashed lines using a1ps by adding a "dash" attribute to the objects before dumping them from shape_edit. The attribute value is a string which is used for the dashing option in PostScript (see that manual for full details). As an example:

     setAttr( PLine, "dash", "[0.1] 0" );
The line will be drawn with dashes 0.1 unit long with spaces 0.1 unit long. The first dash will start at the beginning and will be 0.1 unit long.
     setAttr( QLine, "dash", "[0.1] 0.15" );
This line will be drawn with dashes 0.1 unit long and will start with a gap 0.05 units long.
     setAttr( DotDashLine, "dash", "[0.1 0.01 0.01 0.01] 0" );
DotDashLine will be drawn with a pattern starting with a long dash (0.1 unit), a short gap (0.01 unit), a short dash, and a short gap (and then repeating).

Note that the dash dimensions are specified in screen space (after any viewing transformation has been applied), not in object space. The a1ps program attempts to verify that a dash specification is correctly formatted, but doesn't do a complete job of it.


Alpha_1 User's Manual Home Page
Alpha_1 User's Manual. Version 98.01.
Copyright © 1998, University of Utah
a1-web@gr.cs.utah.edu