inconsistency in assigning coordinates to graphical objects

User 870ab5b546

02-12-2014 03:32:00

In MarvinJS, I draw a rectangle, starting at the NW corner and dragging SE. Then I draw a graphical arrow, starting at the SW corner and dragging due west. I get the following MRV (return characters added to improve readabiity).


<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray/>
<bondArray/>
</molecule>
</MChemicalStruct>
<MRectangle lineColor="#000000" id="o1">
<MPoint x="-0.625" y="-1.7916666666666667"/>
<MPoint x="6.75" y="-1.7916666666666667"/>
<MPoint x="6.75" y="2.333333333333333"/>
<MPoint x="-0.625" y="2.333333333333333"/>
</MRectangle>
<MPolyline headLength="0.6" headWidth="0.4" id="o2">
<MRectanglePoint rectRef="o1" pos="3"/>
<MPoint x="-5.95979797597289" y="-1.791666666666666"/>
</MPolyline>
</MDocument>
</cml>

I import the MRV into a Molecule (using JChem 14.11.10), get the MDocument, find the MObjects that are MPolylines but not MRectangles, and use MPolyline.getPoint().getLocation() to get their starting and ending coordinates. I get:


pointOnLine.jsp: arrow 1:
point 1: DPoint3(-0.625, 2.333333333333333, 0.0)
point 2: DPoint3(-5.95979797597289, -1.791666666666666, 0.0)

Given that I drew a horizontal arrow, the y-coordinates of the line's two points should be the same, but they're not. It seems that there is an inconsistency between the numbering of the four MRectangle positions within MarvinJS. What MarvinJS is calling position 3 is not actually the position from which the graphical arrow is originating.


Doing the same in MarvinSketch, I get this MRV:


<?xml version="1.0" encoding="UTF-8"?>
<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_14_11_17.xsd" version="ChemAxon file format v14.11.17, generated by v14.11.24.0">
<MDocument>
<MRectangle id="o2">
<MPoint x="0.7039999961853027" y="3.9600000381469727"/>
<MPoint x="7.3480000495910645" y="3.9600000381469727"/>
<MPoint x="7.3480000495910645" y="0.48399999737739563"/>
<MPoint x="0.7039999961853027" y="0.48399999737739563"/>
</MRectangle>
<MPolyline id="o3" headLength="0.6" headWidth="0.4">
<MRectanglePoint pos="3" rectRef="o2"/>
<MPoint x="-4.980350568427131" y="0.4839999973773956"/>
</MPolyline>
</MDocument>
</cml>

and these coordinates:

pointOnLine.jsp: arrow 1:
point 1: DPoint3(0.7039999961853027, 0.48399999737739563, 0.0)
point 2: DPoint3(-5.509977791940791, 0.4839999973773957, 0.0)

Note the identical y-coordinates. It is imperative that I be able to get correct coordinates from MarvinJS as well. Please fix! Note that this is not a feature request, but a bugfix request!


The problem described in this other topic is probably related to this one.

ChemAxon 7c2d26e5cf

12-12-2014 12:29:02

Thanks for reporting this issue.


We are investigating how to resolve this incosistency among Marvin JS and MarvinSketch.