Read a 3MF package

Read a 3MF package#

3MF is the modern interchange format for additive manufacturing. It carries per-object geometry, names, colors, and units in a single archive. This example loads a real 3MF from the 3MF Consortium sample set (BSD-2-Clause): a colored dodecahedron chain from the material extension.

Why this matters: slicers like PrusaSlicer and Cura key off the per-object content inside the 3MF. Reading it straight into a pyvista.MultiBlock keeps a design flow headed for print.

import pyvista as pv

import pyvista_cad
from pyvista_cad.examples import downloads

Read the real 3MF package.

MultiBlock (0x7f7021f81840)
  N Blocks:   1
  X Bounds:   1.587e+00, 2.215e+02
  Y Bounds:   3.962e+00, 1.446e+02
  Z Bounds:   1.594e+00, 1.759e+01


Render the model.

pl = pv.Plotter()
pl.add_mesh(mb, multi_colors=True, show_edges=True, edge_color='black')
pl.show()
read 3mf

Total running time of the script: (0 minutes 6.352 seconds)