What a .3mf contains

A .3mf is an OPC package: a ZIP with rules about what goes inside.

Which files are inside?

File Holds
[Content_Types].xml The type of each file
_rels/.rels Points to the model and thumbnail
3D/3dmodel.model The model: objects and their placement
Metadata/ Thumbnails and slicer settings

Bambu Studio, OrcaSlicer and Creality Print also store each object in its own 3D/Objects/*.model file.

How an OPC package points at its own parts The root relationships part names the model part by relationship type. The model part's own relationships part names the object parts it split geometry into, and the slicer's own parts sit beside them. Nothing is addressed by path. _rels/.rels root relationships 3D/3dmodel.model the scene 3D/_rels/3dmodel.model.rels its own relationships 3D/Objects/*.model split-out geometry Metadata/* slicer parts names declares names beside

What is in the model file?

  • <model>
    • <resources>
      • <object id="1"> is a <mesh>: vertices and triangles
      • <object id="2"> is a <components> assembly
        • <component objectid="1" transform="..."/>
      • <basematerials> and any extension resources
    • <build>
      • <item objectid="2" transform="..."/> places object 2 on the plate

<resources> defines objects: a mesh, or an assembly of other objects. <build> places them on the plate with a transform. Each transform is multiplied down through the components to reach the mesh.

How does a placed object become triangles?

Each step multiplies in its own transform before the last one lands as triangles on the plate:

  1. take the transformthe one on the <item> in <build>
  2. resolve objectidfind that <object> in <resources>
  3. recurse an assemblyinto each <component>, multiplying transforms down the tree
  4. emit a <mesh>its triangles land under the accumulated transform

An assembly nested three deep accumulates three transforms before its triangles land.

What rules must a valid file follow?

  • One <build> per model file.
  • No object may contain itself.
  • Meshes must be closed: every edge shared by exactly two triangles.
  • Units default to millimetres.

Where is it specified?

The 3MF Core Specification. lib3mf is the reference reader preslice uses.