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

Attachment: mol2svg.java
Description: Binary data

Attachment: test.mol
Description: Binary data

<<attachment: test.svg>>

------------------------------------------------------------------------------
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

Reply via email to