Split off no longer used geometric functions into shape.py.