Arch JSON: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
No edit summary
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:5-->
{{Docnav
|[[Arch_OBJ|OBJ]]
|[[Arch_3DS|3DS]]
|[[Arch_Module|Arch Module]]
}}

<!--T:1-->
<!--T:1-->
The main purpose of this export format is to make it easier to process FreeCAD model data from programming languages. The [http://json.org/ JSON] format is as follows:
The main purpose of this export format is to make it easier to process FreeCAD model data from programming languages. The [http://json.org/ JSON] format is as follows:
</translate>
</translate>
<pre>
{
{
"version": "0.0.1",
"version": "0.0.1",
Line 19: Line 27:
]
]
}
}
</pre>
<translate>
<translate>

<!--T:2-->
<!--T:2-->
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.
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.


<!--T:4-->
{{Docnav
|[[Arch_OBJ|OBJ]]
|[[Arch_3DS|3DS]]
|[[Arch_Module|Arch Module]]
}}




<!--T:3-->
[[Category: User Documentation]]
</translate>

<translate>
<!--T:4-->
[[Category:Arch]]
</translate>
</translate>
{{Arch Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
[[Category:File Formats{{#translation:}}]]

Revision as of 08:58, 17 September 2020

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.