JMesh

JMesh is a JSON-based portable and extensible file format for the storage and interchange of unstructured geometric data, including discretized geometries such as triangular and tetrahedral meshes, parametric geometries such as NURBS…

Uses your system voice; voice and rate in settings.

Snapshot

≈ 10 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

JMesh is a JSON-based portable and extensible file format for the storage and interchange of unstructured geometric data, including discretized geometries such as triangular and tetrahedral meshes, parametric geometries such as NURBS curves and surfaces, and constructive geometries such as constructive solid geometry (CGS) of shape primitives and meshes. Built upon the JData specification, a JMesh file utilizes the JSON and Universal Binary JSON (UBJSON) constructs to serialize and encode geometric data structures, therefore, it can be directly processed by most existing JSON and UBJSON parsers.

The JMesh specification defines a list of JSON-compatible constructs to encode geometric data, including N-dimensional (ND) vertices, curves, surfaces, solid elements, shape primitives, their interactions (such as CGS) and spatial relations, together with their associated properties, such as numerical values, colors, normals, materials, textures and other properties related to graphics data manipulation, 3D fabrication, computer graphics rendering and animations. { "_DataInfo_": { "JMeshVersion": 0.5, "CreationTime": "19-Dec-2021 11:53:43", "Comment": "Created by iso2mesh 1.9.5-Rev(http:\/\/iso2mesh.sf.net)" }, "MeshVertex3": [ [0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1], [1, 1, 1] ], "MeshTri3": [ [1, 2, 4], [1, 2, 6], [1, 3, 4], [1, 3, 7], [1, 5, 6], [1, 5, 7], [2, 8, 4], [2, 8, 6], [3, 8, 4], [3, 8, 7], [5, 8, 6], [5, 8, 7] ], "MeshTet4": [ [1, 2, 4, 8], [1, 3, 4, 8], [1, 2, 6, 8], [1, 5, 6, 8], [1, 3, 7, 8], [1, 5, 7, 8] ] } The optional "_DataInfo_" record can contain additional metadata according to JData specification. Instead of using dimension-specific mesh data constructs, i.e. MeshVertex3 , MeshTri3 , and MeshTet4 , one can also replace those with the corresponding flexible mesh data containers, MeshNode , MeshSurf , and MeshElem , respectively.

It is recommended to add "Dimension": 3 in the "_DataInfo_" metadata header to help parsers correctly process the numerical data in each entry. Alternatively, according to JMesh and JData specifications, the above JSON-styled 2-D arrays can be stored as a structure using JData annotated N-D array format to add additional binary data type support, as below { "_DataInfo_": { "JMeshVersion": 0.5, "Dimension": 3 }, "MeshNode": { "_ArrayType_": "double", "_ArraySize_": [8, 3], "_ArrayData_": [0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1] }, "MeshSurf": { "_ArrayType_": "uint8", "_ArraySize_": [12, 3], "_ArrayData_": [1, 2, 4, 1, 2, 6, 1, 3, 4, 1, 3, 7, 1, 5, 6, 1, 5, 7, 2, 8, 4, 2, 8, 6, 3, 8, 4, 3, 8, 7, 5, 8, 6, 5, 8, 7] }, "MeshElem": { "_ArrayType_": "uint8", "_ArraySize_": [6, 4], "_ArrayData_": [1, 2, 4, 8, 1, 3, 4, 8, 1, 2, 6, 8, 1, 5, 6, 8, 1, 3, 7, 8, 1, 5, 7, 8] } } For large mesh data files, record-level compression is supported via the JData specification.

Just for illustration purposes, the above JMesh data can also be written as { "_DataInfo_": { "JMeshVersion": 0.5, "Dimension": 3 }, "MeshNode": { "_ArrayType_": "double", "_ArraySize_": [8, 3], "_ArrayZipSize_": [1, 24], "_ArrayZipType_": "zlib", "_ArrayZipData_": "eJxjYMAHPtjjlcaQh/GJ1YdLPy51mDQAp2EONQ==" }, "MeshSurf": { "_ArrayType_": "uint8", "_ArraySize_": [12, 3], "_ArrayZipSize_": [1, 36], "_ArrayZipType_": "zlib", "_ArrayZipData_": "eJwFwYcNAAAIArAAMv6/2BY8MNBBhQOXOy7aafXi9QEJtwCj" }, "MeshElem": { "_ArrayType_": "uint8", "_ArraySize_": [6, 4], "_ArrayZipSize_": [1, 24], "_ArrayZipType_": "zlib", "_ArrayZipData_": "eJxjZGLhYGQGYiY2DkZWIGZmB9LsHAAExABt" } } where the strings in "_ArrayZipData_" store the row-major serialized, Zlib-compressed and Base64 encoded binary stream of the raw binary array data in the precision specified in _ArrayType_ . Record-level data compression may offer significant size reduction in storing large mesh files.

Format Overview

"jmesh_container_1d": [v1, v2,..., vn], "jmesh_container_2d": [ [v11, v12, ..., v1n], [v21, v22, ..., v2n], ... [vm1, vm2, ..., vmn] ] or using the "annotated storage" format as "jmesh_container_nd": { "_ArrayType_": "typename", "_ArraySize_": [N1, N2, N3, ...], "_ArrayData_": [v1, v2, v3, ...] } "jmesh_container_struct": { "_DataInfo_": { ... }, "Data": [ ... ], "Properties": [ ... ] } Only the "Data" subfield is required, and it must have the same data stored in the "array form" (either in direct or annotated format) as shown above.

The optional "Properties" subfield allows one to store additional data with this shape/mesh element. The "Properties" subfield can be an array or structure with additional subfields. The optional "_DataInfo_" is the JData construct for storing metadata associated with this structure.

