Arch JSON/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 4: Line 4:
|[[Arch_OBJ|OBJ]]
|[[Arch_OBJ|OBJ]]
|[[Arch_3DS|3DS]]
|[[Arch_3DS|3DS]]
|[[Arch_Workbench|Arch Workbench]]
|[[Arch_Workbench|Arch]]
|IconL=
|IconL=
|IconR=
|IconR=
Line 35: Line 35:
|[[Arch_OBJ|OBJ]]
|[[Arch_OBJ|OBJ]]
|[[Arch_3DS|3DS]]
|[[Arch_3DS|3DS]]
|[[Arch_Workbench|Arch Workbench]]
|[[Arch_Workbench|Arch]]
|IconL=
|IconL=
|IconR=
|IconR=

Revision as of 16:02, 9 March 2022

The main purpose of this export format is to make it easier to process FreeCAD model data from programming languages. The JSON format is as follows:

  {
    "version": "0.0.1",
    "description": "Mesh data exported from FreeCAD",
    "objects": [
      {
        "name": "<object name>",
        "description": "<object description>",
        "color": "<object color>",
        "wires": [[[<float>, <float>, <float>], . . .], . . .],
        "vertices": [[<float>, <float>, <float>], . . .],
        "normals": [[<float>, <float>, <float>], . . .],
        "facets": [[<int>, <int>, <int>], . . .]
      }, . . .
    ]
  }

Note that facets form triangles and their integer values reference points in the vertices array. Facet normals are found at the corresponding position in the normals array. description, color and wires are all optional. This format could easily be expanded to include additional model data.