Arnaud Berlioux

Author has no known email address

# ABSTRACT

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.

INTRODUCTION

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.

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:
 (1)
where i varies from 1 to the number of points constituting the set. The number i is used to index a specific vertex from the set. It is also used to define more elaborate objects as we will see in the next two subsections.

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

• a set of vertices defining the geometrical information of the pline
• a set of segments built on these vertices defining the topological information of the pline
The definition of each segment does not depend on that of its neighbors but rather on the numbers i of the vertices that bound the segment [see (1)].

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

• a set of vertices defining the geometrical information of the tsurf
• a set of triangles built on these vertices defining the topological information of the tsurf
The definition of each triangle does not depend on that of its neighbors but rather on the numbers i of the vertices that are apices of the triangle [see (1)].

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.

Control Nodes

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.

Control Points

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.

Control Thickness

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:

• Add points to or remove points from the object
• Move some points of the object
• Apply constraints to the nodes of an object and/or between the nodes of different objects
• Update the position of the nodes of the modified objects using the interpolation process by DSI

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.

Polygonal lines

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:

• Add one node to a segment.
• Densify one segment.
• Densify all the segments of a pline.
• Split each segment of a pline into two parts.

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.

Triangulated surfaces

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.

• Split the triangles of the surface.
Each original triangle is divided into four smaller triangles. By creating more nodes, this process allows the interpolator more flexibility to produce a smoother surface.
• Move nodes.
This action locally modifies the shape and roughness of the surface. To meet the criterion of minimum roughness, the user can then update the position of the neighbors of the moved nodes by running the DSI.
• Set control nodes.
This action locally freezes the shape of surface.
• Set projected constraints.
Projected constraints, such as the control thickness constraint, are used to create specific links between surfaces.
• Smooth the geometry of the surface.
The interpolator recalculates the position of each node of the surface with respect to its movability.
• Modify the geometry of the surface to fit the given constraints.
The interpolator modifies the position of the nodes of the surface to fit a set of constraints applied locally to the nodes or globally to the entire surface.
• Beautify the triangles of the surface.
This is a complex process that modifies the triangles of the surface and/or removes some of them in order to make the triangles as close as possible to equilateral to satisfy the criterion of minimum roughness of the 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.

model
Figure 1
A 2-D slice of a GOCAD model.

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.

PROCEDURAL REFERENCE

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.

Perform one of the following procedures:

• On any machine, in a Taal, Robson, or Spur window, type XGOCAD.
• On Spur only, in a Spur window, type SGOCAD to display the surfaces as a continuum rather than a discrete set of points connected by lines.
The Terminal window appears, with buttons for the , , , , and menus.

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

1.
2.
Click the top left and bottom right corner of the camera.
To pilot the camera

The Camera Pilot window appears.
To setup the camera

The camera is set back to its original position.
To change the background color
1.
2.
When the Color Manager window appears, click the panel for the color you choose.
To destroy a camera
1.
2.
Click inside the camera you want to destroy.

1.

The GFile Selector window appears.
2.
Click to select the type of object you want to load: such as surface (tsurf), curve (pline), pointset (vset), or partition (model file).
3.
To name the selected object:
• If you want to keep the same name as the object file name for the object inside the GOCAD memory, double-click the file name in the Selection box.
• If you want to give the object inside the GOCAD memory a name different from the object file name, click only once the file name in the Selection box, and then click in the field Object Name and type the new name.

Displaying objects

To display an object

1.

The Show Objects Dialog window appears.
2.
Double-click the name of the object you want to display.

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

1.
2.
Click the object whose attributes you want to modify.

The Attribute Manager window appears, with the name of the corresponding object at the top.

3.
For each attribute:
• Switch the small square on the left side to set on/off the display of the corresponding attribute.
• Click inside the colored rectangle on the right side to select a color for the attribute.
• When a window with colored squares appears, click the square of the desired color.
4.
When you have finished modifying the object, click or to make the changes appear.

