refactor export of shapes with pattern

use a single algorithm for lines, arcs, splines, ellipses