[[PageOutline]] = Introduction = A mesh defines the vertices in 2D or 3D for a set of values of a [wiki:rp_xml_ele_field ''] element. The '''''' describes where each value of the [wiki:rp_xml_ele_field ] is found. A mesh contains ''mesh elements'' that indicate their connectivity (topology) and geometry. Meshes can be structured or unstructured grids. Structured grids get their name from their nature of having a structure implicitly defined by the arrangement of the data. Structured grids have a basic rectangular matrix structure that makes storage and use easy as integer offsets (typically named ''i'', ''j'', and ''k'') can be used to access individual data points. Data points are arranged into rectangular or cubic structures by simply connecting them to their neighboring ''i'', ''j'', and ''k'' cells. For example, volume rendering requires a uniform rectangular grid. Within structured grids there are several subtypes: * Cartesian or Uniform Grid * Rectilinear Grid * Curvilinear Grid Unstructured grids are the exact opposite of structured grids, where the connectivity between points must be explicitly defined for every set of points. This makes them significantly more difficult and complex, and the nice relationships between neighboring cells or edges is no longer automatic and must be constructed manually. However, they are much more flexible in their ability to define complex shapes because they have no constraints on their arrangement. Unstructured grids are typically defined as points and cells. Cells are collections of points to define basic 2D or 3D primitives such as triangles, cubes, and tetrahedra. Pick the one that most closely resembles the structure of your data set. = How to specify meshes = {{{ 3 um yes ... }}} All meshes should have '''''', '''''' and '''''' subelements. There are three basic formats for meshes, given by the subelements '''''', '''''', and ''''''. It is an error to have more than one in a '''''' definition. ''' }}} == Point Clouds == The point cloud is a special case of a unstructured grid. A point cloud mesh contains no explicit connectivity. It is implicitly converted into triangular mesh in 2D or a tetrahedral mesh in 3D. The '''''' subelement indicates where the individual points are located in the cloud. Each line of '''''' specifies a point in the cloud. There are no '''''' or '''''' subelements. . '''''Note: It is a bad idea to convert your data that has a known mesh into a point cloud. The mesh generated for point clouds will be inferior to the one actually used by the dataset.''''' '''''':: These are the points of the mesh. Each line specifies a point in the cloud. Each line should contain two numbers in 2D, or three numbers in 3D, representing coordinates of the point The following is an example of a 2D cloud. {{{ 2 m yes 0.0 0.0 0.0204081632653 0.0 0.0408163265306 0.0 0.0612244897959 0.0 ... 0.918367346939 1.0 0.938775510204 1.0 0.959183673469 1.0 0.979591836735 1.0 1.0 1.0 }}} = VTK Legacy File Format = A '''''' element uses the VTK legacy file format to describe the mesh. The advantage of describing the mesh in VTK file format is that you can have heterogeneous cell types. The '''''' element contains only a part of a VTK file. It consists of * a '''DATASET''' keyword and the dataset type ('''STRUCTURED_POINTS''', '''STRUCTURED_GRID''', '''UNSTRUCTUTRED_GRID''', '''POLYDATA''', or '''RECTILINEAR_GRID''') and * the dataset definition itself. '''POINT_DATA''' and '''CELL_DATA''' are not included. They will be added by the '''''' that is using this mesh. {{{ 2 m yes DATASET UNSTRUCTURED_GRID POINTS 2500 float 0.0 0.0 0 0.0204082 0.0 0 0.0408163 0.0 0 0.0612245 0.0 0 0.0816327 0.0 0 0.102041 0.0 0 ... CELLS 4802 19208 3 93 44 43 3 98 49 48 3 19 70 20 3 25 76 26 3 29 80 30 3 34 85 35 ... CELL_TYPES 4802 5 5 5 5 5 5 ... }}} You can see working code in the [browser:trunk/examples/zoo zoo of examples] in the [browser:trunk/examples/zoo/mesh mesh example] or on the hub in the directory /apps/rappture/examples/zoo/mesh.