glTF, OBJ and STL 3D models
3D › Export › Export 3D Model… writes a 3D page as a 3D model for other programs, web pages, 3D printing and rendering. The format is chosen by the file type in its dialog (or the extension you type). glTF, OBJ and STL also read back with 3D › Models and Products › Import Model…. For COLLADA see COLLADA, for PRC PRC, and for USDZ AR proofs on iPhone and iPad. To send a model to someone who has no 3D program, make an HTML proof instead: one file that opens in a web browser.
| Format | Extension | Units, up | What it holds |
|---|---|---|---|
| glTF 2.0, binary | .glb |
metres, Y up | Each panel as a part hinged to the one it folds from, the fold as animations, materials with the artwork as textures |
| glTF 2.0, text | .gltf |
metres, Y up | The same, with its data and images inside the file |
| Wavefront OBJ | .obj, .mtl, .png |
mm, Y up | The model as shown; colours, and the artwork as PNG images beside it |
| STL (binary) | .stl |
mm, Z up | The model as shown: triangles only, no colours |
Whatever the drawing's units, the model is life-size: an inch drawing is turned into mm (and metres for glTF).
glTF
glTF is the Khronos Group's format for 3D on the web and in apps: Blender, Windows' 3D Viewer, three.js and
Babylon.js, Google's <model-viewer>, Adobe Substance and many more open it. The .glb is one binary file; the
.gltf is text, with its data and images written inside it (as data URIs), so it is one file too.
Panels and hinges
Each panel of the folded design is a node of its own, named after the panel, and each is the child of the panel it folds from (the design's base panel, or each part's first panel, at the top). A node's origin is on its crease, so a program turning it (an animator in Blender, say) turns it about the crease, as it folds. The bends at the creases are nodes of their own under the panel they are built on; a part that bends along a curved crease is one node.
The model stands as the 3D page shows it: folded as far as the slider is, with the material chosen.
The fold as animations
Two animations come with it:
- Fold: from flat to folded in 1.5 seconds, slow at the start and the end, as the 3D page's fold button runs it; in the fold order and steps the 3D page uses (3D pages).
- Unfold: the same backwards.
They turn each panel's node (31 keys, played smoothly between). The bends at the creases change shape as they fold, so they are morph targets, their weights animated with the panels; a bend that only shows part of the time is scaled to nothing while it doesn't. Programs that don't play glTF animations show the model as it stands.
Materials and artwork
The outside, the inside and the cut edges are a material each, in the 3D page's material (its colour, how rough or metallic it is, how see-through), drawn from both sides. Where the drawing has artwork printed on the outside or the inside (Appearances), that side's material has it as a texture: the artwork over the board's colour, mapped as the 3D page maps it, over the flat drawing. The print finishes go in as the standard glTF material maps, which three.js, Blender, model-viewer and most viewers show:
- Foil: in the colour texture in its colour, and metal where it is (the metallic-roughness texture).
- Varnish and spot UV: a clear coat (
KHR_materials_clearcoat) where they are, with a texture saying where; a varnish all over is a clear coat over the whole outside. - Matt varnish: rougher where it is (the metallic-roughness texture).
- Emboss and deboss: a normal map (
normalTexture), so the raised and sunk areas catch the light.
The cut edges show the board's structure as the 3D page does: corrugated flutes between their liners, a honeycomb's walls, plies or a wrapped core, as an image of one repeat of it seen square on ("Edges structure"), repeated along the edges. A corrugated edge's image is placed by where the edge cuts the flutes, so an edge across the flutes shows their waves and an edge along them the one place it cuts them.
What the 3D page draws in its own way and glTF can't hold is left out: photo textures that repeat, the creases' grooves, and the depth the 3D page gives a cut edge's flutes and cells as you look into them.
The textures are PNG images inside the file, at most 4096 pixels across (larger artwork is scaled down).
OBJ
The .obj holds the model as it is shown (no hierarchy and no animation), a part for each of the outside, inside
and cut edges and for each part of an imported model, in mm with Y up. Its colours are in a .mtl file of the same
name beside it, and the artwork on the outside and inside in a PNG image for each side, named after the file and the
side (carton_Outside.png), which the .mtl names (map_Kd). Keep the files together.
STL
The .stl is binary STL: the model as it is shown as triangles, in mm with Z up, for 3D printing and programs that
want only the shape. It has no colours.
To email a model instead of saving it, use File › Send by Email › Export 3D Model…: see Emailing exports.
Reading them back
3D › Models and Products › Import Model… reads glTF (its colours, textures and texture coordinates; as it stands, not animated), OBJ
(with its .mtl and images) and STL (and COLLADA, PRC and
U3D), so a model exported can be shown with another drawing: a carton's insert with
the carton, say.