An algorithm to generate toroidal and helical cage structures using pentagons, hexagons and heptagons