#!F-adobe-helvetica-medium-r-normal--18* #!N #!CDarkGreen #!N #!Rall633 Example 9. Faces, Loops, and Edges #!N #!EC #!N #!N Faces loops, and edges are used to define polygons. For example, you may wish to define regions of a map with polygons. A positions component identifies the vertices of the polygons, an edges component identifies how to connect positions, a loops component identifies the beginning of each loop by referring to the first edge of the loop, and a faces component identifies which loops make up a face. (A face may have more than one loop if the face has one or more holes in it.) #!N #!N For more information about faces, loops, and edges, see #!Lflec,dxall220 h Faces, Loops, and Edges Components #!EL . Note that some modules do not accept this kind of data. However, the Refine module can be used to convert faces, loops, and edges data to triangles. See #!Lrefine,dxall919 h Refine #!EL in IBM Visualization Data Explorer User's Reference. #!N #!N The following example describes a simple 2-dimensional data set consisting of five polygons. None of the polygons has holes. To view the data, you can use the following script: #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N g = Import("FacesLoopsEdges.dx"); #!N c = AutoCamera(g); #!N colored = AutoColor(g); #!N Display(colored, c); #!EF #!N #!N #!EC #!N #!N The data file is given below, and the resulting connections are illustrated in #!Lfled111,dxall634 f Figure 111 #!EL . The data file can be found in #!F-adobe-times-bold-r-normal--18* /usr/lpp/dx/samples/data/FacesLoopsEdges.dx #!EF . #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N # #!N # Example of faces, loops and edges components. #!N # This example has no holes. #!N # #!N #!N # #!N # Positions array. These are a list of all the vertices of the object; #!N # no particular order is required here. #!N # #!N object "position list" class array type float rank 1 shape 2 items 11 #!N data follows #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!T,16,104,190 #!N TAB 0.133985 TAB 0.812452 TAB # point number 0 #!N TAB 0.375019 TAB 0.896258 TAB # point number 1 #!N TAB 0.532733 TAB 0.76484 TAB # point number 2 #!N TAB 0.523806 TAB 0.404777 TAB # point number 3 #!N TAB 0.300626 TAB 0.327407 TAB # point number 4 #!N TAB 0.145888 TAB 0.508927 TAB # point number 5 #!N TAB 0.68152 TAB 0.851137 TAB # point number 6 #!N TAB 0.815428 TAB 0.758889 TAB # point number 7 #!N TAB 0.94636 TAB 0.592248 TAB # point number 8 #!N TAB 0.729132 TAB 0.416679 TAB # point number 9 #!N TAB 0.535709 TAB 0.190524 TAB # point number 10 #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N # #!N # Edges array. This is a list of connected points, by point number. #!N # All the edges associated with a particular face need to be listed #!N # together. If points 10, 3 and 7 make a triangle, the list is #!N # "10 3 7" and the 10 is not repeated. Note that below, for #!N #!N # readability, the connected points for each loop are #!N # shown together. However line breaks are not significant #!N # to the importer, and all of the following numbers could have #!N # been on the same line, or one to a line, with the same result. #!N #!N object "edge list" class array type int rank 0 items 21 data follows #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!T,16,51,86,242 #!N TAB 1 TAB 2 TAB 6 TAB # edge point index 0 #!T,16,51,86,121,156,190,242 #!N TAB 0 TAB 5 TAB 4 TAB 3 TAB 2 TAB 1 TAB # edge point index 3 #!N TAB 2 TAB 3 TAB 9 TAB 8 TAB 7 TAB 6 TAB # edge point index 9 #!T,16,51,86,242 #!N TAB 3 TAB 10 TAB 9 TAB # edge point index 15 #!N TAB 3 TAB 4 TAB 10 TAB # edge point index 18 #!N attribute "ref" string "positions" #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N # Loops array. This is a list of connected edges, by edge number. #!N # Each number is the edge index of where the next loop starts. #!N object "loop list" class array type int rank 0 items 5 data follows #!T,26,61 #!N TAB 0 TAB # loop index 0 #!N TAB 3 TAB # 1 #!N TAB 9 TAB # 2 #!N TAB 15 TAB # 3 #!N TAB 18 TAB # 4 #!N attribute "ref" string "edges" #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N # #!N # Faces array. This is list of which loops make faces. If there are #!N # no holes in the faces, this is list of all loops. If two or more #!N # loops actually describe the outside edges and inside hole edges of #!N # a face, then this list contains the starting loop numbers of the #!N # list of loops making up a face. #!N # #!N object "face list" class array type int rank 0 items 5 data follows #!N 0 #!N 1 #!N 2 #!N 3 #!N 4 #!N attribute "ref" string "loops" #!N #!N # data array. Dependent on faces. #!N # #!N object "data" class array type float rank 0 items 5 data follows #!T,16,51,86,121,156 #!N TAB 0 TAB 2.5 TAB 1.2 TAB 0.4 TAB 1.8 #!N attribute "dep" string "faces" #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N # #!N # Field definition to put the arrays together. #!N # #!N object "map" class field #!EF #!N #!N #!EC #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!T,34,190 #!N TAB component "positions" TAB "position list" #!N TAB component "edges" TAB "edge list" #!N TAB component "loops" TAB "loop list" #!N TAB component "faces" TAB "face list" #!N TAB component "data" TAB "data" #!N #!N end #!EF #!N #!N #!EC #!Cbrown #!N #!F-adobe-times-medium-r-normal--18* #!Rfled111 #!N Graphics omitted from Online Documentation. Please see the manual. #!N #!N Figure 111. Example of Faces, Loops, and Edges #!EF #!N #!EC #!N #!N #!N #!F-adobe-times-medium-i-normal--18* Next Topic #!EF #!N #!N #!Lall634,dxall635 h Example 10. Faces, Loops, and Edges with a Hole #!EL #!N #!F-adobe-times-medium-i-normal--18* #!N
Generated by dwww version 1.15 on Sat Jun 22 12:54:04 CEST 2024.