kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #02765
Re: Re: [PCBNEW] Import png, jpeg or svg or dxf ?
Marco Serantoni wrote:
--- 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 ?
No, I had forgotten about wxXMLDocument, never used it. The tinyxml
library seems nice at first glance.
Note that I was not advocating supporting XML in kicad, per se. Just
that I think a superior graphics environment, such as one that is
demanded by SVG, would help Kicad. A person could get closer to a full
graphics environment by supporting some of the things that an SVG file
demands of its interpreter. I actually am not advocating SVG support
directly, but perhaps through a conversion utility only.
Regarding the "graphis environment", it would be nice to have:
Objects contain graphical attributes
Objects get drawn into a graphics context
Objects can have transforms and can be grouped, and un-grouped.
These are all missing features in Kicad's graphics environment. It
does not have to be as rich of an environment as one capable of
supporting SVG drawing, but we are too far at the opposite end of the
spectrum currently. That is all I am saying.
And if something like wxGraphicsContext is already finding its way into
a library that we are dependent on, I think it is something that needs
to be studied as a *possible* solution to the poor graphics platform
that we suffer from now. Particularly if consider that the Mac guys
responsible for wxWidgets, chose to use wxGraphicsContext for the entire
wxDC implementation.
Dick
Follow ups
References