Additive manufacturing file format (AMF) is an open standard for describing objects for additive manufacturing processes such as 3D printing. The official ISO/ASTM 52915:2016 standard is an XML-based format designed to allow any computer-aided design software to describe the shape and composition of any 3D object to be fabricated on any 3D printer via a computer-aided manufacturing software. Unlike its predecessor STL format, AMF has native support for color, materials, lattices, and constellations.
Structure An AMF can represent one object, or multiple objects arranged in a constellation. Each object is described as a set of non-overlapping volumes. Each volume is described by a triangular mesh that references a set of points (vertices). These vertices can be shared among volumes belonging to the same object. An AMF file can also specify the material and the color of each volume, as well as the color of each triangle in the mesh. The AMF file is compressed using the zip compression format, but the ".amf" file extension is retained. A minimal AMF reader implementation must be able to decompress an AMF file and import at least geometry information (ignoring curvature).
Basic file structure The AMF file begins with the XML declaration line specifying the XML version and encoding. The remainder of the file is enclosed between an opening <amf> element and a closing </amf> element. The unit system can also be specified (millimeter, inch, feet, meter or micrometer). In absence of a units specification, millimeters are assumed. Within the AMF brackets, there are five top level elements. Only a single object element is required for a fully functional AMF file.
<object> The object element defines a volume or volumes of material, each of which are associated with a material ID for printing. At least one object element must be present in the file. Additional objects are optional. <material> The optional material element defines one or more materials for printing with an associated material ID. If no material element is included, a single default material is assumed. <texture> The optional texture element defines one or more images or textures for color or texture mapping, each with an associated texture ID. <constellation> The optional constellation element hierarchically combines objects and other constellations into a relative pattern for printing. <metadata> The optional metadata element specifies additional information about the object(s) and elements contained in the file.
Geometry specification The format uses a Face-vertex polygon mesh layout. Each top-level <object> element specifies a unique id. The <object> element can also optionally specify a material. The entire mesh geometry is contained in a single <mesh> element. The mesh is defined using one <vertices> element and one or more <volume> elements. The required <vertices> element lists all vertices that are used in this object. Each vertex is implicitly assigned a number in the order in which it was declared, starting at zero. The required child element <coordinates> gives the position of the point in 3D space using the <x>, <y> and <z> elements. After the vertex information, at least one <volume> element must be included. Each volume encapsulates a closed volume of the object, Multiple volumes can be specified in a single object. Volumes may share vertices at interfaces but may not have any overlapping volume. Within each volume, the child element <triangle> is used to define triangles that tessellate the surface of the volume. Each <triangle> element will list three vertices from the set of indices of the previously defined vertices given in the <vertices> element. The indices of the three vertices of the triangles are specified using the <v1>, <v2> and <v3> elements. The order of the vertices must be according to the right-hand rule, such that vertices are listed in counter-clockwise order as viewed from the outside. Each triangle is implicitly assigned a number in the order in which it was declared, starting at zero.
Color specification Colors are introduced using the <color> element by specifying the red, green, blue and alpha (transparency) channels in the sRGB color space as numbers in the range of 0 to 1. The <color> element can be inserted at the material, object, volume, vertex, or triangle levels, and takes priority in reverse order (triangle color is highest priority). The transparency channel specifies to what degree the color from the lower level is blended in. By default, all values are set to zero. A color can also be specified by referring to a formula that can use a variety of coordinate-dependent functions.
Texture maps Texture maps allow assigning color or material to a surface or a volume, borrowing from the idea of Texture mapping in graphics. The <texture> element is first used to associate a texture-id with particular texture data. The data can be represented as either a 2D or a 3D array, depending on whether the color or material need to be mapped to a surface or a volume. The data is represented as a string of bytes in Base64 encoding, one byte per pixel specifying the grayscale level in the 0-255 range. Once the texture-id is assigned, the texture data can be referenced in a color formula, such as in the example below. Usually, however, the coordinates will not be used directly as shown above, but transformed first to bring them from object coordinates to texture coordinates. For example, tex(1,f1(x,y,z),f2(x,y,z),f3(x,y,z)) where f1(), f2(), f3() are some functions, typically linear.
Material specification Materials are introduced using the <material> element. Each material is assigned a unique id. Geometric volumes are associated with materials by specifying a material-id within the <volume> element.
… excerpt ends here. Continue reading the full article.


