Documentation
¶
Overview ¶
Package threemf reads 3MF files (SPEC §28.5) into a model.Model: the core specification of the 3D Manufacturing Format, a zip archive whose model part (3D/3dmodel.model, found through the package's relationships) is XML, and the base materials and colors of its materials extension.
Objects with a mesh become meshes (one for each material of its triangles; colors of a color group are vertex colors, and the base material of a triangle is the material of its mesh), and objects with components become nodes with children. Every build item is a top node, with the transform of the item; an object that is used several times is built once, and its meshes are shared. The unit of the file is model.Model.Units; the positions are not scaled. Beam lattices, slices, production paths and textures are not read: a required extension that is not read is an error, one that is only used is left out with one line in the log.
Index ¶
Constants ¶
const TagThreeMFInvalid = "ThreeMFInvalid"
TagThreeMFInvalid is the tag of the error of a file that is not a valid 3MF file: an archive that is not a zip, a package with no model part, XML that is not well formed, a reference to an object or a property that is not there, an index outside the vertices, a required extension that is not read, a model with no item to build. The metadata has "reason" (a short fixed phrase) and "part" (the part of the archive), and for XML "line" and "column".
Flutter: no counterpart
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Name is the name of the model. Load sets the base name of the file when it is empty.
Name string
// Float64 keeps the positions in float64 when some of them have more digits than a float32 holds.
Float64 bool
// MaxModelBytes is the most that the model part may be once it is unpacked; a part that is larger is an error (a small archive
// can unpack to any size). Zero is 1 GiB.
MaxModelBytes int64
// Logger gets the notes of the loader (the parts that are not read, the triangles that were dropped); slog.Default() when nil.
Logger *slog.Logger
}
Options are the options of Decode and Load.
Flutter: no counterpart