Expand description
3MF: the mesh package, written with its own archive.
A 3MF file is a ZIP holding three parts: the content-types declaration, a relationship pointing at the model, and the model itself: an XML document of meshes and the items that place them. The archive is written and read here, with no library behind it.
It writes stored entries (no compression), which the ZIP format allows and every reader accepts: what writing a package needs is the container, not the codec. A file written this way is larger than one deflated.
Reading is the other way round. Every package a slicer or a modelling
tool writes is deflated, so read_3mf inflates, with the decoder half
of DEFLATE kept in this crate, and reads the archive through its central
directory, where the sizes are, since a streamed entry leaves them out
of its local header.
Structs§
- Object
- One mesh in the package, with the name the item carries.
- Package
Limits - How much of a package
read_package_withinmay read: how many entries, directories aside, and how many bytes they inflate to in all. - Three
MfImport - What
read_3mffound. - Three
MfObject - One object of a package, placed as its build item places it.
- Three
MfVolume - One volume of an object: a run of the object’s triangles, and what it is for.
Enums§
- Object
Role - What a volume is for, as the metadata a package’s writer keeps names its role.
- Object
Type - What a 3MF object is for, as its
typeattribute says.
Functions§
- read_
3mf - Read a 3MF package into placed meshes.
- read_
package - Read every part of a package: the entry names and their bytes.
- read_
package_ within read_package, refusing a package pastlimitsbefore reading any entry.- write_
3mf - Write meshes as a 3MF package.