A program for origami design.
Originally written by Robert J. Lang, et al.
2026 update for macOS by Vish Vishvanath, et al.
TreeMaker is a program for the design of origami bases and a sophisticated tool that helps you create complex origami figures using the tree theory of origami design. You draw a stick figure on a square, assign lengths to each stick, and TreeMaker computes a crease pattern that folds into the corresponding base.
Signed and notarized macOS builds are available from the Releases page.
- macOS: Apple Silicon (arm64), requires macOS 13.3 Ventura or later
- Built for Apple Silicon (arm64) with wxWidgets 3.2.7
- Signed with Developer ID and notarized by Apple
- Fixed crash in condition path inspector panels (issue #9)
- C++20 codebase, compiled with Clang 17
- Self-contained build system with no system-wide dependencies
- macOS 13.3 or later
- Xcode Command Line Tools (
xcode-select --install) - CMake 3.15 or later (
brew install cmake)
The included build.sh script downloads wxWidgets 3.2.7, compiles it locally
under deps/, then builds TreeMaker. No system-wide installation of wxWidgets
is required.
# Debug build (default)
./build.sh
# Release build
./build.sh ReleaseThe built application will be at build/bin/TreeMaker.app.
To remove build artifacts:
# Remove TreeMaker build only (keeps wxWidgets)
./build.sh clean
# Remove everything including wxWidgets
./build.sh clean-alllldb build/bin/TreeMaker.app/Contents/MacOS/TreeMaker- Robert J. Lang (lead author)
- Carlos Furuti (Linux port)
- Wlodzimierz 'ABX' Skiba (Windows port)
- Vish Vishvanath (2025-6 macOS refresh)
Special thanks to Erik D. Demaine, Martin L. Demaine, Toshiyuki Meguro, Alex Bateman, Marshall Bern, Barry Hayes, Tom Hull, and Fumiaki Kawahata for algorithmic insight. Thanks to Stefan Csomor and the wxWidgets team, and to Will Naylor and Bill Chapman (authors of wnlib).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See LICENSE.txt for details.
TreeMaker consists of several projects that can be built individually or together. Source code and headers for all projects is contained within the Source directory. TreeMaker can be built as a model-only library or as the full application with GUI. All the code to build the model is in the included files. However, you will need to download and build the wxWidgets libraries (<www.wxwidgets.org>) in order to build the TreeMaker application with GUI.
On macOS, build.sh handles the wxWidgets download, build, and configuration
automatically.
Source/tmModel-- the complete TreeMaker mathematical model (no GUI, no wxWidgets dependency)Source/tmwxGUI-- the TreeMaker GUI, built on wxWidgetsSource/test-- command-line test programs for parts of the modelSource/images-- images such as the splash screenSource/about-- the about page shown in the applicationSource/help-- the built-in help documentation
tmHeader.h is the required prefix header for all code (precompiled via
tmPrec.cpp). tmHeader.cpp contains assertion and log code common to all
files.
The relevant compiler symbols are:
__WXDEBUG__-- wxWidgets debug symbolTMDEBUG-- TreeMaker debug assertionsTMPROFILE-- profiling / timing outputTMWX-- building with wxWidgets GUI
For a release build of the full app, define only TMWX.
- Debug --
__WXDEBUG__+TMWX, no optimizations, full symbols. Links against wxWidgets debug libraries. Assertions break into the debugger. - Development --
TMDEBUG+TMWX, no optimizations, symbols. Links against wxWidgets release libraries. Assertions show a dialog then terminate. - Profile --
TMPROFILE+TMWX, full optimizations, symbols. Writes timing info to log. Assertions compiled out. - Release --
TMWXonly, full optimizations. Assertions compiled out, no timing or log output.
The test files are command-line tools for debugging parts of the model (no GUI).
Do not define TMWX for test code. Header search paths should include all
folders in Source/ recursively.
| Test file | Purpose | Dependencies |
|---|---|---|
tmArrayTester.cpp |
General-purpose container class | tmHeader.cpp, tmModel/tmPtrClasses |
tmDpptrTester.cpp |
Dangle-proof pointer/array classes | tmHeader.cpp, tmModel/tmPtrClasses |
tmNewtonRaphsonTester.cpp |
Newton-Raphson root-finding | tmHeader.cpp, tmModel/tmPtrClasses |
tmNLCOTester.cpp |
Nonlinear constrained optimization | tmHeader.cpp, tmModel/tmPtrClasses, tmModel/tmNLCO, tmModel/wnlib |
tmModelTester.cpp |
Full model including optimizers | tmHeader.cpp, tmModel (all subdirectories) |
The codebase is split into three groups, identifiable by prefix:
tm-- model classes (tmNode,tmTree,tmEdge, etc.)wx-- wxWidgets library classestmwx-- TreeMaker GUI classes built on wxWidgets (tmwxApp,tmwxDesignCanvas, etc.)
Naming rules:
- Classes use
PascalCasewith the appropriate prefix - Functions use
PascalCase - Variables use
camelCase - Member variables start with
m(mLoc,mPath) - Static members start with
s(sTag) - Macros, constants, and enum values use
ALL_CAPS
Implementation files may be split with a _Usage suffix (e.g.
MyClass_IO.cpp). The model (tmModel) uses exceptions, RTTI, and template
specialization. It does not depend on wxWidgets.