trimesh.exchange.threemf module

trimesh.exchange.threemf.export_3MF(mesh, batch_size=4096, compression=8, compresslevel=5)

Converts a Trimesh object into a 3MF file.

Parameters:
  • trimesh.trimesh (mesh) – Mesh or Scene to export.

  • batch_size (int) – Number of nodes to write per batch.

  • compression (zipfile.ZIP_*) – Type of zip compression to use in this export.

  • compresslevel (int) – For Python > 3.7 specify the 0-9 compression level.

Returns:

export – Represents geometry as a 3MF file.

Return type:

bytes

trimesh.exchange.threemf.load_3MF(file_obj, postprocess=True, **kwargs)

Load a 3MF formatted file into a Trimesh scene.

Parameters:

file_obj (file-like) – Contains 3MF formatted data

Returns:

kwargs – Constructor arguments for trimesh.Scene

Return type:

dict