A (not too) small physically based renderer that implements the vertex connection and merging algortihm