Defining Surfaces with Polygons Defining Surfaces with Polygons

MOSES provides a method for combining closed surfaces in space using simple closed surfaces called blocks. These blocks can then be combined in a variety of ways, to produce more complex shapes. This block combining is accomplished in a menu which one enters with the command:


     &SURFACE

and exits using an


     END_&SURFACE

command.

At this menu level, one can proceed to build blocks with the command


     BLOCK, BLOCK_NAME, -OPTIONS

and the available options are:



     -LOCATION, X, Y, Z, ROLL, PITCH, YAW


     -STBD


     -PORT


     -BOTH

Here, BLOCK_NAME is the block name, and is optional. If this name is not supplied, MOSES will provide one. Once at the BLOCK menu level, building blocks can be generated using any of the commands for describing planes, found in the section describing pieces. The BLOCK menu can be exited with the END_BLOCK command.

If one has an existing mesh description, it can be entered into the program through the MESH menu, by typing the command


     MESH

In this menu, the valid commands are the same ones used to define panels, also found in the section describing pieces. The sole purpose of this menu is to accept previously defined meshes. The mesh generation commands from prior versions of the program are accepted here. For these earlier meshes, the vertices must be defined before the panels. Commands are also available for defining a plate mesh. In fact, the term mesh now refers to a structural plate mesh, a hydrostatic mesh, and a hydrodynamic mesh. The differences between these types of mesh are discussed later. Remember to exit from the MESH menu by typing END_MESH.

The BLOCK and MESH menus basically serve to describe the polygons that make up a surface. When these have been described, one returns to the &SURFACE menu to complete the building process.

Blocks can be manipulated using the following commands:


     LIST_BLOCK

     MOVE_BLOCK, BLOCK_NAME, ANSNAM, X, Y, Z, RX, RY, RZ

     DELETE_BLOCK, BLOCK_NAME(1), .... BLOCK_NAME(n)

     REFLECT_BLOCK, BLOCK_NAME, ANSNAM, AXIS

The LIST_BLOCK command will provide a list of all blocks currently defined. MOVE_BLOCK will create a new block, ANSNAM, based on BLOCK_NAME, moved from its original location to that specified by X, Y, Z, RX, RY, RZ. To delete an existing block, use the DELETE_BLOCK command and specify the block name or names to delete. Remember that wild characters are valid here. Finally, the REFLECT_BLOCK command will take an existing block, BLOCK_NAME, and create a reflection of the specified AXIS, X, Y or Z. The new block created by the reflection will be named ANSNAM.

Blocks can be combined in a variety of ways, using the commands:


     UNION,     BLOCK_NAME(1), BLOCK_NAME(2), ANSNAM

     INTERSECT, BLOCK_NAME(1), BLOCK_NAME(2), ANSNAM

     DIFFERENCE, BLOCK_NAME(1), BLOCK_NAME(2), ANSNAM

Here, BLOCK_NAME(1) and BLOCK_NAME(2) are names of blocks to be combined, and ANSNAM is the name of the resulting combination. The command names describe what happens when two blocks are joined in the specified manner. For instance, a UNION simply joins two blocks together. Since, however, we want a closed surface as a result, the volume inside will be removed. Both the INTERSECTION and DIFFERENCE commands can be thought of a "throwing away" part of a block. A DIFFERENCE of two blocks "subtracts" the part of BLOCK_NAME(2) inside BLOCK_NAME(1) from the resulting block. An INTERSECTION keeps only the part of BLOCK_NAME(1) inside BLOCK_NAME(2). In either case, the result is a closed surface. With either of these commands, strange things may happen if BLOCK_NAME(2) does not contain any of BLOCK_NAME(1). As a general rule, UNION is used to combine two blocks for creating the exterior of a body, DIFFERENCE is used to make holes in a body, and INTERSECTION is used for making compartments from the exterior.

The basic design here is that one defines a set of simple blocks and combines them to create the exterior. Now, one uses the exterior, more special blocks and DIFFERENCES to define all of the compartments for the body. After everything has been defined, one deletes the temporary blocks, renames those he wishes to keep and emits the model. Any time during the process, one can make pictures of the blocks with


     PICTURE, BLOCK_NAME(1), ....., BLOCK_NAME(n)

One renames blocks with the command:


     RENAME_BLOCK, :BLOCK_SEL,  -OPTIONS

where the options are:


     -POINT, *PNAM,

     -PANEL, PNL,

     -SORT, ORDER, JUMP_NUM, JUMP_TOL

     -EQUIVALENT, DIST

