cmonr / Eagle-ULPs

Scripts used in Eagle CAD
anomalousmaker.com
110 stars 22 forks source link

Correct Inkscape output format #9

Open kaysond opened 5 years ago

kaysond commented 5 years ago

With the instructions in the README, inkscape does not provide the output formatted in a way that the script can use. Fortunately, that can be corrected with a Find & Replace.

The script needs a path that looks something like: M 211.5,41.3 L 212.109707683,41.348226765 L 212.704874264,41.4920620509 L 213.26899069,41.7268507489 L 213.791045043,42.0471923694 L 214.256358048,42.4436524811 L 214.655393543,42.9084797658

Where coordinates are separated by , and there are spaces around SVG commands.

kbembedded commented 4 years ago

Tested on 6.5.0, this process is exactly what I needed.

wieselukas commented 7 months ago

Tested on Eagle 9.6.2/Inkscape 1.3.1.

It took me some time to find regular expressions to replace exactly the spaces with commas that were required. So I thought I might share my result now that I got it:

  1. in gedit go to find and replace (Ctrl+H) and check regular expression
  2. In field find enter: ([0-9]{1,6}.[0-9]{1,6}) ([0-9]{1,6}.[0-9]{1,6})
  3. In field replace with enter: \1,\2

This searches for the exact number pattern (limited to 6-digit numbers, as this was enough in my case) and the whitespace in the middle while grouping the numbers. Putting \1,\2 into replace then inputs these two groups with a comma in the middle.