# FDM printing file formats

FDM (fused deposition modeling) printing is one of the most popular types of 3D printing, it is used throughout different engineering industries (medical, robotics, automotive) and also has a great number of individual users that enjoy 3D-printing as a hobby. FDM printing is so popular because it can produce near finished models of hardware with a very short manufacturing process also known as Rapid prototyping. This kind of printing was first developed and patented in 1989 by Stratasys and has made lots of advancements in the past few decades becoming much cheaper and accessible.
A key aspect of FDM printing is the use of specialized file formats that contain the data necessary to guide the printing process. These formats encode information about the 3D model, including its geometry, print settings and tool paths, ensuring that the printer accurately recreates the digital design in physical form. Understanding the various file formats associated with FDM printing is crucial for both novice and experienced users, as each format has unique characteristics that can influence the final output.

## Background
### Charles Hull and the invention of stereolithography

Charles Hull, an American engineer, is widely regarded as the inventor of stereolithography (SLA) the first 3D printing system. In 1984, Hull developed and patented the first method for creating 3D objects by curing layers of a liquid photopolymer with ultraviolet light, a process that became known as stereolithography.
Recognizing the potential of his invention, Chuck Hull co-founded 3D Systems in 1986 and introduced the first commercial 3D printer, the SLA-1, in 1988. Coupled with 3D System's STL (Stereolithographic) file format, Charles Hull made a crucial development in stereolithography. The STL format was designed to encode the surface geometry of 3D models in a way that could be easily interpreted by 3D printers, making it possible to convert digital designs into physical objects with high precision. Hull's development of the STL format and his contributions to stereolithography fundamentally transformed the manufacturing industry and cemented him as the father of 3D printing.

### G-code

G-code is a programming language used to control CNC (Computer Numerical Control) machines, including FDM printers. Originating in the 1950s and 1960s, G-code specifies the movements and operations essential for the 3D printing process.
In 3D printing, G-code translates a 3D model, created in a specialized 3D printing format, into specific instructions that guide the printer. This includes commands for movement along the X, Y and Z axes, extrusion of material, temperature settings, and printing speed. This Slicing software generates the G-code layer by layer so that the model can be built from the bottom up.
Although G-code is versatile and widely used, it can be complex and may vary between different printer models. Despite these limitations, G-code remains the standard language for 3D printing, enabling precise control over the printing process.

## FDM printing file Formats
### STL (stereolithography) file format

The STL (stereolithographic) file format is the oldest and most widely used file format in 3D printing. Developed in 1987 by 3D Systems, STL was initially designed for stereolithography, but it has since become the standard format for FDM printers.
STL files recreate the geometry of a 3D CAD model using a mesh of triangles, which approximate the shape of the object. Each triangle is defined by three vertices and a normal vector that indicates the direction of the outer surface (due to the Right-Hand Rule). Because STL files only recreate the surface geometry of the CAD, they do not contain any information about the color, texture, or material properties. This simplicity in design makes them easily transferable across different platforms and software.
However, the simplicity of the STL format comes with limitations. The lack of support for complex data like color and materials means that STL files are best suited for basic 3D printing tasks. Additionally, because STL files use an approximation of the model's surface, a printed STL file may be inaccurate compared to the CAD geometry, and high-resolution models can result in very large file sizes.

### 3MF

The 3MF (3D manufacturing format) was developed by the 3MF Consortium, an industry group founded in 2015 by Microsoft, HP and Autodesk. Their goal was to address the limitations of older file formats like the STL. The 3MF format is designed to be the solution for modern 3D printing, offering better features and being completely open-source so anyone can edit it. Since its creation, the 3MF Consortium has expanded to now include over 35 companies most of which are big names in the tech and engineering world who now work to improve this format.
Like the STL format, 3MF files use a triangular mesh to represent the geometry of a CAD model. However, 3MF ensures that the mesh follows a 100% manifold format, meaning it can detect and prevent issues such as holes or overlapping triangles, ensuring the mesh accurately conforms to the intended model geometry. The 3MF can also store many other data types beyond just geometry. This includes info about the model's color, materials, textures, and even specific print settings like layer height or print speed. The ability to include this metadata within a single file makes the 3MF format versatile, particularly for complex or multi-material prints.
The advantages of the 3MF format come with its compressed XML-based structure, which makes the files smaller and more efficient to store than STL files of the same model. Being XML-based also means the code is readable making for easier development. However, being so new the 3MF format has yet to fully take over the 3D printing industry as the format is not always compatible with certain FDM printers and slicing software.

### AMF file format