The RENAME_BLOCK command removes all blocks except those selected with :BLOCK_SEL, and renames the point and panel names according to the options used. The -POINT option specifies a point name prefix, and should begin with an *. The -PANEL option describes a panel name prefix, while the -SORT option defines a criteria for sorting the resulting point and panel names. Here, ORDER can be any combination of the letters XYZ. Using this option, points output to the file will be sorted according to their coordinates, in the order specified. JUPNAM is the integer amount added to a point name when there is a jump in the coordinates of a point of JUMP_TOL. The -EQUIVALENT option defines a distance DIST (feet or meters) which is used for point equivalence. Two points within this distance are declared to be the same and references to the deleted point are removed from all panels. This option is quite useful in removing small pieces of trash which results from combining blocks. Renaming is not necessary, but it provides a set of results which are much easier to read and which have a smaller number of panels and points.

The final step in this process is to EMIT the results created. This is accomplished with the command:


     EMIT, :BLOCK_SEL(1), ..... :BLOCK_SEL(n), -OPTIONS

where the options are:


     -PART, PART_NAME, PAROPT

     -BODY, BODY_NAME, BODOPT

     -USE_NAME, YES/NO

     -PERM, PERM

     -NAME, NAME

     -COMPARTMENT, CMPOPT

     -PIECE, PIEOPT

     -POINTS

Here, the -PART or -BODY option instructs MOSES to emit the points for the blocks matching the :BLOCK_SEL(i) selectors and to specify that they all belong to either body BODY_NAME or part PART_NAME. This should normally be the first thing emitted. After the points have been emitted, one should then emit the panels for the exterior and any interior compartments. Each one of these should have a single emit command. Panel names will be used if YES/NO is set to YES on the -USE_NAME option. If YES/NO is NO, no panel names will be provided. The -PERM option is used to specify the permeability of the piece being emitted. When emitting panels, both compartments and pieces will be generated: one compartment is defined for each emit command and a piece for each block emitted. Thus, if there is on only a single block emitted one gets a compartment and a piece. The -NAME option specifies the name of the compartment. If it is omitted, then the compartment name will be the same as the first block emitted.

The -BODY, -PART, -COMPARTMENT and -PIECE options allow one to specify options which are emitted on the &DESCRIBE command. When using this capability, one needs to remember to enclose the various data within " or ' marks.

For complicated models with multiple pieces, it can be useful to emit only the points for a piece without the associated &DESCRIBE BODY or &DESCRIBE PART commands. This flexibility allows the emitted points to be assigned to a previously defined body or part, which facilitates automatic generation of a complete model into one post processing file. To emit only points, use the -POINTS option.

The tools described here are quite powerful, but as with all powerful things, one must use them with care. The way this operation works is that MOSES finds the part of one block "inside" the other and then eliminates it. For this to work properly, however, MOSES must be able to unambiguously distinguish what is "inside". This looks quite simple, but it is not numerically. Consider, for example two blocks:

     BLOCK BOX
     PLANE -50 50 -RECT 0 10 100
     END_BLOCK
     BLOCK HOLE
     PLANE -10 10 -RECT 0 10 20
     END_BLOCK

and suppose one removes the hole from the box with

     DIFFERENCE, BOX, HOLE, NEW

In all likelihood, this command will fail. The reason is simple, the top and bottom surfaces of the hole lie in the same plane as those of the box. Numerics being what they are it is possible that MOSES thinks that the hole is entirely inside the box, so nothing is subtracted. To make things work properly, one should define the hole as:

     BLOCK HOLE
     PLANE -10 10 -RECT -1 11 20
     END_BLOCK

Now, there is no confusion as to whether or not the box intersects the hole. The same rule applies to the other two operations: Always make sure that the two blocks penetrate one another and two lines do not intersect.

Continuing with this example, we can now create tanks in the box.

     BLOCK AT
     PLANE 40 51 -RECT -1 11 120
     END_BLOCK
     BLOCK PTW -LOC 0 -40 -port
     PLANE -60 60 -RECT -1 11 11
     END_BLOCK
     INTERSECTION BOX AT ATT
     INTERSECTION ATT PTW PAW

The blocks AT and PTW are temporary blocks, the first being a slice across the stern and the latter a slice along the port side. Notice that in both cases, care was taken so that these slices "extended beyond" the basic box. The first intersection uses the temporary block to clip a true slice from the stern. Here, due to the simplicity, this is not necessary, but this produces a true piece of the ship from 40 feet aft. The last intersection produces a tank at the port aft of the box. If one defines more longitudinal and transverse blocks, all of the tanks can be easily created.

To complete this example, we would emit the exterior of the box and the tank with:

     RENAME_BLOCK  BOX PAW -EQUIV .1 -POINT *P
     EMIT @ -PART BOX
     EMIT BOX -PIECE ' -DIFTYPE 3DDIF -PERM 1.00'
     EMIT PAW -COMPART "-DESCRIPT 'Port Aft Fuel Tank' " \
     -PIECE   '-PERM -0.98'

Notice here the use of " to delimit the options which are used when describing the compartment. This is necessary because a ' is already in use to delimit the text for the -DESCRIPT option.