Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brd2svg fails when element name has illegal characters #6

Open
udif opened this issue Aug 12, 2015 · 3 comments
Open

brd2svg fails when element name has illegal characters #6

udif opened this issue Aug 12, 2015 · 3 comments
Labels

Comments

@udif
Copy link

udif commented Aug 12, 2015

It seems that there is no sanitation done on characters that appear in element names.
I tried converting a board (http://www.seeedstudio.com/wiki/images/0/0b/Lipo_rider_v1.1.zip) that unfortunately has an element (on/off switch) called "ON<-->OFF".

The '<' and '>' are then copied into the XML unescaped (should be converted to "&lt;" and "&gt;" respectively). I haven't checked for other characters that might need escaping but I would guess they are not handled correctly as well.

Note: modified comment to escape the original XML escape sequence for '<'. It seems markdown has munched my original sequence and converted it to a real '<', making my comment not really clear.

@aknoerig
Copy link
Contributor

Thanks, good point!
So this means that you actually got brd2svg to run? Can you share your fixes to the font issue and possible other changes?

@udif
Copy link
Author

udif commented Aug 12, 2015

I took a look to see what font issues you are talking about and I see other people are having troubles getting brd2svg run without errors. Here is my flow:
I use OSX 10.10.4 with qt4.7.8 taken from mac ports.
I compiled brd2svg using Qt Creator and all went fine (just 3 warnings).

Still, saying I "got brd2svg to work" is a bit exaggerated :-)

I filed this bug while trying first to get the script to run without errors.
Later, I manually fixed all instances of '<' and '>' into &lt; and &gt; respectively, and reran.
I managed to get an output , including a '.fzp' file and several SVG files.
I haven't been able to use the fzp file but I managed to open the SVG files in Inkscape. The breadboard one, which is what I really wanted was a total mess. Instead of a nice board picture I got one grey square inside a green square.
The PCB one was a bit better, showing all the component pads, but again , rather useless for my purpose.
The schematic one looked the best , but its not useful for me.

I really needed this to be able to represent the LiPo Rider board in a wiring diagram , so I expected to get an SVG with a green or red board showing all the components in a top view.
Maybe I should try doing this via KiCad which has a free 3D export (I need a top view without perspective effects).

Frankly, I think this tool needs to be rewritten from grounds-up in your favorite scripting language (Python or whatever) and base its input on the native XML from Eagle 6.x+
As much as I like C++, I think using Qt just for some DOM processing (as far as I can tell) is a huge overkill.

Note: Reedited comment with minor fixes

@aknoerig
Copy link
Contributor

Thanks! So basically no changes were required for it to run?

See issue #5 on how to properly "import" the generated files.

The breadboard image should indeed look much better. Since not all Eagle files are created equal, you might have to tweak some parameters in the params.xml. Especially for mapping layers, if I remember correctly.

The tool could definitely use a rewrite of the Eagle part, so that it's no longer necessary to run Eagle itself. (I'll make an issue for that.) On the other hand, given that it's written in Qt makes makes it possible to integrate it into the UI at some point.

@aknoerig aknoerig added the bug label Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants