Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to backhatch for this structure #69

Closed
tomyan112 opened this issue May 19, 2020 · 7 comments
Closed

Unable to backhatch for this structure #69

tomyan112 opened this issue May 19, 2020 · 7 comments
Labels
Bug Something isn't working Fixed Fixed, but may not be released yet

Comments

@tomyan112
Copy link

Describe the bug
A clear and concise description [in English] of what the bug is.
image
After select backhatch, it just turns into straight line
image

@MikeWilliams-UK
Copy link
Contributor

@tomyan112 please can you paste the cml

@tomyan112
Copy link
Author

tomyan112 commented May 19, 2020

<cml:cml xmlns:conventions="http://www.xml-cml.org/convention/" xmlns:cml="http://www.xml-cml.org/schema" xmlns:cmlDict="http://www.xml-cml.org/dictionary/cml/" xmlns:nameDict="http://www.xml-cml.org/dictionary/cml/name/" xmlns:c4w="http://www.chem4word.com/cml" conventions="convention:molecular">
  <cml:molecule id="m1">
    <cml:atomArray>
      <cml:atom id="a1" elementType="C" x2="478.3495" y2="400" />
      <cml:atom id="a2" elementType="C" x2="500.0001" y2="387.5" />
      <cml:atom id="a3" elementType="C" x2="456.6988" y2="387.5" />
      <cml:atom id="a4" elementType="C" x2="521.6507" y2="400" />
      <cml:atom id="a5" elementType="C" x2="500.0001" y2="362.5" />
      <cml:atom id="a6" elementType="H" x2="500.0001" y2="412.5" />
      <cml:atom id="a7" elementType="C" x2="456.6988" y2="362.5" />
      <cml:atom id="a8" elementType="C" x2="543.3013" y2="387.5" />
      <cml:atom id="a9" elementType="O" x2="521.6507" y2="425" />
      <cml:atom id="a10" elementType="C" x2="521.6507" y2="350" />
      <cml:atom id="a11" elementType="C" x2="478.3495" y2="350" />
      <cml:atom id="a12" elementType="H" x2="500.0001" y2="337.5" />
      <cml:atom id="a13" elementType="C" x2="543.3013" y2="362.5" />
      <cml:atom id="a14" elementType="O" x2="521.6507" y2="325" />
      <cml:atom id="a15" elementType="C" x2="478.3495" y2="375" c4w:explicit="false" />
    </cml:atomArray>
    <cml:bondArray>
      <cml:bond id="b1" atomRefs2="a2 a1" order="S" />
      <cml:bond id="b2" atomRefs2="a1 a3" order="S" />
      <cml:bond id="b3" atomRefs2="a4 a2" order="S" />
      <cml:bond id="b4" atomRefs2="a2 a5" order="S" />
      <cml:bond id="b5" atomRefs2="a2 a6" order="S">
        <cml:bondStereo atomRefs2="a2 a6">W</cml:bondStereo>
      </cml:bond>
      <cml:bond id="b6" atomRefs2="a3 a7" order="D" />
      <cml:bond id="b7" atomRefs2="a8 a4" order="S" />
      <cml:bond id="b8" atomRefs2="a4 a9" order="D" />
      <cml:bond id="b9" atomRefs2="a5 a10" order="S" />
      <cml:bond id="b10" atomRefs2="a11 a5" order="S" />
      <cml:bond id="b11" atomRefs2="a5 a12" order="S">
        <cml:bondStereo atomRefs2="a5 a12">W</cml:bondStereo>
      </cml:bond>
      <cml:bond id="b12" atomRefs2="a7 a11" order="S" />
      <cml:bond id="b13" atomRefs2="a13 a8" order="D" />
      <cml:bond id="b14" atomRefs2="a10 a13" order="S" />
      <cml:bond id="b15" atomRefs2="a10 a14" order="D" />
      <cml:bond id="b16" atomRefs2="a1 a15" order="S">
        <cml:bondStereo atomRefs2="a1 a15">W</cml:bondStereo>
      </cml:bond>
      <cml:bond id="b17" atomRefs2="a11 a15" order="S">
        <cml:bondStereo atomRefs2="a11 a15">W</cml:bondStereo>
      </cml:bond>
    </cml:bondArray>
  </cml:molecule>
</cml:cml>

Edited to mark as xml and remove irrelevant labels

@MikeWilliams-UK MikeWilliams-UK added the Bug Something isn't working label May 19, 2020
@MikeWilliams-UK
Copy link
Contributor

@deadlyvices I think I have figured this one out.

Points to note

  • Atom a15 has explicit = false == Don't display Carbon label.
  • Bonds b16 and b17 both have bondStereo = W == Wedge, but are not showing as such.

If I edit the structure to move atom a15 such that bonds b16 and b17 are no longer in a straight line the wedges are rendered.

To prevent this we need to only apply chamfer when the angle is approx 120° (as in the paper "Rendering Molecular Sketches for Publication Quality
Output")

When the endpoint of an inclined wedge is an unlabelled carbon atom with one substituent with an interior angle of approximately 120°

@deadlyvices
Copy link
Contributor

deadlyvices commented May 20, 2020

Well done on tracking that one down. I suggest we both try to fix it together. It would affect both in-document and real-time rendering.
So what angle range corresponds to 'approximately 120'? 110 -130?

@MikeWilliams-UK
Copy link
Contributor

@deadlyvices I agree that +- 10 is a good range to use.

@MikeWilliams-UK MikeWilliams-UK added the Fixed Fixed, but may not be released yet label May 20, 2020
@MikeWilliams-UK
Copy link
Contributor

@tomyan112 this is how the above structure now renders in word and in ACME

image

As you can see the "hidden" wedges for bonds b16 and b17 are now showing correctly.

@MikeWilliams-UK
Copy link
Contributor

Related to #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Fixed Fixed, but may not be released yet
Development

No branches or pull requests

3 participants