Welcome to the L3 Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿

### MESH_OBJ

MESH_OBJ

The MESH_OBJ procedure generates a polygon mesh (vertex list and polygon list) that represent the desired primitive object. The available primitive objects are: triangulated surface, rectangular surface, polar surface, cylindrical surface, spherical surface, surface of extrusion, surface of revolution, and ruled surface.

This routine is written in the IDL language. Its source code can be found in the file mesh_obj.pro in the lib subdirectory of the IDL distribution.

## Examples

`; Create a 48x64 cylinder with a constant radius of 0.25:MESH_OBJ, 3, Vertex_List, Polygon_List, \$   Replicate(0.25, 48, 64), P4=0.5; Transform the vertices:T3D, /RESET T3D, ROTATE=[0.0, 30.0, 0.0] T3D, ROTATE=[0.0, 0.0, 40.0] T3D, TRANSLATE=[0.25, 0.25, 0.25]VERTEX_LIST = VERT_T3D(Vertex_List); Create the window and view:WINDOW, 0, XSIZE=512, YSIZE=512 CREATE_VIEW, WINX=512, WINY=512; Render the mesh:SET_SHADING, LIGHT=[-0.5, 0.5, 2.0], REJECT=0 TVSCL, POLYSHADE(Vertex_List, Polygon_List, /NORMAL); Create a cone (surface of revolution):MESH_OBJ, 6, Vertex_List, Polygon_List, \$   [[0.75, 0.0, 0.25], [0.5, 0.0, 0.75]], \$   P1=16, P2=[0.5, 0.0, 0.0]; Create the window and view:WINDOW, 0, XSIZE=512, YSIZE=512 CREATE_VIEW, WINX=512, WINY=512, AX=30.0, AY=(140.0), ZOOM=0.5; Render the mesh:SET_SHADING, LIGHT=[-0.5, 0.5, 2.0], REJECT=0 TVSCL, POLYSHADE(Vertex_List, Polygon_List, /DATA, /T3D)`

## Syntax

MESH_OBJ, Type, Vertex_List, Polygon_List, Array1 [, Array2] [, /CLOSED] [, /DEGREES] [, P1, P2, P3, P4, P5=value]

## Arguments

### Type

An integer that specifies what type of object to create. The various surface types are described in the table below.

 Type Surface Type 0 Triangulated 1 Rectangular 2 Polar 3 Cylindrical 4 Spherical 5 Extrusion 6 Revolution 7 Ruled Other values None

### Vertex_List

A named variable that will contain the mesh vertices. Vertex_List has the same format as the lists returned by the SHADE_VOLUME procedure.

### Polygon_List

A named variable that will contain the mesh indexes. Polygon_List has the same format as the lists returned by the SHADE_VOLUME procedure.

### Array1

An array whose use depends on the type of object being created. The following table describes the differences.

### Array2

If the object type is 7 (Ruled Surface) then Array2 is a (3, m) array containing the 3D points which define the second ruled vector. If Array2 has fewer elements than Array1 then Array2 is processed with CONGRID to give it the same number of elements as Array1. If Array1 has fewer elements than Array2 then Array1 is processed with CONGRID to give it the same number of elements as Array2. Array2 must be supplied if the object type is 7. Otherwise, Array2 is ignored.

## Keywords

### CLOSED

Set this keyword to “close” the polygonal mesh topologically by using the first vertex in a given row for both the first and last polygons in that row. This keyword is only applicable to the CYLINDRICAL, SPHERICAL, REVOLUTION, and EXTRUSION surface types. Setting the CLOSED keyword removes the discontinuity when the mesh wraps back around on itself, which can improve the mesh’s appearance when viewing it as a shaded object. For the EXTRUSION surface type, this procedure handles input polygons that form a closed loop with the last vertex being a copy of the first vertex, as well as those that do not.

### DEGREES

If set, then the input parameters are in degrees (where applicable). Otherwise, the angles are in radians.

### P5

The meaning of the keywords P1 through P5 vary depending upon the object type. The table below describes the differences.

 Surface Type Keywords Triangulated P1 through P5 are ignored. Rectangular If Array1 is an (n, m) array, and if P1 has n elements, then the values contained in P1 are the X coordinates for each column of vertices. Otherwise, FINDGEN(n) is used for the X coordinates. If P2 has m elements, then the values contained in P2 are the Y coordinates for each row of vertices. Otherwise, FINDGEN(m) is used for the Y coordinates. The polygon facing is reversed if the order of either P1 or P2 (but not both) is reversed. P3, P4, and P5 are ignored. Polar P1 specifies the polar angle of the first column of Array1 (the default is 0). P2 specifies the polar angle of the last column of Array1 (the default is 2*PI). If P2 is less than P1 then the polygon facing is reversed. P3 specifies the radius of the first row of Array1 (the default is 0). P4 specifies the radius of the last row of Array1 (the default is m-1). If P4 is less than P3 then the polygon facing is reversed. P5 is ignored. Cylindrical P1 specifies the polar angle of the first column of Array1 (the default is 0). P2 specifies the polar angle of the last column of Array1 (the default is 2*PI). If P2 is less than P1 then the polygon facing is reversed. P3 specifies the Z coordinate of the first row of Array1 (the default is 0). P4 specifies the Z coordinate of the last row of Array1 (the default is m-1). If P4 is less than P3 then the polygon facing is reversed. P5 is ignored. Spherical P1 specifies the longitude of the first column of Array1 (the default is 0). P2 specifies the longitude of the last column of Array1 (the default is 2*PI). IF P2 is less than P1 then the polygon facing is reversed. P3 specifies the latitude of the first row of Array1 (the default is -PI/2). P4 specifies the latitude of the last row of Array1 (the default is +PI/2). If P4 is less than P3 then the polygon facing is reversed. P5 is ignored. Extrusion P1 specifies the number of steps in the extrusion (the default is 1). P2 is a three element vector specifying the direction (and length) of the extrusion (the default is [0, 0, 1]). P3, P4, and P5 are ignored. Revolution P1 specifies the number of “facets” in the revolution (the default is 3). If P1 is less than 3 then 3 is used. P2 is a three element vector specifying a point that the rotation vector passes through (the default is [0, 0, 0]). P3 is a three element vector specifying the direction of the rotation vector (the default is [0, 0, 1]). P4 specifies the starting angle for the revolution (the default is 0). P5 specifies the ending angle for the revolution (the default is 2*PI). If P5 is less than P4 then the polygon facing is reversed. Ruled P1 specifies the number of “steps” in the ruling (the default is 1). P2, P3, P4, and P5 are ignored.

## Version History

 Pre 4.0 Introduced