The aim of this paper is to give a quick overview of some of the different tools available in the GOCAD software package to build 2-D and 3-D models. With the help of this paper and the GOCAD Manual (), someone without any knowledge about GOCAD should be able to build any complex model from its representation on a sheet of paper.
GOCAD is software for manipulating complex objects in three dimensions. The GOCAD Report () explains the algorithms and the implementation of GOCAD.
This report, on the other hand, briefly explains how to build GOCAD objects and models without prior experience with the package. It first presents the ASCII format of the GOCAD objects and then shows how to modify their shape in order to produce more complex objects. Finally, the last section contains a set of commands that should help the user get started with GOCAD.
BUILDING SIMPLE OBJECTS IN GOCAD
This section briefly describes the three basic objects that the user manipulates in GOCAD and gives an example of a file in ASCII format that corresponds to each of these objects.
A set of vertices
Objects in GOCAD are composed of a set of connected points called vertices. A vertex cannot exist outside a special set called a vset, or set of vertices. In ASCII format, a vset file contains a succession of lines describing the coordinates of each point that take the following form:
To be recognized by GOCAD, a vset file must have the suffix ``.vs''. The following file is an example of a vset called ``myvset.vs''.
A polygonal line
A curve is represented by a polygonal line. A polygonal line, called a pline in GOCAD, is made of a succession of segments. Each segment is composed of two endpoint vertices. Therefore, an ASCII file corresponding to the definition of a pline should contain
To be recognized by GOCAD, a pline file must have the suffix ``.pl''. The following listing corresponds to the ASCII file of a pline composed of five points and four segments.
A pline can be closed or open, or even composed of several disconnected sets of segments, but it cannot be ramified ! That is each vertex can be shared by at most two segments.
A triangulated surface
In GOCAD, a surface is represented as a set of triangles. The three apices of each triangle are vertices. Therefore an ASCII file corresponding to the definition of such a triangulated surface, called a tsurf in GOCAD, should contain
To be recognized by GOCAD a tsurf file must have the suffix ``.ts''. The following listing corresponds to the ASCII file of a tsurf composed of five points and four triangles.
A tsurf can be an open or a closed surface, or even composed of several disconnected sets of triangles.
IMPROVING THE SHAPE OF THE BASIC OBJECTS
This section discusses interpolation between points and the modification of the shape of basic objects by adding constraints to them. It then describes some of the most commonly used constraints.
As the number of points and segments, or triangles, grows it becomes tedious to describe the position of each vertex and the complete topology of the object in ASCII files like those described in the preceding section. Instead the user defines several points with a specific initial topology and then adds more points and modifies the topology of the objects within an interactive GOCAD session in order to obtain the desired shape of the object.
When moving a vertex of an object in GOCAD (see ``Moving Nodes'' in the ``Procedural Reference'' section), it is usually necessary to update the shape of the object so that it stays smooth. This is done by recalculating the position of the vertices of the object by interpolation with respect to the new position of the modified vertex. The interpolator of GOCAD is called DSI, which stands for discrete smooth interpolator. It is possible to apply the DSI to any object composed of a set of points connected by a topology such as plines and tsurfs. [For further information about the DSI, see ().]
It is also possible to modify the geometry of an object by applying constraints on a part of, or the complete set of points constituting the object. It might be useful, for example, to limit the motion of some of the vertices of a surface so that a region of this surface stays unchanged by applying DSI, or to keep a constant distance between two surfaces bounding a geological layer of constant thickness. The following subsections present some of the most commonly used constraints that can be applied to a GOCAD object.
A control node (CN) is a vertex that the DSI cannot move. During the interpolation process, the DSI recalculates the position of all the vertices of the object and moves them in accordance to their movability. If the movability of a vertex is XYZ (the default case) it can be moved in any direction x, y, and/or z. For a control node the movability is set to 0, and the vertex keeps the same coordinates x, y, and z even if the interpolator is applied to the object. All the states between completely movable (XYZ) and non-movable (CN) exist: X, Y, Z (movable in the X, Y, or Z direction, respectively); XY, YZ, XZ (movable only in the plane XY, YZ, or XZ, respectively).
It is possible to put a control node at any vertex of an object, and also possible to free a vertex from this constraint. Control nodes are one of the most important tools in GOCAD, since by setting control nodes, applying DSI, and removing these control nodes the user can build very complex objects.
Attracting the nodes of a surface by a set of points is useful, for example, to locally modify the shape and position of geological reflectors with respect to data obtained from wells that have been drilled in the area. The attracting set of points can be any object composed of points, such as a tsurf, a pline, or a vset.
Using the Fit geometry option of the Interpolation menu, the position of the surface nodes can then be updated with respect to the position and shape of the attracting set of points.
To match the criterion of constant thickness for a layer, geologists may be interested in setting a control thickness constraint between two surfaces. With such a constraint applied to two contiguous surfaces, any process modifying one of the surfaces will automatically affect the other one, keeping the distance between the two surfaces constant and equal to the value given by the user.
BUILDING COMPLEX OBJECTS
This section first presents a general method for building complex objects, then explains in detail how to apply this method to the two most commonly used objects in GOCAD: polygonal lines and triangulated surfaces.
The general method
This section shows how, starting with one of the basic objects, it is easy to construct some very complex objects. It explains common kinds of manipulation used to achieve the building of any complex object.
Although it is easy to build simple objects, most of the time it is necessary to modify the object in order to match the existing geology, for example, in the case of a geological layer.
In order to improve the topology and the geometry of the object, the user can perform the following steps:
These steps can be performed any number of times in any order. Updating the location of the nodes of the object is useful between the other processes described and also at the end of the modifications.
Since most of the processes are not reversible, it may be helpful to save the object in ASCII format with different names at different stages of the modification.
This subsection explains how users can modify a simple polygonal line in order to obtain the curve they want to work with.
The user starts with a simple polygonal line saved in an ASCII file that contains the position of the vertices and the topologic definition of the segments constituting the line. In order to modify the line, it is necessary to open a GOCAD session and load the corresponding pline into the GOCAD memory.
The first action the user is likely to take is to add nodes to the pline. It is helpful to add new points because during the interpolation process the DSI has more flexibility to move them to produce the smoothest possible pline. It is also possible to remove some nodes from the pline to get ``flat'' parts. The user can add nodes to the pline using the following processes:
Control nodes can be put on a pline to prevent some points of the line from moving and thus control the global shape of the pline. The user can also move some of the nodes of a pline to change the local shape of the curve by running the DSI.
To obtain the desired line, the user can repeat any of these actions as needed.
This subsection explains how to modify a simple triangulated surface to obtain the surface you want to work with.
The user starts with a simple triangulated surface saved in an ASCII file containing the position of the vertices and the topological definition of the triangles constituting the surface. To modify the surface, it is then necessary to open a GOCAD session and load the corresponding tsurf into the GOCAD memory.
The following actions locally or globally modify the shape of the surface, allowing the user to build any desired surface.
BUILDING A PARTITION OF THE 3-D SPACE
In GOCAD it is possible to partition the space into domains having a constant set of properties (such as velocities or densities). Because all the functions that create, read, and interpret these partitions are implemented as 3-D operations, any 2-D partitioning of the space has to be extended into the third dimension, thereby becoming a 2.5-D model. The boundaries of the domains are, therefore, surfaces (tsurfs).
Figure model shows a 2-D slice of a model composed of six domains delimited by their boundaries. Each boundary is characterized by an interface (a triangulated surface) and a side (represented by the sign + or -).
The following listing is an excerpt of an example of a file used in GOCAD to describe the partition of the 3-D space associated with the set of interfaces. For example, the domain named Domain_4 is defined by the boundaries S2-, F-, and S3+, and the properties available in this domain are a constant velocity (2700.0 m/s), a porosity value, and a function named density( input1, output1 ) returning the density of the layer (output1) with respect to some parameters passed as argument to the function (input1).
The GOCAD library contains functions to retrieve the properties attached to a domain from the location of a point in the 3-D space.
BUILDING A SCRIPT FILE
A script file contains a collection of GOCAD commands. When working with GOCAD, the user can load this file to apply all the commands to a selected set of objects. This section describes two ways to obtain a script file.
To create a script file, the user edits a file and types all the commands required to load, display, and modify the objects of a given model. The syntax of these commands is described in the GOCAD Manual (). The following file is an example of a script file called ``myscript'':
When the user runs the script file in a GOCAD session, a new camera opens, the surface TS1 is loaded with its color set to blue, its normals displayed in black, and the background color of the camera changes to gray7.
Another way to obtain the same script file is to open a GOCAD session and perform the same actions using the menus. When you quit GOCAD, all these actions are automatically saved in the file history.tmp under the current directory (the directory where you launched GOCAD).
The capacity to edit and create script files manually is helpful when the user has several dozens of surfaces or other objects to load. In this situation, it is inconvenient to open a GOCAD session and load each object using the menus. The user will probably prefer to create a script file, type the first load command line, and then duplicate this line as many times as necessary and change its contents using the capabilities of the editor.
BUILDING A PROJECT DIRECTORY
A project directory is one that contains the binary version of GOCAD objects the user wants to keep together. This section explains what constitutes a project directory.
A script file is useful for quickly loading and displaying complicated models. One drawback of script files is that the number of objects they contain and actions they can perform on these objects slows down the loading process. Furthermore, the files of the corresponding objects have to be in ASCII format, which occupies a lot of disk space.
It is possible to create a binary version of a complete model, called a project, that gathers all the objects of the model. The project directory contains the files .universal, .File2GobjName, and .File2Link, and a collection of files named L.i and G.i where i varies from zero to the number of objects constituting the model.
The file .File2GobjName contains the description of the correspondence between each GOCAD object name and G.i, its associated binary file.
The file .File2Link contains the description of the link between objects and L.i, its associated binary file.
This section explains how to run a GOCAD session and how to perform the major actions on objects.
The syntax ... means that to access Field n you have first to press Button 1, which pops up a window or a submenu in which you have to press Button 2, and so on until you reach Field n.
For convenience, you should run GOCAD in the directory containing your objects.
To launch GOCAD
Perform one of the following procedures:
Manipulating the camera
When displaying objects in the camera, it is possible to change the point
of view by moving the camera while the objects are fixed.
To create a new camera
To load an object
To display an object
Modifying the attributes of objects
With this option you can modify the visibility of the attributes of an
object, such as the control nodes, the mesh of a surface, the vertices,
the normals to each node of a surface, and the color of the object.
To modify the attributes of an object
By moving some nodes of a surface or a line you can slowly and locally
modify the shape of the object.
To move a node
Note: This method is not very precise because the node can move in any direction and the user cannot fully control the final coordinates of the node after the move.
I have put a small function inside the grammar of GOCAD that allows the user
to move a node along the z axis by indicating the value of the z coordinate
to which the node should be moved. There is currently no menu corresponding to
this function; you call it by typing a sentence such as the following in the
Enter Command field of the terminal window of GOCAD
raise node d -1234.56
It is then necessary to click the node you want to move from its initial vertical position to the new vertical coordinate, in this case, -1234.56.
Beautifying the triangles of a surface
Beautifying is the process of improving the shape of the triangles of a surface. In general, the roughness of a surface is lower if the triangles constituting the surface are almost similar in shape and size. Therefore, the closer to equilateral the triangles are, the better. However, the user should be aware that beautifying can locally modify the topology of the surface.
To beautify a set of triangles
Note: The user has no direct control over the result produced by the beautifying process. GOCAD follows a minimum roughness criterion, that is, that the triangles of a surface are modified until the topology of the surface has reached its minimum roughness !
Running DSI -- movability
The DSI is the interpolator of GOCAD. To smooth an object it quickly
recalculates the position of the nodes of the object when you change their
locations or apply a new set of constraints.
To change the movability of the nodes of an object
Applying and removing control nodes
Control nodes correspond to fixed points of an object that the DSI cannot move.
To apply control nodes
Setting and unsetting projected constraints
A projected constraint is a constraint by which a physical link is built
between the set of points constituting the two objects in order to modify
one of the objects. The control thickness and control points constraints
belong to this category.
To apply a control thickness constraint
Densifying the segments of a polygonal line
The user can add more nodes on the segments of a polygonal line either
by densifying all the segments of the line at once, or by densifying only
one segment of a line, or occasionally by adding a node on a segment at a
To densify the segments
Splitting and unsplitting the mesh of a surface
The splitting process is useful for obtaining more triangles out of an initial
set. Each original triangle of the surface is split into four new smaller
triangles. The unsplitting process, however, is applied only to a portion of
a surface (commonly a few triangles around the point clicked on the surface).
To split the mesh
Saving objects (ASCII files)
Saving different copies of an object can be very useful when modifying its
shape because some processes, such as splitting or beautifying, are not
To save the object in the default file
Using a script file
During a GOCAD session, all the actions performed on objects are saved
automatically in a history file (history.tmp) when the user quits
To obtain a script file from the history file
Manipulating projects (binary files)
To create a new project
GOCAD, the final frontier. These are the voyages of the GOCAD user, a continuing mission to explore strange new spaces, to seek out new models and new objects, to boldly go where no user has gone before.