Discussion:
[geda-user] vectorized schematics on web page
Kai-Martin Knaak
2014-08-01 02:56:37 UTC
Permalink
I like to put documentation on my projects on a dokuwiki web page.
However, when I got my stuff going, schematics were a bit cumbersome.
Pixelized versions tended to be huge in file size and still hardly
legible. Vector graphics did not render well in www browsers. So I
settled for downloadable PDFs.

Today, I tried again and was pleasantly surprised. The relevant tools
have improved! The new gaf tool of geda facilitates the export (Thank
you so much, Peter Brett!). There is a plugin for dokuwiki, which adds
a caption and allows to link dynamically to the figure. And finally
major www browsers can handle images in SVG format.

Here is the result:
http://bibo.iqo.uni-hannover.de/dokuwiki/doku.php?id=bauteil:spannungskonstanten&#variable_positive_spannung
(German only, but I think you get the impression)
You can click on the image to get a scaled version.

The work-flow was surprisingly straight forward:

1) export the schematic as *.eps
gaf export -l auto -o foobar.eps foobar.sch

2) convert to *.svg
inkscape --export-plain-svg=foobar.svg foobar.eps

3) command in dokuwiki :
<imgcaption xy|lorem ipsum>{{ :foobar.svg?300}}</imgcaption>

---<)kaimartin(>---
--
Kai-Martin Knaak tel: +49-511-762-2895
Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211
Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de
GPG key: http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmk&op=get
Stefan Salewski
2014-08-01 11:13:22 UTC
Permalink
Post by Kai-Martin Knaak
Today, I tried again and was pleasantly surprised.
Yes that is nice -- the path over eps is a bit strange, cairo should
have native svg export. But not tested yet.

I have recently installed the geda 1.9.1, just to ensure that my own
path processing is compatible. There is indeed some progress, so I
really wonder why it is called instable and not included in
distributions for more than one year.

I wonder about

ldd /usr/bin/gschem

libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007fe689dba000)

What part of gschem may use OpenGl? Maybe cairo-gl backend is used, but
that is generally not advertised by cairo developers? Fast vector
drawing is generally a problem in Linux still -- I am a bit angry about
that. Cairo is fine but not fast, cairo-gl is not really supportet, and
even GTKGLExt seems to have bit rotted, GTK3 is not really official
supported. Seems that fast vector drawing is really better supported in
Qt.

For my gschem peted clone -- I should be able to finish a first working
release soon -- busses, pictures and undo will be unsupported, not
because that is difficult or much work, but because I do not use it.
Maybe I should support svg export for the first release?
Peter Stuge
2014-08-01 11:21:06 UTC
Permalink
Post by Kai-Martin Knaak
http://bibo.iqo.uni-hannover.de/dokuwiki/doku.php?id=bauteil:spannungskonstanten&#variable_positive_spannung
Nice!


//Peter
Rupert Swarbrick
2014-08-01 18:14:04 UTC
Permalink
Kai-Martin Knaak
Post by Kai-Martin Knaak
http://bibo.iqo.uni-hannover.de/dokuwiki/doku.php?id=bauteil:spannungskonstanten&#variable_positive_spannung
(German only, but I think you get the impression)
You can click on the image to get a scaled version.
Nice! Slightly hijacking this thread, but I hadn't seen that style of
resistor symbol before. Does the triangle in the bottom right signify
anything in particular?


Rupert
Dave McGuire
2014-08-01 19:27:20 UTC
Permalink
Post by Kai-Martin Knaak
Kai-Martin Knaak
Post by Kai-Martin Knaak
http://bibo.iqo.uni-hannover.de/dokuwiki/doku.php?id=bauteil:spannungskonstanten&#variable_positive_spannung
(German only, but I think you get the impression)
You can click on the image to get a scaled version.
Nice! Slightly hijacking this thread, but I hadn't seen that style of
resistor symbol before. Does the triangle in the bottom right signify
anything in particular?
It's a polarized resistor, of course. I have a large stock of them; I
keep them in a cabinet with my GR-874 M-M and F-F adapters!

-Dave
--
Dave McGuire, AK4HZ/3
New Kensington, PA
John Griessen
2014-08-01 20:29:59 UTC
Permalink
Post by Dave McGuire
It's a polarized resistor, of course. I have a large stock of them; I
keep them in a cabinet with my GR-874 M-M and F-F adapters!
A Cheshire cabinet no doubt...
Kai-Martin Knaak
2014-08-01 20:27:46 UTC
Permalink
Post by Rupert Swarbrick
but I hadn't seen that style of
resistor symbol before. Does the triangle in the bottom right signify
anything in particular?
It marks pin 1 of the resistor.
My footprints also feature mark at pin 1 -- With thru hole technology the
pad is square. With SMD footprints there is a kink at the corner in the
silk frame. This facilitates probing for signals during the inevitable
debug stage. I know which side of the resistor I need to stab with my
scope probe if am interested in that particular spot in the schematic.
SMD resistor solder joints are often the more convenient to probe than
that tiny output pin that sits just next to Vcc.

