[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Viewdraw conversion



> > > I see there is a
> > > conversion program that takes in viewdraw files and converts them to
> > > gschem format. I was wondering if there is a  program that does the
> > > reverse of that, ie., converts geda files back to Viewdraw format?
> >
> > Nope.  Not yet.
> 
> Hmm,..  does anyone know if it's very hard to write it my own. Is there a
> 1-to-1 correspondence between geda format and viewdraw format (or one is a
> subset of another?) ?

The gEDA file format is similar to the Viewdraw file format.  In
particular, they are both line-oriented formats, with the first char
on teh line identifying the object, followed by a bunch of numerical
parameters.  However, the exact interpretation of the numbers may
differ between teh programs ... I don't know the exact differences.

The good news is that the gEDA file format is very well documented.
Read about it in the docs available on the website.

As for the Viewdraw file format, it is less well documented.  Several
years ago I spent some time reverse engineering it.  I wrote a doc
about my findings and posted it on the web here:

http://www.brorson.com/ViewDraw/FileFormat.html

My doc is incomplete, but it is a decent start.  My page also links to
a posting on the Innoveda users group (Yahoo group) which also has
some file format info. 

> Believe it or not, I'm thinking of hacking geda to support Viewdraw native
> format.  Of course,  I'd love to hear from you guys if this is even feasibl=
> e
> without having to spend years in coding... :-)

IMHO, you should just write a translator.  It can't be too hard to
write something in Perl or Python.  Since the Viewdraw format is
ASCII, and the formats are similar, you may just need to write a
line-by-line translator, which would be relatively easy.  The program
would just take a Viewdraw file as input and write a gEDA file as
output (or vice-versa).  Don't bother
trying to graft the Viewdraw file format directly into gEDA.  That
would be difficult and unnecessary since a translator would acheive
your goal just as easily.

Finally, if you do write a translator, would you be willing to GPL it
and share it with the gEDA Project?

Happy hacking!

Stuart