Infrastructure for solid modeling.
(formerly known as mkeeter/ao)
libfive is a framework for solid modeling using
It includes several layers, ranging from infrastructure to GUI:
libfiveshared library contains functions to build, manipulate, and render f-reps. A great deal of work has gone into the meshing algorithm, which produces watertight, manifold, hierarchical, feature-preserving triangle meshes. The library is written in C++ and exposes a C API in
libfive-guileis a Guile binding to
libfive. It exposes a high-level API to construct shapes, and includes a standard library of shapes, transforms, and CSG operations.
- Studio is a GUI application in the style of
libfive-guileand allows for live-coding of solid models. The interface also includes direct modeling, where the user can push and pull on the model's surface to change variables in the script.
Other projects using
- Tovero: A 3D modeling system for Common Lisp
libfivepy: A Python CAD library (work in progress)
- Bindings for Unity
- Unpublished Stanza bindings (email for details)
- Inspekt3D: Lightweight pure-Guile viewer
- PyFive3D: Lightweight pure-Python viewer (work in progress)
- C5H12 (Pentane): Lightweight C viewer
- Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces:
a technical paper extending
libfiveto render on the GPU (reference implementation)
(c) 2015-2021 Matthew Keeter
Different layers of this project are released under different licenses:
libfivelibrary is released under the Mozilla Public License, version 2.
Studioare released under the GNU General Public License, version 2 or later.
Contact the author to discuss custom development, integration, or commercial support.
Compiling from source
The full system (
libfive-guile + Studio)
has been successfully compiled on Mac and Linux.
libfive kernel builds on MSVC,
and should also build with MinGW (though this is untested).
Guile bindings (optional)
If Guile isn't present, the Guile bindings won't be built.
Studio (optional, requires Guile bindings)
If Qt and Guile aren't present, Studio will not be included in the build
cmake will print a message to that effect).
homebrew installed, run
brew install cmake pkg-config eigen libpng boost guile qt
qt if you do not want Guile bindings and/or Studio to be built too.
Then, from the
libfive folder, run something like:
mkdir build cd build cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.7.0 .. make
(adjust based on your Qt installation,
and consider using
ninja for faster builds.
18.04 or later
Ubuntu 18.04 or later should have all dependencies available through the package manager
sudo apt-get install cmake pkg-config libeigen3-dev libpng-dev libboost-all-dev guile-2.2-dev qtbase5-dev
qtbase5-dev if you do not want Guile bindings and/or Studio to be built too.
Building is similar as on Mac: clone the repository, then run something like
mkdir build cd build cmake -DCMAKE_PREFIX_PATH=<QT INSTALL PATH>/5.7/gcc_64 .. make -j4
(adjusting the Qt path to your install location)
sudo make install will install
libfive.so (the core shared library)
If Guile bindings are enabled,
they will be pre-compiled and installed to Guile's
If Studio was also built, the
Studio executable will installed as well.
may be used to put the program on your desktop (untested as of yet).
Ubuntu releases before 18.04 do not provide
guile-2.2-dev, so omit that from the above package install command.
To build guile 2.2.3 from source, run
sudo apt-get install libgmp-dev libltdl-dev libunistring-dev libgc-dev libffi-dev pkg-config wget https://ftp.gnu.org/gnu/guile/guile-2.2.3.tar.gz tar -xf guile-2.2.3.tar.gz cd guile-2.2.3 ./configure make -j4 sudo make install
Then, build as above.
Ubuntu releases before 17.04 do not have high enough Qt versions,
so also omit
qtbase5-dev from the above package install command.
To install Qt 5.7 or later, use the Qt Online Installer.
The installer will prompt for the install path, which defaults to
Then, build as above.
With Visual Studio 2017 installed, run from
git clone https://github.com/Microsoft/vcpkg.git vcpkg\bootstrap-vcpkg.bat vcpkg\vcpkg install eigen3:x86-windows-static boost:x86-windows-static libpng:x86-windows-static md build cd build cmake -DCMAKE_TOOLCHAIN_FILE="..\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x86-windows-static" -G "Visual Studio 15 2017" ..
build\libfiv.sln and build the solution. Check that
libfive-test runs correctly.