What is an OBJ File : Discover this 3D Printing File Format

An OBJ file, or .obj file, is a very common type of 3D file. It is often used as an exchange format by many software programs as an alternative to STL files (.stl files) when information about colors or materials is desirable. OBJ is the preferred format for multi-color 3D printing but it is also used for other 3D graphics applications. It contains a three-dimensional object, all its geometry, such as the position of each vertex, texture vertices, polygonal faces, free-form curves, etc.

The OBJ file format was developed by Wavefront Technologies (designers of 3D Maya modeling software) for its Advanced Visualizer package. This file format can be exported and opened by various 3D image editing programs. It is very frequently used and has become one of the primary exchange file formats between software.

OBJ-file
OBJ file representing a cube : representation of a cube with a 1-unit side and its obj. file code

General information about the OBJ file format

The OBJ file format uses ASCII format (plain text) with a simple syntax. The main sections of OBJ files contain vertex lines of type (type v), texture coordinates (type vp), vertex texture (vt) normal coordinates (type vn), and faces (type f).

As this file format is using ASCII, it is making it possible to edit the files in a text editor.

It’s important to keep in mind that the OBJ file format won’t let you store color and texture information itself,  these info must be stored in another file format called the Material Template Library file (MTL file) format. When actually using these two files together, rendering a multi-color textured model is possible.

The OBJ file format is more and more often used to share 3D models in graphics applications because it is offering a good import and export support from all the most used CAD software. What makes it so popular is also its ability for multi-color 3D printing, which is a big advantage compared to the STL file format, which is not supporting color and texture information.

Materials and colors

As we just saw, the OBJ file may be accompanied by a MTL (Material Library) file, which references the materials and colors used.

On sculpteo.com, for example, the MTL file and the OBJ file can be downloaded together into an archive file (ZIP file for example) to use the texture, colour and material information. It’s one of the best formats for printing multi-colored material.

Primary differences compared to STL files

Often used as an alternative to STL files, OBJ files differ:

  • Because they allow colours, textures and materials (including texture coordinates) to be encoded;
  • Because they can process non-triangular faces (quadrilaterals, etc.), along with the challenge that these faces must remain flat;
  • Because they encode 3D mesh topology, which is the faces' proximity to each other.

Where to find OBJ files

You can find free OBJ files or OBJ files for sale on 3D file downloading platforms like Turbosquid or CGTrader.

How to open an OBJ file

Opening a 3D file can be done using file conversion software. Blender is one possible solution.  More simply, you can also send the OBJ file to the Sculpteo platform , which imports these files directly.

3D Turbo, Maya Autodesk, MeshLab, 3D Studio Max, LightWave 3D Newtek, GLC Player: These 3D programs can also open OBJ files.

 

Example of code to process OBJ files

The simple, textual structure of an OBJ file makes it easy for programming languages to handle it.  For example, it is very easy to open an OBJ file in python .

Can you 3D print with OBJ files?

Yes you can 3D print with OBJ files. The OBJ file format is mainly useful for multi-color 3D printing, as it contains information about the colors of the object.

    What can open an OBJ file?

    A lot of 3D programs can actually open OBJ files: Microsoft 3D Builder, Blender, Microsoft Paint 3D, NewTek Lightwave 3D, Meshlab, Maya, 3ds Max.