next up [*] print clean
Next: About this document ... Up: Table of Contents

Building models with GOCAD

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.

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:  
 \begin{displaymath}
\mbox{\it VRTX} \hspace*{0.2in}i \hspace*{0.2in}X_{i} \hspace*{0.2in}Y_{i} \hspace*{0.2in}Z_{i}\end{displaymath} (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

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

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:

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:

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.

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
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 \fbox {\tt Button 1}
$\Rightarrow$ \fbox {\tt Button 2}
... $\Rightarrow$ \fbox {\tt Field n}
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.

Running GOCAD

For convenience, you should run GOCAD in the directory containing your objects.

To launch GOCAD[*]

Perform one of the following procedures:

The Terminal window appears, with buttons for the \fbox {{\bf F}ile}
, \fbox {{\bf O}bject}
, \fbox {{\bf C}amera}
, \fbox {{\bf O}ptions}
, and \fbox {{\bf H}elp}
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.
\fbox {\tt Camera}
$\Rightarrow$ \fbox {\tt New}
2.
Click the top left and bottom right corner of the camera.
To pilot the camera
\fbox {\tt Camera}
$\Rightarrow$ \fbox {\tt Pilot ON}

The Camera Pilot window appears.
To setup the camera
\fbox {\tt Camera}
$\Rightarrow$ \fbox {\tt Autosetup}

The camera is set back to its original position.
To change the background color
1.
\fbox {\tt Camera}
$\Rightarrow$ \fbox {\tt Set Background Color}
2.
When the Color Manager window appears, click the panel for the color you choose.
To destroy a camera
1.
\fbox {\tt Camera}
$\Rightarrow$ \fbox {\tt Destroy}
$\Rightarrow$ \fbox {\tt One}
2.
Click inside the camera you want to destroy.

Loading objects

To load an object

1.
\fbox {\tt Object}
$\Rightarrow$ \fbox {\tt Load}

The GFile Selector window appears.
2.
Click \fbox {\tt Object Select}
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:

Displaying objects

To display an object

1.
\fbox {\tt Object}
$\Rightarrow$ \fbox {\tt Show/Hide}

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.
\fbox {\tt Object}
$\Rightarrow$ \fbox {\tt Attributes}
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:
4.
When you have finished modifying the object, click \fbox {\tt Apply}
or \fbox {\tt OK}
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Mesh}
$\Rightarrow$ \fbox {\tt Move Node}
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Mesh}
$\Rightarrow$ \fbox {\tt Beautify}
$\Rightarrow$ \fbox {\tt triangle}
2.
Click the surface you want to beautify.
To switch triangles on the surface
1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Mesh}
$\Rightarrow$ \fbox {\tt Beautify}
$\Rightarrow$ \fbox {\tt switch}
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Interpolation}
$\Rightarrow$ \fbox {\tt Set geometry movability}
2.
Click one of the following options:
To run the DSI
1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Interpolation}
$\Rightarrow$ \fbox {\tt Smooth geometry}
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 remove 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

1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Constraints}
$\Rightarrow$ \fbox {\tt set Control Thickness}
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 \fbox {\tt OK}
.
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Interpolation}
$\Rightarrow$ \fbox {\tt Fit geometry}

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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Constraints}
$\Rightarrow$ \fbox {\tt set Control Points}
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Interpolation}
$\Rightarrow$ \fbox {\tt Fit geometry}

The interpolator moves the nodes of the surface as close as possible to the attracting set of points.
To remove a projected constraint
1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Constraints}
$\Rightarrow$ \fbox {\tt unset Constraint}
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Curve}
$\Rightarrow$ \fbox {\tt Densify Segments}
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 \fbox {\tt OK}
.
To densify one segment
1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Curve}
$\Rightarrow$ \fbox {\tt Densify Segment}
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 \fbox {\tt OK}
.
To add a node on a segment
1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Points}
$\Rightarrow$ \fbox {\tt Add Point}
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.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Mesh}
$\Rightarrow$ \fbox {Split}
2.
Click the surface.
To unsplit the mesh
1.
\fbox {\tt Options}
$\Rightarrow$ \fbox {\tt Menu ON}
$\Rightarrow$ \fbox {\tt Mesh}
$\Rightarrow$ \fbox {Unsplit}
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.
\fbox {\tt Object}
$\Rightarrow$ \fbox {\tt Save}
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.
\fbox {\tt Object}
$\Rightarrow$ \fbox {\tt Save as}
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.
\fbox {\tt File}
$\Rightarrow$ \fbox {\tt Run Script}

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 \fbox {\tt OK}
.

Manipulating projects (binary files)

To create a new project

1.
\fbox {\tt File}
$\Rightarrow$ \fbox {\tt New Project}

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 \fbox {\tt OK}
.
To open an existing project
1.
\fbox {\tt File}
$\Rightarrow$ \fbox {\tt Open Project}

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 \fbox {\tt OK}
.
To close a project To save a project with the default name
\fbox {\tt File}
$\Rightarrow$ \fbox {\tt Save Project}
To save a project with a different name or at a new location
1.
\fbox {\tt File}
$\Rightarrow$ \fbox {\tt Save Project As}

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 \fbox {\tt OK}
.

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.

[gocad]



 
next up [*] print clean
Next: About this document ... Up: Table of Contents
Stanford Exploration Project
5/15/2001