Automating the foam dragon