epam / Indigo

Universal cheminformatics toolkit, utilities and database search tools
http://lifescience.opensource.epam.com
Apache License 2.0
295 stars 100 forks source link

Windows x64 version doesn't depict structures with alias atoms #381

Open achher opened 3 years ago

achher commented 3 years ago

Windows x64 doesn't depict Alias atoms when the atom is defined as C instead of A in the atom block. The depicting operation gives an exception 'invalid floating point operation' for all output formats:

MolId:= indigoLoadMoleculeFromFile('AliasAtom.mol'); indigoSetOption('render-output-format','png'); indigoRenderToFile(MolId, 'AliasAtom.png');

-->exception invalid floating point operation

The win32 version of Indigo dlls does depict the alias atom:

grafik

Molfile example:

-INDIGO-03142119362D

5 5 0 0 0 0 0 0 0 0999 V2000 3.1077 -4.3468 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 4.3090 -4.3468 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0 3.1077 -5.5282 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 4.3090 -5.5282 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 5.1444 -3.5114 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 3 1 1 0 0 0 0 4 2 1 0 0 0 0 4 3 1 0 0 0 0 2 1 1 0 0 0 0 2 5 1 0 0 0 0 A 5 Alias M END

achher commented 2 years ago

The problem is caused by the statements parent = ILLEGAL_RECT(); in render_internal.cpp (3 occurences). When I command out the statement, then error disappears. Illegal_rect uses illegal_point which is nanf. the nanf causes the error 'exception invalid floating point operation' under winx64. Can you please look into this issue? Same issue is in #358: Windows x64 version doesn't depict structures with superatoms. Command out of ILLEGAL_RECT(); makes it work and alias atoms are depicted. But this only fixes the error and not the reason for this error.

even1024 commented 2 years ago

Could you please provide the example mol (AliasAtom.mol) as attachment?