Importing eps files

if you export line art from vector graphics programs into an encapsulated postscript (EPS) file and open the
EPS with a filereader you are likely to get something like


s
173.197 145.21 mo
210.843 170.097 li
256.055 159.6 li
241.617 200.92 li
263.168 238.5 li
220.486 235.923 li
192.482 266.419 li
175.168 228.729 li
138.713 209.995 li
171.612 186.667 li
173.197 145.21 li
cp
0 0 0 1 cmyk
s
278.5 256.5 mo
234.859 253.601 li
207.73 287.909 li
197.001 245.507 li
155.99 230.307 li
193 207 li
194.784 163.299 li
228.386 191.296 li
270.5 179.488 li
254.256 220.097 li
278.5 256.5 li
cp
0 0 0 1 cmyk
S

an EPS is a simple ascii file contraing commands for the postscript programming language. a typical EPS exporter will output your vector data in a quite comprehensible format (as long as you stick to simple graphics). the above EPS basically does some simple turtle graphics with moveto and lineto commands:
the important commands are
278.5 256.5 mo
which moves the virtual pen to a given x/y position, and
234.859 253.601 li
which draws a line from the current position to the given position.

the attached patch contains a little regexpr which parses the above text and splits out all moveto and lineto commands in a eps as spreads. this makes is easy to import vectors from 2d programs like Adobe Illustrator or Macromedia Freehand. Note that the patch imports only a very small subset of eps - no line styles, no colors, no characters. just pure simple vectors. an extension to bezier curves would make a useful extension.

note that writing line art EPS should prove very easy from within vvvv.

nice ! … and patch, please ;)

here; again?

oschatz wrote:

the attached patch contains a little regexpr which…

where did you hide that patch?

i also see no attachement … !?

ok. i´ll attach a third time…

and a fourth time

epspathparser.v4p (14.1 kB)

yippie !!!

worked, albeit while getting Notice: Undefined variable: dbTiki in /var/www/tikiwiki/lib/tikilib.php on line 261
Invalid db object passed to CommentsLib constructor
hmm. file under tiki bugs.

thx !.. no text …