DMM Varkon® Tutorial
A Beginner's Guide to the Varkon Parametric Modeling and CAD Application Development System
By David M. MacMillan


13.3 Plotting and PostScript

13.3.1. Generating a Plot File

Not Finished

13.3.2. Converting a Plot File to PostScript

13.3.2.1. Basic Conversion

Not Finished

13.3.2.2. Rotation for Landscape Mode

If a US Letter sized (8.5 x 11") or an A4 sized piece of paper is held "vertically," with a short side at the bottom, this is termed "portrait" mode. A 90 degree clockwise rotation of the paper from portrait mode puts it in "landscape" mode, with a long side at the bottom.

To rotate an image that ordinarily prints in portrait mode (as, for example, a Varkon plot file) so that it appears on the page in landscape mode, it is necessary to rotate the image 90 degrees counterclockwise (this is identical in effect to rotating the paper 90 degrees clockwise).

The rotation parameter of the Varkon postscript driver rotates the image counterclockwise around the lower left-hand corner. Thus, a positive 90 degree rotation will rotate the image entirely off the printed page, resulting in a blank page. This is not quite the image conversion required.

To convert from portrait to landscape, the image must simultaneously be rotated 90 degrees counterclockwise and shifted to the right so that it reappears on the page at the desired location.

The exact lower left hand corner of a plotted image is not necessarily (0,0) of the drawing. It is therefore necessary to experiment with X and Y offsets to position the image properly on the page. This is further complicated by the fact that a numerically positive X and Y offsets are interpreted as being leftward and downward motions (moving the image further off the page, in our case). The X offset must therefore be specified as negative when converting to landscape mode. However, as the default places the image slightly higher (portrait) on the page than I would like, the Y offset gets specified as positive, moving the image down a bit on the (portrait) page (i.e., left on landscape).

For example, a rectangle 265 mm wide by 205 mm high defined by the following module:

global drawing module dwgletter ();
   float xmax, ymax;
beginmodule
   xmax := 265;
   ymax := 205;
   lin_free (#1, vec(0,       0), vec(xmax,    0));
   lin_free (#2, vec(xmax,    0), vec(xmax, ymax));
   lin_free (#3, vec(xmax, ymax), vec(0,    ymax));
   lin_free (#4, vec(0,    ymax), vec(0,       0));
endmodule

can be instanced by the following active module:

GLOBAL DRAWING MODULE test2d();
BEGINMODULE
  part(#1,dwgletter());
ENDMODULE

If this is plotted to a file test2d.PLT, then this plot file can be converted to PostScript and rotated to print in landscape mode using the following invocation of the Varkon postscript driver:

postscript < test2d.PLT > test2d.ps -v90 -x-228 -y8

Such a rectangle serves as a nice border more or less 5mm from the edge of a US Letter (8.5x11") sheet.


Legal Matters

With the exception of any material noted as being in the public domain, the text, images, and encoding of this document are copyright © 1998 by David M. MacMillan.

The author has no relationship with Microform AB, and this Tutorial is neither a product of nor endorsed by Microform AB.

"Varkon" is a registered trademark of Microform AB, Sweden.

This document is licensed for private, noncommercial, nonprofit viewing by individuals on the World Wide Web. Any other use or copying, including but not limited to republication in printed or electronic media, modification or the creation of derivative works, and any use for profit, is prohibited.

This writing is distributed in the hope that it will be useful, but "as-is," without any warranty of any kind, expressed or implied; without even the implied warranty of merchantability or fitness for a particular purpose.

In no event will the author(s) or editor(s) of this document be liable to you or to any other party for damages, including any general, special, incidental or consequential damages arising out of your use of or inability to use this document or the information contained in it, even if you have been advised of the possibility of such damages.

In no event will the author(s) or editor(s) of this document be liable to you or to any other party for any injury, death, disfigurement, or other personal damage arising out of your use of or inability to use this document or the information contained in it, even if you have been advised of the possibility of such injury, death, disfigurement, or other personal damage.

All trademarks or registered trademarks used in this document are the properties of their respective owners and (with the possible exception of any marks owned by the author(s) or editor(s) of this document) are used here for purposes of identification only. A trademark catalog page lists the marks known to be used on these web pages. Please e-mail dmm@lemur.com if you believe that the recognition of a trademark has been overlooked.


Version 1.3, 1998/06/17. Feedback to dmm@lemur.com
http://www.database.com/~lemur/vk-plot.html


Go to the: