Difference between revisions of "Arch JSON"

From FreeCAD Documentation
Jump to navigation Jump to search
 
Line 2: Line 2:
 
<translate>
 
<translate>
 
<!--T:5-->
 
<!--T:5-->
{{docnav|[[Arch OBJ|OBJ]]|[[Arch 3DS|3DS]]|[[Arch_Module|Arch Module]]}}
+
{{Docnav
 +
|[[Arch_OBJ|OBJ]]
 +
|[[Arch_3DS|3DS]]
 +
|[[Arch_Module|Arch Module]]
 +
}}
  
 
<!--T:1-->
 
<!--T:1-->
Line 30: Line 34:
  
 
<!--T:4-->
 
<!--T:4-->
{{docnav|[[Arch OBJ|OBJ]]|[[Arch 3DS|3DS]]|[[Arch_Module|Arch Module]]}}
+
{{Docnav
 +
|[[Arch_OBJ|OBJ]]
 +
|[[Arch_3DS|3DS]]
 +
|[[Arch_Module|Arch Module]]
 +
}}
  
  

Latest revision as of 08:58, 17 September 2020

Other languages:
Deutsch • ‎English • ‎français • ‎italiano • ‎polski • ‎русский
Arrow-left.svg Previous: OBJ
Next: 3DS Arrow-right.svg

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.

Arrow-left.svg Previous: OBJ
Next: 3DS Arrow-right.svg