Friday, 29 June 2012

PhD week 17: A tutorial on shading curves in Inkscape

As part of my research, I will need to illustrate anatomical structures that are useful for the identification of the weevils that I will be working with. I intend to use a combination of photographs and line drawings, using the different formats in different situations. Photos will be used in some instances (i.e. habitus images) to give a realistic idea of what the creatures look like. In some cases though, photographs give too much information, and line drawings are the way to go. To create my line drawings, I will be using the free and open-source vector graphics program Inkscape.

As the structures I will be working with are 3-dimensional, I want to convey that (to a degree) in my illustrations. Traditional line drawings would depict this by using the method of stippling. If this is replicated in Inkscape, the resulting file becomes massive and unwieldly, due to the huge number of dots that it has to handle. The digital way of doing this it to use gradients. Unfortunately, curved gradients are not supported in the SVG specifications, which means we have to fake it. A method for doing this is presented below.

1). Get the outline of the structure you're wanting to illustrate (10 points if you can guess what is illustrated here!), and fill it with the background colour.

2). Make a copy of the object and leave it off to the side.

3). Using the pencil tool (Shortcut: P), create three lines in the areas where you want the highlights and shading.

4). Using the nodes tool (Shortcut: F2), modify the lines so that they correspond to the curve of the structure.

5). Change the colour of the lines (Shortcut: Ctrl+Shift+F), increase their width and blur them. In this case the upper and lower lines are a darker grey, and the middle line is white. All lines have a blur value around 3. The colour, length and width of the line all interact with each other to determine how much blur is needed to get the highlights and shadows looking "right".

6). Select all three lines and group them (Shortcut: Ctrl+G). Send the group behind the original object, select both the lines and the object, then go to thee menu Object > Clip > Set

7). Grab the copy of the object created in step 2, and manoeuvre it behind the clipped lines (see the image at the top of the page).

There you have it! A nicely rendered picture, that fulfills my desire to have the suggestion of 3-dimensionality, without going too over the top. Unfortunately, neither Flickr nor Blogger supports SVG files, so you can't see the real benefits of vector graphics here. For those who are keen though, the SVG file created above is available on gitHub. For more discussion on curved gradients in Inkscape, check out this Inkscape forum thread. Happy illustrating!

   Giron JC, Franz NM. 2012. Phylogenetic assessment of the Caribbean weevil genus Lachnopus Schoenherr (Coleoptera: Curculionidae: Entiminae). Invertebrate Systematics 26: 67–82.
   Eberle J, Tanzler R, Riedel A. 2012. Revision and phylogenetic analysis of the Papuan weevil genus Thyestetha Pascoe (Coleoptera, Curculionidae, Cryptorhynchinae). Zootaxa 3355: 1–28.
   Teilhard de Chardin P. 1955. The Phenomenon of Man London: Fountain
   McCulloch D. 2010. A History of Christianity: The First Three Thousand Years London: Penguin
   Psalms 71–72,

Tide tables for New Zealand ports

Scott Pilgrim vs the World

No comments: