trimesh.exchange.export module

Functions

export_dict(mesh[, encoding])

Export a mesh to a dict

export_dict64(mesh)

Export a mesh as a dictionary, with data encoded to base64.

export_json(mesh)

export_mesh(mesh, file_obj[, file_type])

Export a Trimesh object to a file- like object, or to a filename

export_msgpack(mesh)

scene_to_dict(scene[, use_base64])

Export a Scene object as a dict.

trimesh.exchange.export.export_dict(mesh, encoding=None)

Export a mesh to a dict

Parameters
  • mesh (Trimesh object) – Mesh to be exported

  • encoding (str, or None) – ‘base64’

Returns

export – Data stored in dict

Return type

dict

trimesh.exchange.export.export_dict64(mesh)

Export a mesh as a dictionary, with data encoded to base64.

trimesh.exchange.export.export_json(mesh)
trimesh.exchange.export.export_mesh(mesh, file_obj, file_type=None, **kwargs)

Export a Trimesh object to a file- like object, or to a filename

Parameters
  • file_obj (str, file-like) – Where should mesh be exported to

  • file_type (str or None) – Represents file type (eg: ‘stl’)

Returns

exported – Result of exporter

Return type

bytes or str

trimesh.exchange.export.export_msgpack(mesh)
trimesh.exchange.export.scene_to_dict(scene, use_base64=False)

Export a Scene object as a dict.

Parameters

scene (trimesh.Scene) – Scene object to be exported

Returns

as_dict – Scene as a dict

Return type

dict