epam / epam/Indigo

Triggering rendering option "render-superatom-mode" to "collapse" causes crash

Open
#85 4 comments 0 reactions 1 assignee Claimed by @karnaukhovv View on GitHub
Indigo API
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

While attempting to render a molecule that contains superatoms to a PNG file, I am receiving a Segmentation fault: 11. This only occurs when the code `indigo.setOption("render-superatom-mode", "collapse")` is called. When the option is in the expanded mode, the PNG is written out just fine. Below is my code and attached is my mol file and the correctly expanded PNG of the molecule. I am using Python 2.7, Indigo version 1.3.0beta.r16-universal, and OSX 10.11.4.

```
from indigo import (indigo,
indigo_renderer)

IN_MOL = 'sgroups.mol'
OUT_PNG = 'sgroups.png'

indigo = indigo.Indigo()
renderer = indigo_renderer.IndigoRenderer(indigo)

mol = indigo.loadMoleculeFromFile(IN_MOL)
print "mol weight: " + str(mol.molecularWeight())

indigo.setOption("render-output-format","png")
indigo.setOption("render-superatom-mode", "collapse") #<-- causes crash
indigo.setOption("render-margins",50,50)
mol.layout()

renderer.renderToFile(mol, OUT_PNG)
```

Note: I found a similar issue posted a few years ago.
[Issue Link](https://groups.google.com/d/msg/indigo-general/eIfbSSAlFM4/uBhKgt2fY_MJ)

![sgroups](https://cloud.githubusercontent.com/assets/14244051/22849427/24ba31ce-efb2-11e6-93ac-73a2f30dd36a.png)

```

-INDIGO-02091713402D

20 22 0 0 0 0 0 0 0 0999 V2000
-6.9282 0.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.5426 0.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-4.1569 0.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.7713 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.3856 0.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.3220 0.9013 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.9659 2.4612 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.1388 3.5495 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3.6677 3.0779 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.0238 1.5180 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.8509 0.4297 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3.4354 -1.0597 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.6354 -2.4453 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0533 -2.6838 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.6973 -4.2437 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.8316 -4.7153 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.0045 -3.6270 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.6485 -2.0671 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.1196 -1.5955 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 1 0 0 0 0
3 4 1 0 0 0 0
4 5 1 0 0 0 0
5 6 2 0 0 0 0
6 7 1 0 0 0 0
7 8 2 0 0 0 0
8 9 1 0 0 0 0
9 10 2 0 0 0 0
10 11 1 0 0 0 0
11 12 2 0 0 0 0
12 7 1 0 0 0 0
12 13 1 0 0 0 0
13 14 1 0 0 0 0
14 15 1 0 0 0 0
15 16 2 0 0 0 0
16 17 1 0 0 0 0
17 18 2 0 0 0 0
18 19 1 0 0 0 0
19 20 2 0 0 0 0
20 6 1 0 0 0 0
20 15 1 0 0 0 0
M STY 2 1 SUP 2 SUP
M SLB 2 1 1 2 2
M SAL 1 2 2 1
M SBL 1 1 2
M SMT 1 MeN
M SAL 2 2 3 4
M SBL 2 2 2 4
M SMT 2 H4C2
M END
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.