Wikipedia talk:WikiProject Chemistry/Structure drawing workgroup/Archive Nov 2007

Joining

edit

I'd like to join the structure workgroup. (It's what I do for a living) What do I do next? Tiptopper 02:48, 1 October 2007 (UTC)Reply

You can put your name at [1]. You can also take a look at [2] and give your comments. Other than that, you can take a look at Chemistry pages needing pictures and see if you can help draw some of the images. Hope this helps. You might also want to drop by Wikipedia:WikiProject Chemistry and Wikipedia:WikiProject Chemicals and see if there is anything else which interests you. --Rifleman 82 05:28, 1 October 2007 (UTC)Reply

Style guide

edit

Wikipedia:WikiProject Chemistry/Structure drawing is a bit strange to me. It advises such things as drawing a structure, printing it out, and scanning it in, to get around a broken evaluation version of a commercial editor! Save the trees, for crying out loud! Wouldn't it be much better to take a screenshot (e.g. with the GIMP) and trace with inkscape?

Further, it says that one shouldn't use general vector drawing programs to draw diagrams. Isn't a neatly drawn structure diagram done with inkscape far better than a huge png done with a chemical editor? See for example Image:2,N,N-TMT.svg which I did yesterday. It was done completely in inkscape. Does that make it a violation of policy? --Slashme 09:58, 29 September 2007 (UTC)Reply

I agree that SVG images are ideal. Your image seems fine. But that's beside the point. In the past, there have been images made by vector editors which have turned out less than satisfactorily. Furthermore, SVG does not always display letters reliably.
Most commercial editors do not output SVG, which is a shame because that's what most practicing chemists use. I use ChemSketch and I can draw a rather intricate structure in less than a minute. Add another minute to export to tiff and convert to png. I've tried Inkscape and the proportions do not look right. It also takes an hour or so, perhaps due to a lack of familiarity. But seeing as I edit here in my free time, I have to weigh the benefits and that falls in favor of png. --Rifleman 82 10:35, 29 September 2007 (UTC)Reply

OK, I agree with most of your points. For example, I did Image:Monosialotetrahexosylganglioside.svg in response to someone who was having trouble uploading a png successfully, as the file was so large that the wikimedia software refused to make a thumbnail. I did it with chemtool, and then tweaked the svg output a bit in inkscape (partly to force all the text to "Sans" instead of "Helvetica" which was somewhat broken). It took quite a bit longer than it would have if I just exported to png straight from chemtool, but that was a burden I took upon myself (partly to avoid working on my thesis ;-). If you look at the file history, you will see that I had to tweak my output a bit more after uploading, because inkscape doesn't interpret svg exactly the same as the software that Wikimedia uses.

With that background, I would suggest that we change the style guide from:

Please do not use regular vector-graphics programs for chemical images.

to

If you choose to use regular vector-graphics programs to create your images, be aware that the results rendered by Wikimedia may differ from the output of your program. You therefore do this at your own risk, and may not get support from other editors.

My other point was to stop suggesting that people should pass their drawings through treeware. Rather stick to the suggestion to cut and paste into another program, or trace a screenshot, or get a less broken molecule editor. Commercial software that doesn't export reliably into sane formats should not be used. --Slashme 13:13, 29 September 2007 (UTC)Reply

I don't mean to toot my own horn but accurate, reliably rendered structures can certainly be done in Inkscape. It does take significantly longer than simply exporting to TIFF (I also use ChemSketch) and converting to PNG—that can indeed only take a minute, while I usually take about 10 minutes to draw an average structure in Inkscape, between ChemSketch, exporting to WMF, fixing bonds and adding text labels. I also agree that it can be tough to get proportions right—bond thickness is a pain, and I'm still not happy with mine—but I think it's worth it, if you have the time to get acquainted with the program and tweak :)
When I did the export of that ganglioside from chemtool to inkscape, I selected the whole skeleton of the molecule and did "object to path", which fixed all bond thicknesses to the 2-point stroke that I selected.--Slashme 13:50, 29 September 2007 (UTC)Reply
As for "Please do not use regular vector-graphics programs for chemical images", I presume it means "do not create images directly in a vector graphics program without the assistance of a molecule editor". I can't imagine going through the trouble of creating a structure from scratch in Inkscape and actually managing to get it right (e.g. bond angles, label positions etc.); that would be both remarkable and unacceptably time-consuming. Fvasconcellos (t·c) 13:30, 29 September 2007 (UTC)Reply
That is covered by my proposed change to the text. As it stands, it really looks as if we're saying "don't draw your molecules in inkscape", which is what I have a problem with.--Slashme 13:50, 29 September 2007 (UTC)Reply

