Quantcast
Channel: fritzing forum - Latest posts
Viewing all articles
Browse latest Browse all 29926

Poor state of part SVGs

$
0
0

I've started a less ambitious version of this :slight_smile: . My goal is to remove the px from font-size commands, convert silkscreen from white to black, and to convert style commands in parts with bendable leads to inline xml (Fritzing doesn't accept style in bendable leads). The script is in perl and uses the xml::libxml module (I expect there is a similar one in python but I know perl better) to parse svg files (I confirmed that svg files aren't regular enough for regular experssions to be enough :slight_smile: ). I started with converting the silkscreen colors from white to black as being simplest to start with (and to learn how to use the libxml module which is almost as poorly documented as Fritzing parts creation :slight_smile: .) What I have discovered so far is that there are three or four parts in core that have invalid xml in them (the libxml parser errors out, but neither Fritzing or Inkscape do, but the xml is obviously invalid on inspection). At present the script can (sloooowly :slight_smile: around 5 hours!) convert the silkscreens from white to black in core pcb svgs and I'm working on the px removal (should be easy) and the style conversion (somewhat more difficult because duplicate attributes such as a font-size inline and in the style break Fritzing if just converted to 2 font-sizes). I'd really like to remove the transforms from at least pcb so that the x y coords are in thou but I have no idea how transforms actually work (other than they change the coordinate system locally) to do that. I'm thinking that a check of the viewbox coords to pin coords (to make sure they are on .1 boundaries would be good addition but again the transforms come in to play and make that difficult (and there may be parts that don't want to be on a .1 boundary but it could be only a warning message). So I'd suggest that changing the silkscreen color from white to black and changing the style commands to inline xml for at least bendable leads should be added to your list. A check for groups copper0 and copper1 in pcb would probably be a good bet too. I completely agree that a script that at least points out variations from the standards would be very valuable to all of us.


Viewing all articles
Browse latest Browse all 29926

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>