From: Андрей П. <cmr...@gm...> - 2012-05-01 19:58:24
|
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. Your help is greatly appreciated, Andrey Paramonov |