I adopted these polarized resistor symbols from my former boss.

---<)kaimartin(>---
--
Kai-Martin Knaak tel: +49-511-762-2895
Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211
Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de
GPG key: http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmk&op=get
Kai-Martin Knaak
2014-08-01 20:46:44 UTC
Permalink
Post by Kai-Martin Knaak
With SMD footprints there is a kink at the corner in the
silk frame.
Examble:
http://www.gedasymbols.org/user/kai_martin_knaak/footprints/generic/0805.fp

---<)kaimartin(>---
--
Kai-Martin Knaak tel: +49-511-762-2895
Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211
Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de
GPG key: http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmk&op=get
Rupert Swarbrick
2014-08-02 09:05:48 UTC
Permalink
Kai-Martin Knaak
Post by Kai-Martin Knaak
Post by Rupert Swarbrick
but I hadn't seen that style of
resistor symbol before. Does the triangle in the bottom right signify
anything in particular?
It marks pin 1 of the resistor.
My footprints also feature mark at pin 1 -- With thru hole technology the
pad is square. With SMD footprints there is a kink at the corner in the
silk frame. This facilitates probing for signals during the inevitable
debug stage. I know which side of the resistor I need to stab with my
scope probe if am interested in that particular spot in the schematic.
SMD resistor solder joints are often the more convenient to probe than
that tiny output pin that sits just next to Vcc.
I adopted these polarized resistor symbols from my former boss.
Aaah. That makes sense! I was thinking "Huh? non-polar component. What
on Earth is he doing?", but now I understand. A great idea!

Rupert
Vladimir Zhbanov
2014-08-07 05:46:35 UTC
Permalink
Post by Kai-Martin Knaak
I like to put documentation on my projects on a dokuwiki web page.
However, when I got my stuff going, schematics were a bit cumbersome.
Pixelized versions tended to be huge in file size and still hardly
legible. Vector graphics did not render well in www browsers. So I
settled for downloadable PDFs.
To reduce the output file size for B&W PNG pictures I use the
following command:
pngtopnm foo.png |pnmdepth 1| ppmquant 2| pnmcrop -white|
pnmtopng -transparent white > bar.png

pnmcrop just crops the picture margins.
Post by Kai-Martin Knaak
Today, I tried again and was pleasantly surprised. The relevant tools
have improved! The new gaf tool of geda facilitates the export (Thank
you so much, Peter Brett!). There is a plugin for dokuwiki, which adds
a caption and allows to link dynamically to the figure. And finally
major www browsers can handle images in SVG format.
http://bibo.iqo.uni-hannover.de/dokuwiki/doku.php?id=bauteil:spannungskonstanten&#variable_positive_spannung
(German only, but I think you get the impression)
You can click on the image to get a scaled version.
1) export the schematic as *.eps
gaf export -l auto -o foobar.eps foobar.sch
2) convert to *.svg
inkscape --export-plain-svg=foobar.svg foobar.eps
I've just committed a fix for the gaf utility which enables direct
SVG output with the command like this:
gaf export -o foobar.svg foobar.sch

You can try it out. For me, it works better than the sch->eps->svg
path since the eps->svg part breaks my custom utf-8 font view. Its
output size is bigger, though.
Post by Kai-Martin Knaak
<imgcaption xy|lorem ipsum>{{ :foobar.svg?300}}</imgcaption>
Are you using some plugin? If so, we could use it in the gEDA
wiki.

A few years ago I tried three dokuwiki plugins for svg support,
some of them seemed to be working but no one worked well.

Vladimir
Kai-Martin Knaak
2014-08-07 18:41:05 UTC
Permalink
Post by Vladimir Zhbanov
I've just committed a fix for the gaf utility which enables direct
gaf export -o foobar.svg foobar.sch
Great!
I gave it a try with the voltage regulator example. There were no obvious
differences when rendered on screen. Both rendered fine in firefox,
chromium, rekonq and IE 11.
My next wish would be options to export only a certain area.
Post by Vladimir Zhbanov
Post by Kai-Martin Knaak
<imgcaption xy|lorem ipsum>{{ :foobar.svg?300}}</imgcaption>
Are you using some plugin? If so, we could use it in the gEDA
wiki.
A few years ago I tried three dokuwiki plugins for svg support,
some of them seemed to be working but no one worked well.
The SVG format did not require any specific dokuwiki plugin. My site runs
dokuwiki version 2014-05-05 "Ponder Stibbons", which is the most current
release. Luckily, it is already included in Debian/testing. I use the
imagereference plugin to achieve frame and caption:
https://www.dokuwiki.org/plugin:imagereference

For some reason the similar (and more popular) imagebox plugin did not
render SVG images. So I switched to the imagereference plugin.

---<)kaimartin(>---
--
Kai-Martin Knaak tel: +49-511-762-2895
Universität Hannover, Inst. für Quantenoptik fax: +49-511-762-2211
Welfengarten 1, 30167 Hannover http://www.iqo.uni-hannover.de
GPG key: http://pgp.mit.edu:11371/pks/lookup?search=Knaak+kmk&op=get
Loading...