polyline(): simplify argument handling, remove switch