The AMF (additive manufacturing) file format was developed from 2009–2011 by the ASTM, its goal was to replace the outdated STL format and was originally called the STL 2.0. The main goal of the format was to overcome the many shortcomings of the STL and become a new and streamlined file format. The AMF was then created with a slew of new and innovative features from code that was made open source for its users.
Like other 3D printing formats, AMF formats recreate CAD using a triangular mesh, but what sets the AMF apart is its ability to add curves in the triangle's edges. This innovation, along with the addition of normal vectors at each vertex of the triangles, creates 3D shapes and allows the AMF format to accurately create rounded edges and more complex geometry, all while using fewer triangles. AMF files do not only have innovative mesh geometry they are also able to record the model's color, materials, and texture and can naturally handle microstructures, sub-structures, lattice structures, mix-graded materials and porous materials. Lastly, the AMF format also has access to many metadata fields and can record info like name, author, company, description, volume, tolerance, and many more depending on the needs. With all these capabilities AMF files are the Swiss army knife of 3D printing formats and can be used for some of the most complex and sensitive prints.
The AMF format's ability to contain so much data comes from its XML structure which gives it a five element hierarchy labeled: object, material, texture, constellation and metadata. These elements all make up the AMF file and due to its XML-base the file code is fully readable. The AMF has some amazing capabilities and beats out the STL format in every way, however, The AMF has never seen much use in the industry. This is due to the file format not being compatible with most slicing software or FDM printers and the reason behind that is the developers of the AMF having poor consultancy with manufacturers and 3D printing companies.

### OBJ file format

The OBJ file format, developed by Wavefront Technologies in the 1980s, is widely used for representing 3D models. Originally designed for visual effects and animation, OBJ was adapted for FDM printing due to its ability to contain multi-color info and its open source nature.
Instead of using a triangular mesh, OBJ files recreate 3D models using tessellations made from polygons, primarily triangles, and quadrilaterals, and can even include free-form curves and surfaces. Because of this OBJ formats can accurately cover geometries and support color, texture, and material info. This makes the OBJ format particularly useful for projects requiring complex geometries or detailed surface appearances, such as multi-material or multi-color prints.
Unfortunately, the downside to OBJ files is that they are created in pairs of two. The OBJ file holds the geometric data and an MTL (material template library) file carries the color, material, and texture of the model. The problem with these two file system is that they often get separated and break the file; repairing one of these files takes time and can be very complicated. Another problem is that the OBJ file format is not usually supported for FDM printing and that plug-ins often have to be used.

### STEP file format

The STEP (Standard for the Exchange of Product Model Data) file format, also known as ISO 10303, is a standardized 3D model format in the field of engineering. STEP files are used to describe the complete 3D geometry of an object in a way that is independent of any specific CAD (Computer-Aided Design) system, making them highly interoperable across all CAD software.
Unlike, specialized 3D printing formats, STEP files are used more broadly in engineering and manufacturing. They can store a wide range of data, including not only the object's geometry but also its topology, material properties, assembly hierarchy, and other detailed information relevant to the design and manufacturing process. This makes STEP files particularly valuable in industries like aerospace, automotive and industrial design, where precise data is critical.
In the context of FDM printing, STEP files are often used during the design phase, where detailed and accurate models are created in CAD software. These models are sometimes compatible with slicing software, but are usually converted into more specialized 3D printing formats like STL or 3MF for the printing process.

## Use cases for each format
### STL

* Use Case: STL format is the oldest and most common format for FDM printing. It is widely used due to its broad compatibility with slicing software and printers.
* Advantages: High compatibility, simple straightforward representation of geometry.
* Limitations: Lacks support for color, texture, and material properties. File sizes can become large for high-resolution models and its geometry isn't always true to the CAD.

### 3MF

* Use Case: 3MF format is used for advanced 3D printing applications where detailed information such as color, textures, and material properties is required. It is ideal for complex or multi-material prints.
* Advantages: Supports color, textures, and multiple materials. Smaller XML-compressed file size and metadata fields are used to save print settings.
* Limitations: Less universally supported than STL, though this is improving.

### AMF

* Use Case: AMF format is used for complex 3D printing projects that require detailed geometry, color, and material properties. It is suited for advanced manufacturing processes and supports features like lattice structures and multiple materials.
* Advantages: Supports color, textures, complex geometries, and many material types. Its XML-based structure allows detailed metadata.
* Limitations: Not always supported by the slicing software.

### OBJ

* Use Case: OBJ format is used for 3D models that need to include color and texture information, and would be used in multi-color prints.
* Advantages: Supports detailed color, texture, and complex geometric mapping.
* Limitations: Files can easily break and are usually not supported for printing; requires the use of plug-ins.

### STEP

* Use Case: STEP format is primarily used in engineering and CAD applications for detailed design and manufacturing. STEP files are often converted into formats like STL or 3MF for actual 3D printing.
* Advantages: Detailed and accurate representation of geometry, topology, material properties, and assembly information.
* Limitations: Not directly used for 3D printing; requires conversion to other formats for printing.

## Future of printing file formats
### STEP-NC integration for FDM printing

STEP-NC (ISO 14649) is a machine tool control language created to replace G-code in CNC systems. STEP-NC works with the STEP (ISO 10303) standard and with process models to guide CNC systems. STEP-NC has already been integrated in milling and turning CNC tools. Its integration with FDM printing is possible and would revolutionize 3D printing.

#### Benefits

* Improved Precision: Using Step files FDM printing would maintain the integrity of the 3D model in the print.
* Streamlined Workflow: With STEP-NC and STEP files working together the CAD/CAM/CNC chain would be fully integrated.

#### Challenges

* Adapting STEP-NC for FDM printing: The challenge lies in creating specialized process models tailored to FDM printing.

### Future updates to 3MF and AMF formats

* Both 3MF and AMF formats are open source formats which means they can be improved by the average users and therefore have potential for development.
* The 3MF Consortium works hard to bring new updates for the 3MF format bringing new advancements to FDM printing.