File formats

Terrafold saves models in its own .tfo format and exchanges models with other programs through common 3D formats. This page lists what Terrafold reads and writes, and introduces the terrafold-cli command-line tool.

Terrafold models (.tfo)

A .tfo file holds everything in your model: geometry, groups and components, tags, materials with their textures, scenes, matched photos, garden elements, plants and the garden time, the environment, and a preview image. Textures are stored inside the file, so you can share a single file.

  • File ▸ Open… (Ctrl+O) opens a .tfo file. Files in other supported formats open as a new, untitled model.
  • File ▸ Save (Ctrl+S) and File ▸ Save As… save it.
  • When you save over a file, the previous version is kept as <name>.backup.tfo.

Models saved by earlier versions of Terrafold as .3dc files still open. Terrafold doesn't write .3dc files: save them as .tfo.

Templates

File ▸ Save As Template… saves the current model as a template. File ▸ New from Template and the Welcome window start a new model from it. To make a template the default for new models, choose it in Preferences ▸ Template.

Import a model

File ▸ Import… brings a model file into the open model as one component, named after the file. The component follows the cursor; click to place it, or type [x,y,z] to place it at an exact point. Its materials and textures come along. If a material name is already used, the imported one gets a new name.

3D formats

FormatExtensionsImportExportNotes
Terrafold model.tfoyesyesthe native format
Earlier Terrafold model.3dcyesnoread only
COLLADA.daeyesyeskeeps component copies as instances
glTF binary.glbyesyesfull physically based materials, instances
glTF.gltfyesnowith its .bin buffers and textures next to it
Wavefront OBJ.objyesyeswith an .mtl material file
STL.stlyesyesbinary or ASCII
3D Studio.3dsyesyesobjects, materials, textures, smoothing
AutoCAD DXF.dxfyesyeslines, polylines, arcs and circles, 3D faces and meshes, blocks as components, layers as tags; binary DXF is not read
Google Earth.kmzyesyeswith placement and geo-location
.skp.skp, .skbyesnopreview, see below

File ▸ Export ▸ 3D Model… writes any format with "yes" in the Export column. Hidden geometry is left out of COLLADA, glTF, 3DS, DXF and KMZ exports.

Units

Formats that store their units (glTF, COLLADA, KMZ, and DXF files that declare units) arrive at their real size. For formats without units, Terrafold assumes:

FormatAssumed unit
STLmillimetres
OBJmetres
3DS, DXF without unitsinches

OBJ files are read as Y-up, the usual convention for that format.

.skp files

Terrafold imports .skp and .skb files saved by versions up to 2017 of the format. This import is a preview. It brings in geometry, components, tags, materials and textures, scenes, shadow settings, geo-location, axes, section planes and animation settings. Style settings are not imported yet, and newer files are not supported yet. Terrafold doesn't write .skp files.

Images and other exports

WhatCommandFormat
The current viewFile ▸ Export ▸ 2D Graphic…PNG
A section cutFile ▸ Export ▸ Section Slice…SVG
The scene animationFile ▸ Export ▸ Animation…a series of PNG images
A photoreal renderSave PNG… in the Render windowPNG
The plant scheduleFile ▸ Export ▸ Plant Schedule…CSV
The garden quantitiesFile ▸ Export ▸ Garden QuantitiesCSV
Your keyboard shortcutsExport… in Preferences ▸ ShortcutsJSON

See Rendering, Planting and Hardscape for details.

Terrafold reads these images:

  • PNG and JPEG images as material textures and for Match Photo.
  • .hdr and .exr panoramas as the environment of the Realistic style and renders.

The command-line tool

The desktop packages include terrafold-cli, which works with models without opening a window. It is handy for converting many files, making images on a server, or automating repetitive work.

CommandWhat it does
terrafold-cli info FILEprints a summary: format, units, counts, size, tags, materials and warnings (--json for JSON)
terrafold-cli convert IN OUTconverts between formats, chosen by the file extensions; --unit sets the unit of unit-less formats, --ascii writes ASCII STL
terrafold-cli export FILE OUT.pngrenders a quick image of a model, with --view, --style, --width, --height and --zoom-extents
terrafold-cli render FILE OUT.pngmakes a photoreal render; see Rendering
terrafold-cli animation FILE OUT.pngexports the scene animation as PNG frames
terrafold-cli run FILE --script SCRIPTruns a script of commands on a model, then saves it (--out) or renders it (--export)
terrafold-cli extensionruns an extension on a model; see Extensions
terrafold-cli sample --out FILEwrites the sample house
terrafold-cli commandslists every command with its parameters

Add --help after any command for its options, for example terrafold-cli render --help. Use --sample instead of a file name to work on the sample house.

Scripts

A script is a text file with one command per line. Lines starting with # are comments. For example, this script sets the units, draws a rectangle and plants a tree:

command units {"length": "m"}
command rectangle {"corner": [0, 0, 0], "size": ["14m", "10m"]}
command place_plant {"species": "betula-pendula", "position": ["2.5m", "7m", 0]}
command garden_time {"years": 5, "month": 6}
view iso
zoom_extents

Run it and save the result as a model and an image:

terrafold-cli run --script garden.txt --out garden.tfo --export garden.png

Scripts can also start tools and simulate clicks and typing (tool, pointer, key and vcb lines). The script stops at the first error unless you add --keep-going. terrafold-cli run --help describes every kind of line.

The command-line tool returns exit code 0 on success, 1 on an error and 2 when the command line itself is wrong.