The implementation assumed closed polygons, but it should work on either. This is a partial fix for #443.