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.
An integer which specifies what type of object to create. The various surface types are described in the table below.
A named variable that will contain the mesh vertices. Vertex_List has the same format as the lists returned by the SHADE_VOLUME procedure.
A named variable that will contain the mesh indexes. Polygon_List has the same format as the lists returned by the SHADE_VOLUME procedure.
An array whose use depends on the type of object being created. The table below describes the differences.
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.
If set, then the input parameters are in degrees (where applicable). Otherwise, the angles are in radians.
The meaning of the keywords P1 through P5 vary depending upon the object type. The table below describes the differences.
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
T3D, TRANSLATE=[0.25, 0.25, 0.25]
VERTEX_LIST = VERT_T3D(Vertex_List)
WINDOW, 0, XSIZE=512, YSIZE=512
CREATE_VIEW, WINX=512, WINY=512
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]], $
WINDOW, 0, XSIZE=512, YSIZE=512
CREATE_VIEW, WINX=512, WINY=512, AX=30.0, AY=(140.0), ZOOM=0.5