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

Re: gEDA-user: Re: gEDA PCB Lib



Dave McGuire wrote:
On Jun 16, 2004, at 11:42 AM, Chad Robinson wrote:

Is there a way to extract graphical representations from PCB footprints, like a JPG or similar?
Just FYI, JPG would be the absolute worst format for something like this.
There's a reason why most JPG files storing non-"natural" images used on today's web sites look like crap, with lots of compression artifacts around sharp color transitions: JPG wasn't designed for this sort of image, and does not work well AT ALL on them.
For stuff like this...fields of solid color and sharp color transitions...PNG is a far better choice, and will not have such artifacts.
Leave JPG for what it was designed for...natural-scene images such as photographs.

Look, I don't mean to be rude but this is essentially a repeat of thousands of previous graphic format arguments. I didn't pick JPG for any specific reason, I just tossed it off. Fine, PNG it is.

Nonono...please don't misunderstand my comment, I'm sorry if I came off sounding bad. It was not my intention to start a graphic format argument. I apologize if what I said came out badly.

It is the case, however, that JPG is used in a lot of places where it shouldn't be. I'm sure you've seen examples of it. I do a lot of imaging work here and I run into it all the time. For natural scene images, the JPG algorithm can't be beat...but for stuff like we're talking about it's just the wrong tool for the job.

That was the only point I was trying to make.

That doesn't address the original question - how can a footprint be extracted into a graphic format in an automated fashion?

As useless as it makes me feel to say so...I have no idea. :) But I've just given it a bit of thought.

It should be fairly easy to take some of the existing code...say, the PostScript or Gerber output drivers...and use that as a base. That code already traverses all of the relevant data structures, but both PostScript and Gerber are vector-oriented formats so we'd need to render the output in a rasterized fashion. That will involve polygon fill code and stuff like that.
this should be easy once .eps file are there. You could render them via ghostscript to any pixel format wanted.

you also need the fileformat parser from pcb and, as written, the ps output stage. To enable batch processing probably a "new" commandline option added into pcb would be an idea? smth like
pcb footprintfile outputfile.eps --convertfiletoeps

G.

  So, it'd be a bit of work, but it could certainly be done.

        -Dave

--
Dave McGuire          "PC users only know two 'solutions'...
Cape Coral, FL          reboot and upgrade."    -Jonathan Patschke