circuit/block-diagram drawing
Asked Answered
B

6

12

I'm looking for either algorithms or visualization tool for (nice) circuit/block-diagram drawing.

I am also interested in a general formulation of the problem.

By "circuit drawing", I mean the capability of exploring place & route for block-diagrams (rectangles) with I/O ports and their connections (wires). These block-diagrams can be hierarchical i.e some blocks may have some nested internal sub-structure etc.

This topic is strongly related to classical graph-drawing, with the supplemental constraint of the need to take ports location into account, and possibly the shape of the blocks (rectangle of various sizes). Graphviz tools do not respond to the problem (at least my previous experiments have not been satisfactory).

Force-directed algorithms retain my attention, but I have just found papers on classical directed graphs.

Any hints ?

[update nov 21 2013] it seems that the best reference to date is Spönemann

Baalbeer answered 21/6, 2011 at 8:46 Comment(0)
B
6

To make production quality circuit diagrams as well as block diagrams, I strongly recommend J. D. Aplevich's "circuit macros". It's well documented and actively maintained. See the examples produced by this package circuit macros examples

There is some learning curve, for example to be able to use the "dpic" graphing language to draw your own diagram. But the tool itself is very powerful.

For me there are two remaining issues:

  1. no live update
  2. svg output is lacking

I hacked up some Javascript to

(watch m4 file change)->[m4->dpic->latex->pdf]->svg->(show in html)

Here is the gist of it

// watch .m4 file

var chokidar = require('chokidar');
var resolve = require('path').resolve;
const touch = require('touch')
const {exec} = require('child_process')

chokidar.watch("*.m4").on('change', fn=>{
   let ff = resolve(fn)
   console.log(ff, "changed")
   exec("runtask.bat " + ff, {cwd:"../"}, (err,stdin,stdout)=>{
    console.log(err,stdin, stdout)
    touch("index.html") //svg updated
    })

})

Here is the runtask.bat for Windows

m4 pgf.m4 %1 | dpic -g > tmp.tex

C:\texlive\2017\bin\win32\pdflatex template.tex

tool\dist-64bits\pdf2svg template.pdf %~dpn1.svg
tool\dist-64bits\pdf2svg template.pdf %~dp1tmp.svg

That way, you can "draw" by writing m4/dpic code and see the result in the browser live; and svg is generated from pdf which looks a lot nicer.

Bezique answered 11/2, 2018 at 13:41 Comment(0)
S
4

I am also using TikZ at the moment but you may wish to try http://blockdiag.com/

Stier answered 30/8, 2012 at 20:44 Comment(1)
Tikz rocks! It takes time to learn but you will love it. You can place the nodes at places you like. Once you have figured out the placement, rest will follow.Sidonius
P
1

Here is one: http://www.physicsbox.com/indexsolveelec2en.html

Here is where to look for others:

http://www.freebyte.com/electronics/

www.educypedia.be/electronics/easoftsim.htm

Principally answered 21/6, 2011 at 8:56 Comment(1)
Thx, Inium, for the links. However I am looking for something more general than pure electronics. There are many area where block diagrams are needed, especially in software engineering.Baalbeer
R
1

There are alternatives to graphviz that may do the job - see e.g. infovis, protovis, tulip.

See also other related questions 1, 2, 3.

Can you explain where graphviz falls short? The only requirement you list that I'm not sure about is attaching to specific ports. I would have thought you might be able to solve that with composite shapes / subgraphs, but maybe not...?

EDIT: Another option, particularly if you're looking at software engineering diagrams. Have you considered the eclipse gmp toolkit? It's what's used to build e.g. the UML2 editor tools.

hth.

Reikoreilly answered 21/6, 2011 at 11:58 Comment(3)
Concerning the problem with graphiz : I have not been able to manage the edges routing to turn the graph into something looking like a real engineer drawing (see example )Baalbeer
Concerning Eclipse, well, I know GMF, but I am not sure it can help me explore algorithms for block-diagram drawing. Need to look at it again.Baalbeer
Ah ok. No, graphviz won't do rectilinear layout. Not sure about the others. Another alternative however could be yworks (yworks.com). The library (yFiles) is not free however there is a free application (yEd) wrapping it that you can feed data into. Its rectilinear layout is pretty good (the editor provides templates for e.g. UML, BPMN). hth.Reikoreilly
M
0

I don't know of any tool that is a clear winner for easily making nice block diagrams with a minimum of manual labor. Some of the best looking results I've seen have been from TikZ. Check out the examples here:

Mealtime answered 21/6, 2011 at 18:6 Comment(3)
Tikz was also my solution, as far as visualization is concerned. I also agree that there is still some labor needed (surprisingly) to design an automatic drawing for such block-diagrams.Baalbeer
I have hope that Inkscape will become a good tool for this once the connector tool gets user-placeable connection points (wiki.inkscape.org/wiki/index.php/UsingTheConnectorTool).Mealtime
Some more links: electronics.stackexchange.com/questions/1024/…Mealtime
M
0

I have been getting very good results from Draw.io. It is a webapp but has a pretty powerful diagram editor and some decent stock symbol libraries. Drawings can be exported as PNG or SVG so can be publication quality and they link up to

Myrmeco answered 24/10, 2018 at 6:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.