Jump to content

Importing inkscape .eps files.


crunch

Recommended Posts

Recently, I ran into a case where I wanted to import line art generated in inkscape into Houdini.

I tried saving .eps, but geps wouldn't parse the .eps generated by inkscape.

This little Python program did the trick for me though, so I thought I'd share it. It uses the little known .d format (which makes it really easy).

#!/usr/bin/python

import sys, os

def parseEPS(ifp, ofp):
    for line in ifp.readlines():
        args = line.split()
        if len(args) == 3:
            if args[2] == 'moveto':
                ofp.write('m %s %s 0\n' % (args[0], args[1]))
            elif args[2] == 'lineto':
                ofp.write('d %s %s 0\n' % (args[0], args[1]))

parseEPS( sys.stdin, sys.stdout )

It just reads from stdin and writes to stdout. You could probably easily turn this into something more useful. Example usage:

    % eps2d < foo.eps > foo.d

It's not rocket science, but I thought I'd share.

Link to comment
Share on other sites

  • 1 year later...

Hey guys. I´m trying to import Illustrator files, but I have no success at all, it first just gave me an error, sying that it could´t import the geo, but then I tried some stuff, read in the help etc, remebered the old Maya trick, that I had to save it as a illustrator v10.

Now I get the geo in, but I can´t visualize it.

Do you guys have any settings for saving out illustrator files that you could share? Like if there´s a special thing that you should tick in or something.

When I try with .eps, it gives me an error, but with .ai, i somehow get the file in, but can´t see it.

Thanks guys.

Awsome tutorials for Houdini by the way (pulverize effects and autofence).

Cheers

//Anders

Link to comment
Share on other sites

Hey guys. I´m trying to import Illustrator files, but I have no success at all, it first just gave me an error, sying that it could´t import the geo, but then I tried some stuff, read in the help etc, remebered the old Maya trick, that I had to save it as a illustrator v10.

Now I get the geo in, but I can´t visualize it.

Do you guys have any settings for saving out illustrator files that you could share? Like if there´s a special thing that you should tick in or something.

When I try with .eps, it gives me an error, but with .ai, i somehow get the file in, but can´t see it.

Thanks guys.

Awsome tutorials for Houdini by the way (pulverize effects and autofence).

Cheers

//Anders

Thanks Anders, I always export it as .ai version 8, if you want to used more recent versions uncheck the use compression flag, using compression sucks

hope that helps

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...