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.
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:
- take the transformthe one on the
<item>in<build> - resolve
objectidfind that<object>in<resources> - recurse an assemblyinto each
<component>, multiplying transforms down the tree - 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.