It can be used to store simple metadata, such as data acquisition date, operator name, or version number. The strategies how to split the metadata between _DataInfo_ and Properties is user-dependent. "MeshVertex2": [ [x1, y1], [x2, y2], [x3, y3], ... ] "MeshVertex3" defines a 3-D position vector.

Similar to MeshVertex2, it must be defined as an N-by-3 numerical array. "MeshVertex3": [ [x1, y1, z1], [x2, y2, z2], [x3, y3, z3], ... ]

Line segments and curves

"MeshPolyLine" defines a set of line segments using an ordered 1-D list of node indices (starting from 1). It must be defined by an 1-by-N or N-by-1 vector of integers. If an index is 0, it marks the end of the current line segment and starts a new line segment from the next index.

"MeshPolyLine": [N1, N2, N3, ... ] "MeshEdge" defines a set of line segments using a 2-D array with a pair of node indices in each row of the array. It must be defined by an N-by-2 integer array, where N is the total number of edges.

"MeshEdge": [ [N11, N12], [N21, N22], [N31, N32], ... ] "MeshTri3": [ [N11, N12, N13], [N21, N22, N23], [N31, N32, N33], ... ] "MeshQuad4" defines a discretized surface made of quadrilateral with a quadruplet of node indices in each row of the array. It must be defined by an N-by-4 integer array, where N is the total number of quadrilaterals.

"MeshQuad4": [ [N11, N12, N13, N14], [N21, N22, N23, N24], [N31, N32, N33, N24], ... ] "MeshPLC" defines a discretized surface made of polygons (piecewise linear complex) of uniform or varied edge sizes. It must be defined by an array with elements of integer vectors of equal or varied lengths.

"MeshPLC": [ [N11, N12, N13, ...], [N21, N22, N23, N24, ...], [N31, N32, N33, N34, ..., ...], ... ]

Solid Elements

"MeshTet4" defines a discretized volumetric domain made of tetrahedral elements, with each element made of a quadruplet of node indices. It must be defined by an N-by-4 integer array, where N is the total number of tetrahedra.

"MeshTet4": [ [N11, N12, N13, N14], [N21, N22, N23, N24], [N31, N32, N33, N34], ... ] "MeshHex8" defines a discretized volumetric domain made of 8-node hexahedral elements, with each element specified by a 8-tuple node index. It must be defined by an N-by-8 integer array, where N is the total number of hexahedra.

"MeshHex8": [ [N11, N12, N13, ..., N18], [N21, N22, N23, ..., N28], [N31, N32, N33, ..., N28], ... ] "MeshPyramid5" defines a discretized volumetric domain made of 5-node pyramid elements, with each element specified by a 5-tuple node index. It must be defined by an N-by-5 integer array, where N is the total number of pyramid.

"MeshPyramid5": [ [N11, N12, N13, ..., N15], [N21, N22, N23, ..., N25], [N31, N32, N33, ..., N25], ... ] "MeshTet10" defines a discretized volumetric domain made of 10-node straight-line tetrahedral elements, with each element specified by a 10-tuple node index. It must be defined by an N-by-10 integer array, where N is the total number of 10-node tetrahedra.

"MeshTet10": [ [N11, N12, N13, ..., N1_10], [N21, N22, N23, ..., N2_10], [N31, N32, N33, ..., N2_10], ... ] The first 4 columns of the array specifies the indices of the 4 vertices of the tetrahedron, identical to "MeshTet4" , and the last 6 columns of the array specifies the mid-edge node indices, sorted in the below order: [N1, N2, N3, N4, N12, N13, N14, N22, N23, N34] "MeshNode" defines a flexible container for the storage of vertex coordinates and the associated properties. It must be defined by an N-by-M array, where N is the number of vertices, and M is the number of coordinates (D) plus the number of numerical properties (P) attached along each vertex, i.e. M = D + P "MeshNode": [ [x11, y11, z11, ..., w1D, ..., v11, v12, ..., v1P], [x21, y21, z21, ..., w2D, ..., v21, v22, ..., v2P], [x31, y31, z31, ..., w3D, ..., v31, v32, ..., v3P], ... ] "MeshSurf" defines a flexible container for the storage of fix-node-length surface patches and the associated properties.

It must be defined by an N-by-M array, where N is the number of surface elements, and M is the number of vertices per element (K) plus the number of numerical properties (P) attached along each vertex, i.e. M = K + P "MeshSurf": [ [N11, N11, ..., N1K, ..., v11, v12, ..., v1P], [N21, N21, ..., N2K, ..., v21, v22, ..., v2P], [N31, N31, ..., N3K, ..., v31, v32, ..., v3P], ... ] "MeshPoly" defines a flexible container for the storage of variable-node-length surface patches and the associated properties. Similar to "MeshPLC" , it must be defined by an array with elements of integer vectors, but it can contain additional metadata in each element.

For each vector representing a surface patch, the first non-numerical entry, for example, a structure or sub-array, of the vector marks the start of the property data. "MeshPoly": [ [N11, N12, N13, ..., {properties}], [N21, N22, N23, N24, ...], [N31, N32, N33, N34, ..., ..., [properties] ], ... ] "MeshElem" defines a flexible container for the storage of volumetric elements and the associated properties.

It must be defined by an N-by-M array, where N is the number of surface elements, and M is the number of vertices per element (K) plus the number of numerical properties (P) attached along each vertex, i.e. M = K + P "MeshElem": [ [N11, N11, ..., N1K, ..., v11, v12, ..., v1P], [N21, N21, ..., N2K, ..., v21, v22, ..., v2P], [N31, N31, ..., N3K, ..., v31, v32, ..., v3P], ... ]

Text derived from https://en.wikipedia.org/w/index.php?oldid=1372540542 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

2 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.