schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.15k stars 275 forks source link

Coordinates close to zero break `cgo.CONE` #220

Closed kmdalton closed 2 years ago

kmdalton commented 2 years ago

Very small nonzero coordinates cause cmd.load_cgo to fail to load a cone. The following minimal example demonstrates this behavior. Values of zero less than about 1e-7 reliably break rendering in the context of the script below. Whether this bug is triggered depends on the values of the other parameters. I have not systematically explored it.

from pymol import cmd,cgo

zero = 1e-8
obj = [
    cgo.CONE, 
    zero, 0.75, 0.0, 
    0., 1.0, 0.0, 
    0.1, 0.0, 
    1., 0., 0.,
    1., 0., 0.,
    1.0, 1.0
]

cmd.load_cgo(obj, 'broken_cone')

zero = 0.
obj = [
    cgo.CONE, 
    zero, 0.75, 0.0, 
    0., 1.0, 0.0, 
    0.1, 0.0, 
    1., 0., 0.,
    1., 0., 0.,
    1.0, 1.0
]

cmd.load_cgo(obj, 'working_cone')