Many times, I have complemented Fvas' beautiful svg images. But his method (I vaguely recall he had to trace each damn bond manually) was simply too time consuming. Perhaps if Slashme and Fvas can help write a Wikipedia_talk:WikiProject_Chemistry/Structure_drawing_workgroup/SVG guide for those who are only acquainted with Inkscape, it would make a valuable addition to the style guide. --Rifleman 82 16:16, 29 September 2007 (UTC)Reply

I have put down some of my (slightly embarrassingly crude) methods at the page suggested. Maybe we should build a set of chem. templates for inkscape? And maybe we can convince the inkscape maintainers to implement hexagonal grids? --Slashme 11:19, 12 October 2007 (UTC)Reply
Ah yes, not anymore, since I found out from Selket (talk · contribs) that Inkscape can import WMF. All I have to do now is adjust a few lengths and add atom labels; I'm still not convinced, however, that my method is streamlined enough (or even efficient enough) to "officially" recommend it to others! Fvasconcellos (t·c) 18:01, 29 September 2007 (UTC)Reply
Hmm... I've just tried it. Previously I couldn't because Inkscape wasn't updated. I can manage to import the bonds, but the letters go missing. What happened? What do I do now? Insert them manually? That's not a very nice solution and aesthetically it might not be "nice".
P/S Slashme - the problem with rendering SVG in wikipedia is one of the recurring problems with this format. --Rifleman 82 05:09, 30 September 2007 (UTC)Reply
Yep, insert them manually. I export to TIFF as well as WMF and use the TIFF as a background image to get the label placement as accurate as possible. The whole process is basically this:
  1. Draw structure in ChemSketch, clean up, check stereochemistry, etc.
  2. Export to TIFF at 600 dpi
  3. Select structure, set atom label size to 67 pt—this will resize the whole structure
  4. Export to WMF
  5. Import both to Inkscape, align WMF on top of TIFF
  6. Add atom labels and join bonds (optional), delete TIFF (definitely don't want to embed that :)
  7. Save as plain SVG.
It is indeed not a very nice solution, although the results are good—that's why I don't recommend it. There are probably more streamlined ways to do it—if you find one, let me know ;) Fvasconcellos (t·c) 14:50, 30 September 2007 (UTC)Reply
I dumped this information on the "howto svg" page (mostly so that my claim of multiple methods wouldn't be a lie ;-) --Slashme 15:22, 12 October 2007 (UTC)Reply
Good :) I've since streamlined my method, and the awkward high-res export/structure resizing is no longer necessary. After a lot of trial and error, I've created a style template in ChemSketch that almost perfectly replicates the "ChemDraw" style used by Ben and User:NEUROtiker:
  • Atom labels: 28 pt
  • Bond length: 20.6 mm
  • Bond width: 2.4 pt
  • 2.5 mm between double/triple bonds, 2.5 shift
  • 3 mm-wide wedge bonds
  • 2.5 mm-wide hashed bonds
This style allows for export of the TIFF and WMF at the same size—no resizing necessary, and alignment is perfect in Inkscape. TIFF has to be exported at 90 dpi of course ("real" size). The process is now much faster, and files are more consistent as it's no longer my "personal" style. Setting the font to 45 pt in Inkscape makes for nearly perfect placement, not much tweaking necessary. Fvasconcellos (t·c) 16:16, 17 October 2007 (UTC)Reply