Implement the new_capsule function in the GeomFactory