﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
1486	Ribbon slowing graphics enormously for large models	Tristan Croll	Greg Couch	"There is a bug in the ribbon code of `structure.py` causing the number of tethers to blow out geometrically with the number of chains. Using 5wsg as an example, it slows down the ""Spotlight mode"" (which changes atom visibility, but doesn't directly change the ribbon drawing) in Clipper to around 0.5 fps under normal lighting (and framerate is under 30fps even doing nothing to the model in a freshly-opened session). If `m` is the `AtomicStructure`:

{{{
sum([len(t[3]) for t in m._ribbon_tether if t[3] is not None])
Out: 2437552
}}}

If I edit `_create_ribbon_graphics()` in `structure.py`:

{{{

            from numpy.linalg import norm
            from .molarray import Atoms
            tether_atoms = Atoms(list(self._ribbon_spline_backbone.keys()))
            spline_coords = array(list(self._ribbon_spline_backbone.values()))
>            mask = tether_atoms.indices(atoms)
>            tether_atoms = tether_atoms[mask]
>            spline_coords = spline_coords[mask]
            if len(spline_coords) == 0:
                spline_coords = spline_coords.reshape((0,3))

}}}

... then performance returns to more expected levels (55 fps when standing still, ~12fps when scrolling around in Clipper spotlight mode vs. 30fps with ribbon turned off entirely). Ribbon tethers appear correct. Also:

{{{
sum([len(t[3]) for t in m._ribbon_tether if t[3] is not None])
Out: 1364
}}}"	defect	closed	critical	0.9	Graphics		fixed		Tom Goddard				all	ChimeraX
