CSG Tree operations in libigl

Alec Jacobson

September 22, 2015

weblog/

I've added support for constructive solid geometry tree operations in libigl. Check out igl::boolean::CSGTree and the tutorial entry.

The class constructors take advantage of C++ initializer lists to make tree encoding simple using a reverse polish encoding:

// Compute result of (A ∩ B) \ ((C ∪ D) ∪ E)
igl::boolean::CSGTree<MatrixXi> CSGTree = 
  {{{VA,FA},{VB,FB},"i"},{{{VC,FC},{VD,FD},"u"},{VE,FE},"u"},"m"};

CSG tree operations in libigl