← Back to team overview

kicad-developers team mailing list archive

Re: Import png, jpeg or svg or dxf ?

 

--- In kicad-devel@xxxxxxxxxxxxxxx, Dick Hollenbeck <dick@...> wrote: 
> This is a good idea. SVG is simply XML, so a person can use libxml2, 
> which is standard on most linux systems. A person can read the whole 
> file into a DOM tree in about 5 lines of code. Then you simply have to 
> walk the tree, and generate PCBNEW graphic constructs from them.  
> However, I do not believe that PCBNEW's graphic constructs, nor graphics 
> environment, are currently general or rich enough to support anywhere 
> near 30% of what you might find in the SVG spec.

Indeed we have to reduce/approximate them to polygons and save them in the library cache / document without too much changes.
You have excluded wxXMLDocument due bad experiences or for coding attitudes?

> However, were we to switch over to wxGraphicsContext first, then I think 
> adding SVG support could actually lead to something worthwhile. In 
> fact, one might argue that if we were to switch to wxGraphicsContext, 
> that as we do so, we re-invent our graphic primitives to match those 
> found typically in an SVG file, FIRST. Then add the domain specific 
> attributes to those graphic primitives, such as netcode, etc. This is 
> near full rewrite of PCBNEW now. But it would be like building a car 
> standing next to a junk yard. It can go pretty quick when you have all 
> the parts. The trick I think is build it from the ground up. (Don't 
> try and *swap* out a fender or bumper at a time.)
> 
> Jean-Pierre, have you had time to consider wxGraphicsContext's use in 
> pcbnew?

I'm getting mad with wx-2.9-svn i've a lot of things that doesn't work as they were in 2.8.10, for example with wxDC for example i have new SetLogicalFunction() issues, some problems with combo boxes on toolbars etc.
Isn't better to wait 2.9.0 definitive, fix new bugs, then dedicate the timeto a major restructuring? 
This could let us a better knowledge on the new wxDC and on the newly underlying wxGraphicsCtx and i think can be propedeudic to a straighter line forthe next step.

Feel free to scream, insult etc here and/or on mail ;)
--
Marco






Follow ups

References