Dear Andrey Paramonov, I am cleaning up my email inbox these days, and just ran into your email to cdk-user@...
On Tue, May 1, 2012 at 9:57 PM, Андрей Парамонов <[email protected]> wrote: > I'm trying to implement a simple MOL-to-SVG renderer using CDK 1.4.7. > The source code, input and output files are attached. > > The rendering per se seems to work Ok, however I cannot get the > renderer to use "natural" size of the molecule. Ideally, I'd like to > be able to > > 1) Scale the coordinates so the average bond length equals to some > predefined value, i.e. 83, > 2) Move the coordinates so the molecule's bounding box starts at (0, 0), > 3) Get the bounding box dimensions and pass them to SVGGraphics2D. > > Currently I use the following in an attempt to do 2) and 3): > > Dimension size = GeometryTools.get2DDimension(mol); > VectorGraphics canvas = new SVGGraphics2D(outputStream, size); > > but the molecule gets totally misplaced. I do not have a quick answer for that, and would have to look at your code in more detail... but maybe you already solved it? Also, I want to point you to the option of creating SVG via the JChemPaint stack? There is activity in that area: https://github.com/JChemPaint/jchempaint/wiki/The-svg-font-problem-and-its-solution Egon -- Dr E.L. Willighagen Postdoctoral Researcher Department of Bioinformatics - BiGCaT Maastricht University (http://www.bigcat.unimaas.nl/) Homepage: http://egonw.github.com/ LinkedIn: http://se.linkedin.com/in/egonw Blog: http://chem-bla-ics.blogspot.com/ PubList: http://www.citeulike.org/user/egonw/tag/papers ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

