AlgebraicSurfacesDoc.tioga
James Rauen, August 27, 1986 8:45:02 pm PDT
ALGEBRAIC SURFACES
CEDAR 6.1 — FOR INTERNAL XEROX USE ONLY
Algebraic Surface Tool
Interactive Rendering of Algebraic Surfaces
James Rauen


Release as: [Cedar]<CedarChest6.1>Documentation>AlgebraicSurfacesDoc.tioga
© Copyright 1986 Xerox Corporation. All rights reserved.
Abstract: This package provides a tool for interactively exploring and rendering algebraic surfaces.
Created by: James Rauen and Dennis Arnon
Maintained by: Dennis Arnon <Arnon.pa>
Keywords:
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Introduction
Exploring Algebraic Surfaces
An algebraic surface is a two-dimensional surface that exists in three-dimensional Euclidean space. It is defined by an equation P(x, y, z) = 0, where P is a polynomial in the three variables.
It is often difficult to understand the geometry of such surfaces; the purpose of this tool is to aid in studying their topology.
The method by which the exploration is done can best be described by analogy. Think of yourself as flying a spaceship through the vast reaches of 3-space. You have a large rectangular window in the front of your ship. Looking out through the window you can see some of the objects inhabiting 3-space.
There is a means to describe your position and orientation. Your position, easy enough, is defined by a point (x, y, z). Your orientation is defined by two vectors: a forward vector, which points in the direction you are facing, and an up vector, which points in the direction you think is up. These two vectors are, necessarily, perpendicular.
You have all the necessary controls to maneuver your ship. You may change your position by moving parallel to a coordinate axis, moving forward, moving backward, or jumping to any given point (hyperspace). You also have power over the objects you are viewing. You can add new ones, delete them, make all or parts of them visible or invisible, or change their colors.
Getting Started: first cut
This describes how to explore some surfaces for which the algebraic analysis has already been done.
To get the files you need, do a bringover -p [Cedar]<CedarChest6.1>Top>AlgebraicSurfaces.df. Included in the files brought over is a load file, InstallSurfaceTool.load. Type "InstallSurfaceTool" to the Command Tool. This will switch on the color display to 24bpp mode, run some BCD files, and then execute the command "SurfaceTool". An icon will appear on the left side of the display. For additional instances of the tool (you're on your own if you have more than one simultaneously), type "SurfaceTool" to the Command Tool.
(for now:) Close any viewers on the color monitor (important!), then open the SurfaceTool icon and double-click "Open" at the top left. A color viewer named "Algebraic Surface Viewer" should open on the color display.
The tool is now ready to use. You have six surfaces in your directory that you can load in and explore; their filenames all end with ".surface", e.g. "Sphere.2.16.surface". See Section 4, "Loading Surfaces", for how to get them in.
2. Getting Started second cut: Algebraic analysis and covering set generation
[This section incomplete]
This is the first thing you have to do when you have a new surface you want to display. It is done on the Vax.
In general, you need a name and a polynomial.
There are three parameters in covering set generation: number of decimal places of accuracy in points, spacing of points, and integer reach.
File generation
First step
$ Do.2.4.2 prod2
Mon Sep 22 10:31:18 PDT 1986
ENTER 1(ORIGINAL ALG) 3(CLUSTERING)
ENTER VARIABLE LIST
ENTER 0(CAD ONLY) OR 1(QE)
ENTER NUMBER OF INPUT POLYNOMIALS
ENTER POLYNOMIALS


2 X Y Z + Y Z + X Z - 3 X Y - 2 Y - 2 X - 1

ENTER DIMENSION UP TO WHICH DEFINING FORMULAS TO BE CONSTRUCTED
VALUE OF MU IS 6000

PRIME LIST GENERATION
PRIME LIST HAS LENGTH 521
FIRST PRIME IS 536860913
LAST PRIME IS 536870909
Mon Sep 22 10:31:46 PDT 1986
SELECT ITEM (M FOR MENU)
SELECT ITEM (M FOR MENU)
SELECT ITEM (M FOR MENU)
ENTER N>0 (N-PLACE APPROXIMATE POINTS)
ENTER RATIONAL STEP SIZE
ENTER INTEGER REACH
SELECT ITEM (M FOR MENU)
126.3u 13.6s 2:55 79% 402+4338k 51+88io 189pf+0w
$
PupFtp
$ pupftp ivy
connection opened with ivy
< Halls of Ivy 1.38.1L, File server of February 14, 1984; 3 users out of 9
*
login (as remote user) arnon (password)
May I encrypt and store this password ? (yes or no):
yes
*
store (local file) prod2.cador (new file) to remote file: prod2.cador
It looks like prod2.cador is a Text file
!
28805 Bytes sent in 2 seconds, 115220 baud
*
store (local file) prod2.covor (new file) to remote file: prod2.covor
It looks like prod2.covor is a Text file
!!
35206 Bytes sent in 2 seconds, 140824 baud
*
quit confirm with return
connection closed
$
3. Overview of the Control Panel
Menu Buttons
There are currently two: Open and View. Open is (hopefully) a temporary feature; its sole purpose is to open the color viewer. It should only be used once. View draws a new frame on the color monitor.
Position/Orientation Subviewer
Here are the myriad controls that let you maneuver in 3-space. Because there is a significant delay in generating each frame, playing with these controls does not yield an immediate response. Instead, you tweak and twiddle the buttons until you have a new position and orientation, then click the View menu button to make a new frame.
Active Surfaces Subviewer
These controls let you manipulate the surfaces in 3-space. At the upper left are three boxes marked "A", "B", and "C". Next to these boxes are small text viewers. The boxes are used to select surfaces. If a surface is selected, its box will be inverted. The text viewers display the name or formula of each surface. Following the text viewer is a symbol indicating whether or not a surface is hidden and/or has been loaded.
In the upper right are several buttons that provide various operations on a selected surface.
Beneath all these is a facility for loading surfaces from a file server. There is space for a working directory and a file name. The Load button loads the indicated file.
Lining the bottom are Cell Operations buttons. These let you select individual cells from the selected surface.
Ray Tracer Subviewer
Allows you to specify a file name and invoke a ray tracing program. This generates a high-quality image of your current view and writes it to three AIS files. It takes a long time, so be prepared to wait.
File Conversion Subviewer
This is a utility that converts CAD and covering-sets files into usable surface files.
4. Surface I/O and Selection
Loading Surfaces
Up to three surfaces may be loaded (active) at a time. To load a surface, first put its directory and filename in the "Working Dir" and "File name" fields. The titles of these fields are themselves buttons which will select the field names. With the full pathname installed, click on "Load". The surface will be loaded into the first available slot (A, B, or C). If there are no more slots, if the file is not found, or if the file is incorrectly formatted, an error will flash in the message window.
Once the surface is loaded, a new frame will automatically be drawn. The indicator next to the surface name will change from "-" to "Y", signifying that the surface is loaded and visible.
Selecting Surfaces
Most buttons in the Active Surfaces subviewer act only on the selected surface. A selected surface is indicated by its label (A, B, or C) being inverted. To select a surface, click on the box containing its label.
Deleting Surfaces
Click on "Delete" to delete the selected surface. A new frame is drawn, and the indicator by the surface name will change to a "-".
Hiding and Revealing Surfaces
To keep a surface active, but not displayed, it must be hidden. Clicking on "Show/Hide" will invert the state of the selected surface. A visible surface is marked with a "Y" indicator; a hidden surface is marked with an "N".
Names and Formulas
A surface is displayed in the tool either by its name or by its formula. To switch between the two for the selected surface, click on "Name/Formula".
Surface Colors
Not yet implemented. Sorry.
5. Changing Position and Orientation
Indicators
Position is indicated by the three labels marked "x =", "y =", and "z =" at the left of the Position/Orientation subviewer. The unit forward and up vectors are displayed towards the right of the viewer.
Changing Position and Orientation
Let's say you want to make a somewhat complicated maneuver, like back up three steps and turn left. You probably don't want to wait for 3 intermediate frames to be rendered. That's the rationale for the following mechanism.
To change position or orientation, play around all you want with the buttons in the subviewer. The position, forward, and up indicators will be dynamically updated, but the view on the color display will not. When you've got your new coordinates "plotted and on the board", click on the "View" menu button to get a new picture.
Parallel Translation
To move parallel to one of the coordinate axes, use one of the six buttons "+X", "+Y", "+Z", "-X", "-Y", "- Z". They currently increment their respective components by 0.1; perhaps the increment could be changed?
Hyperspace
To warp to any position, select (in some other viewer) a number and click on "x=", "y=", or "z=". The number you selected will be installed as the x, y, or z coordinate of position.
Forwards and Backwards
Clicking these will move you parallel to your forward vector. The distance moved is 0.1.
Changing orientation
This is accomplished sort of how you would do it in an airplane. Turning (left or right) rotates you around your up vector. Rolling tilts you on your side, left or right, by rotating you around your forward vector. Climbing and diving are a rotation around your "left-to-right" vector, the cross product of forward and up.
To make any of these rotations, click on one of the Turn, Roll, or Dive buttons. Each click rotates you 15 degrees.
Fancy maneuvers
To get these, click the "Fancy maneuvers" button. You will get a pop-up menu containing more options than you could possibly imagine. Most are self-explanatory. Remember to click "View" after invoking one or more of these.
6. Selecting Individual Cells
What This Means
So far, surfaces have only been selectable as a whole. The Cell Operations provide a way to select components of surfaces.
A surface's cylindrical algebraic decomposition breaks it into a set of zero-cells (points), one-cells (curve segments), and two-cells (parts of surfaces). These are rendered, respectively, as dark circles, dark segments, and colored triangular meshes.
The individual cells may be visible or hidden. Initially, they all default to being visible. Note that there are two levels of visibility: each surface has a visible/hidden attribute, and each cell has a visible/hidden attribute. If the surface is hidden, none of its cells is displayed. If the surface is visible, all the cells that are visible are displayed.
The following operations act on the cells of the selected surface. They are invoked by clicking on the appropriate "Cell Ops" button.
List Cells
A pop-up menu containing the indices of all the cells of the selected surface appears. Visible cells are marked with a "V". Any mouse click erases the menu; selections from it are ignored.
Hide All
All cells of the selected surface are made hidden. A new frame is drawn.
Hide One
A pop-up menu, as in "List Cells", appears. Select a cell to hide, or click outside the menu to cancel. If a cell is selected, it is hidden and a new frame is drawn.
Reveal All
All cells of the selected surface are made visible. A new frame is drawn.
Reveal One
A pop-up menu, as in "List Cells", appears. Select a cell to reveal, or click outside the menu to cancel. If a cell is selected, it is made visible and a new frame is drawn.
7. Ray Tracing
Generated Image
The ray tracer is a program that creates a high-quality image of the objects in your view. It uses the mathematical definition of cells and surfaces, rather than the triangular approximations, to calculate an exact image of the scene. The image is anti-aliased and rendered against a black background. The output of the ray tracer is three AIS (array of intensity samples) files, one each for red, green, and blue. The AIS image may be viewed with the PreView tool (separate), and from that tool converted to an Interpress master.
Mechanism
Fill in the fields for resolution, directory, and AIS file name. Click on "Do It" to start the tracing. Three files will be written; their names are the file name given with "-red.ais", "-green.ais", and "-blue.ais" appended. Be forewarned that the tracing is usually very slow. Speed depends on the resolution and the degree of the surface(s) being traced.
8. File Format Conversion
File Formats
Two source files are needed: a CAD file (containing a symbolic description of a surface's decomposition) and a covering sets file (containing information to generate a triangulation of a surface). The conversion procedure takes these two files and writes a surface file. The surface file can then be loaded into the tool and displayed.
Mechanism
Fill in the five fields (source directories, source files, and destination file). To select a field, click on its label. For example, click on "CAD:" to select the CAD file field. When all fields are filled in, click on "Do It". The source files will be loaded and translated; then the surface file will be written. Format errors or file server errors will cause a error to be flashed in the message window.
9 User Profile Options
The following entries in your profile will allow the directory fields in the tool to default. Use whatever directories you want.
AlgebraicSurfaces.ActiveDir: ///Users/Rauen.pa/Surfaces/
AlgebraicSurfaces.SourceDir: ///Users/Rauen.pa/Surfaces/
AlgebraicSurfaces.DestDir: ///Users/Rauen.pa/Surfaces/
AlgebraicSurfaces.ImageDir: ///Users/Rauen.pa/Surfaces/
These are the four default directories that appear in the tool. ActiveDir is the directory from which .surface files are read; SourceDir and DestDir are for file conversion; and ImageDir is the directory that ray tracings are written to.
DestDir and ImageDir must be local directories; ActiveDir and SourceDir may be local or remote.