ArticleslgStudy

computer science

JMesh

JMesh is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand JMesh rather than just read about it. In short: 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…

JMesh — main illustration
JMesh — illustration

Key takeaways

  • JMesh belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect JMesh to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of JMesh from memory before moving on to harder problems.

Reference excerpt

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.

JMesh file example The following mesh (a tetrahedral mesh of a unit cube) contains 8 3-D vertices, 12 triangular faces and 6 tetrahedral elements

The above mesh can be stored in the JMesh/JSON format as

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

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

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 syntax All JMesh files are JData specification compliant. Same as JData, it has both a text-format based on JSON serialization scheme and a binary format based on the UBJSON serialization scheme. Nearly all supported mesh data containers (i.e. named JData nodes) can be defined using one of the two forms: an N-D array or a structure.

Array form For simple data, one can use the "array form" to store the data under a JMesh keyword. In such case, the format of the data must follow the "N-Dimensional Array Storage Keyword" rules defined in the JData specification. For example, one can store a 1-D or 2-D array using the direct storage format as

or using the "annotated storage" format as

Structure form One can also use a JData structure to store the primary data as well as to support additional metadata associated with the container. For example, a structure-based container may have the below subfields:

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.

Summary of JMesh keywords Most of the data container keywords associated with discretized geometries have a prefix of "Mesh"; keywords associated with parametric shape constructs have a prefix of "Shape"; keywords associated with constructive solid geometries have a prefix "CSG". Many of the keywords ends with a numerical value which typically represents the column number of the data when stored in the array format.

Mesh grouping: MeshGroup, MeshObject, MeshPart Vertices: MeshVertex1,MeshVertex2,MeshVertex3,MeshVertex4 Lines: MeshLine,MeshEdge,MeshBSpline2D Surfaces: MeshTri3,MeshQuad4,MeshPLC,MeshNURBS Solid: MeshTet4,MeshHex8,MeshPyramid5,MeshTet10 Flexible containers: MeshNode,MeshSurf,MeshPoly,MeshElem CSG operators: CSGObject,CSGUnion,CSGIntersect,CSGSubtract Texture: Texture1D,Texture2D,Texture3D 2-D shape primitives: ShapeBox2,ShapeDisc2,ShapeEllipse,ShapeLine2, ShapeArrow2,ShapeAnnulus,ShapeGrid2 3-D shape primitives: ShapeLine3,ShapePlane3,ShapeBox3,ShapeDisc3, ShapeGrid3,ShapeSphere,ShapeCylinder,ShapeEllipsoid,ShapeTorus,ShapeCone, ShapeConeFrustum,ShapeSphereShell,ShapeSphereSegment Extrusion and revolving: ShapeExtrude2D,ShapeExtrude3D,ShapeRevolve3D Properties: Color,Normal,Size,Label,Value

Vertices "MeshVertex1" defines a 1-D position vector. It must be defined as an N-by-1 or 1-by-N numerical vector, where N equals to the total number of vertices. The values in this vector shall be the coordinates of the 1-D vertices.

"MeshVertex2" defines a 2-D position vector. It must be defined as an N-by-2 numerical array where N is the total number of vertices. Each row of this array contains the coordinates of the vertex.

"MeshVertex3" defines a 3-D position vector. Similar to MeshVertex2, it must be defined as an N-by-3 numerical array.

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.

Surfaces "MeshTri3" defines a discretized surface made of triangles with a triplet of node indices in each row of the array. It must be defined by an N-by-3 integer array, where N is the total number of triangles.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with JMesh

Start with the simplest possible case. Write down what JMesh claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to JMesh before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about JMesh ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of JMesh

In research
JMesh appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses JMesh in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
JMesh is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D graphics file formats, CAD file formats, Computer file formats, so understanding it makes those chapters shorter.
In everyday life
Look for JMesh outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “JMesh” →

How to study JMesh in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what JMesh means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain JMesh out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is JMesh in simple terms?

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 construc…

Why does JMesh matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study JMesh?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on JMesh.

Tags

  • 3D graphics file formats
  • CAD file formats
  • Computer file formats
  • Data exchange formats
  • Data serialization formats
  • JSON
  • Vector graphics file formats

Keep exploring