Add function to convert bricks to tets

with self test