[Skencil-users] Scripted, command-line drawing example for Skencil 1.0alpha

sdaau sd at imi.aau.dk
Sun Dec 26 00:34:51 CET 2010


Hi all,

I have just posted a basic example script - demonstrating scripted, 
command line, drawing - here:

http://sdaaubckp.svn.sourceforge.net/viewvc/sdaaubckp/single-scripts/cmdline_draw_skencil_script.py?view=markup

(you can also find a modified sk2ps in the same directory, that runs 
with 1.0alpha)

The kind of use shown there is similar to how one would use 'tikz' in 
'LaTeX' - i.e. you code your figure in a text file, and then you run 
some software on your figure code and get a vector output (pdf, ps) of 
your figure in the end.

The code there just shows placement and styling of textfield, line (with 
arrows for head/tail, one of the arrows being a circle), and rectangle - 
where the positioning is done based on the transformed properties of 
objects (such as the text field width for a given font). And that 
demonstrates it could possibly be used for more complex 
illustrations/figures.

Btw tikz is awesome, as long as you don't start putting things in groups 
that rotate, and then trying to calculate bounding box sizes..

I guess what I often lack is the possibility to make graphic object 
classes, like often done in Actionscript [which I also considered - but 
in the end, I'd need to convert swf to pdf/ps, and with all the 
different versions and VMs, that can turn out to be problematic]

I was *very* surprised not to find any examples of how one goes about 
this in Skencil - it is certainly one area people could be interested 
in... Luckily, it was not impossible to dig through the Python source, 
in order to put a basic example together - although not trival either; 
which is why I thought I'd post on the list about it. (don't know if 
anyone intended to write documentation about this kind of a workflow - 
if not, the developers are welcome to use it as such, or improved, as 
distribution examples or on the webpage).

In any case - thanks for the awesome software; and thanks for the 
'resurrection'; I certainly am glad for it!

Cheers!



(PS: Btw, couple of bugs for the ubuntu deb:

* after install, skencil didn't want to start, until I changed:
/usr/lib/python2.6/dist-packages/skencil/Sketch/Base/gtkutils.py
line 73:
-font_size = int(vals[-1])
+font_size = int(float(vals[-1]))

* In the GUI, I can place text - but cannot type; when started from 
command line, stderr reports:

EditSelection.GetObjectMethod: editor 
<Sketch.Graphics.selection.EditorWrapper instance at 0x95453ac> is not 
compatible with class skencil.Sketch.Graphics.text.CommonTextEditor

... but, as I hinted above, I don't necessarily need the GUI all that 
much these days :)
)


More information about the Skencil-users mailing list