Moving nodes

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

1.
2.
Click the node you want to move.
3.
Click the position inside the camera where you want to move the 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

1.
2.
Click the surface you want to beautify.
To switch triangles on the surface
1.
2.
Click the surface you want to beautify.

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

1.
2.
Click one of the following options:
• MOVEX, MOVEY, or MOVEZ, to allow all the nodes of the object to move in the x, y, or z direction only.
• MOVEXY, MOVEYZ, or MOVEXZ, to allow all the nodes of the object to move along the plane xy, yz, or xz only.
• MOVEXYZ, to allow all the nodes of the object to move in any direction (the default case).
To run the DSI
1.
2.
Click the object you want to smooth.

Applying and removing control nodes

Control nodes correspond to fixed points of an object that the DSI cannot move.

To apply control nodes

• To one node:
1.
2.
Click the node where you want to put a control node.
• To the border of a surface:
1.
2.
Click a node or a segment of the border of the surface on which you want to put control nodes (all nodes on that border will become control nodes.)
To remove control nodes
• At one node:
1.
2.
Click the control node you want to remove.
• On the border of a surface:
1.
2.
Click the border where you want to remove all the control nodes.
• Everywhere on the object:
1.
2.
Click the object whose control nodes you want to remove.

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

1.
2.
When the Prompt window appears, click in the Thickness field, type the value of the thickness you want to set between the two surfaces, and press return or click .
3.
Click two surfaces: the second one controls the position and the geometry of the first one.

The link between each node of the first surface and the second surface is materialized by straight lines.
4.

The interpolator updates the position of the nodes of the first surface clicked with respect to the new constraint.
To apply a control points constraint
1.
2.
Click the surface that will be attracted by the set of points.
3.
Click the set of points that will attract the nodes of the surface.

The link between each node of the surface and the corresponding point is materialized by a straight line.
4.

The interpolator moves the nodes of the surface as close as possible to the attracting set of points.
To remove a projected constraint
1.
2.
Click the projected constraint you want to remove.

The lines materializing the constraint disappear.

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 chosen position.

To densify the segments

1.
2.
When the Dialog for DENSIFY window appears, click in the Curve Name field and write the name of the line whose segments you want to densify.
3.
Click in the next field, type the maximum segment size you want, and press the return key or click .
To densify one segment
1.
2.
When the Prompt window appears, click in the field Number of Nodes to add, type the number, and press the return key or click .
To add a node on a segment
1.
2.
Click the segment where you want to add a node.

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

1.
2.
Click the surface.
To unsplit the mesh
1.
2.
Click a point in the middle of the area you want to unsplit.

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 reversible.

To save the object in the default file

1.
2.
Click the object.
Save the object on the default file name composed of the GOCAD object name with the appropriate suffix, such as, .ts for a surface, .pl for a curve.
To save the object in a different file
1.
2.
When the Prompt window appears, type the name of the object.
3.
Type the file name (without the suffix) in the File Name field of the Save as window.

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 GOCAD.

To obtain a script file from the history file

1.
Edit the history file.
2.
Remove all the blank lines and any command lines you don't need.
3.
Save and rename the file.
To run a script file
1.

The Prompt window appears.
2.
Click in the Script name field, type the full name of the script file, and press the return key or click .

Manipulating projects (binary files)

To create a new project

1.

A Prompt window appears.
2.
Click in the Project name field, type the name of the project without the suffix .PJ, and press the return key or click .
To open an existing project
1.

The Project Selector window appears.
2.
Double-click the project name in the Selected Project field, or click only once the project name and once .
To close a project
• If you want to close and save the project:

• If you want to close the project without saving:

To save a project with the default name
To save a project with a different name or at a new location
1.

The Save As Dialog window appears.
2.
Click in the Directories field to select the directory where you want to put the project.
3.
Click in the File Name field, type the name of the project without the suffix .PJ, and press the return key or click .

CONCLUSIONS

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.