Tool.to_json

Tool.to_json(filepath)[source]

Serialise the data dictionary representing the tool to JSON and store in a file.

Parameters

filepath (str) – Path to the file.

Returns

None

Examples

>>> mesh = Mesh.from_stl(compas_fab.get('planning_scene/cone.stl'))
>>> frame = Frame([0.14, 0, 0], [0, 1, 0], [0, 0, 1])
>>> tool = Tool(mesh, frame)
>>> filepath = os.path.join(compas_fab.DATA, "planning_scene", "cone_tool.json")
>>> tool.to_json(filepath)