Fixed function shape_outline()

The function didn't properly calculate the shape. An example script was added to verify the function.