biasmv / pv

WebGL protein viewer
https://pv.readthedocs.org
MIT License
315 stars 85 forks source link

Cartoon edges messed up the rendering in segments. #144

Closed javierbq closed 8 years ago

javierbq commented 8 years ago

Hi Marco,

I am trying to set the color of a protein segment to red by breaking the structure into 3 segments that are then added to the viewer. Everything seems to work fine expect when the structure is rendered in cartoon mode, the edges of the segment are all messed up.

Any suggestion on how I can fix this?

Thanks! Javier

Beta Strand

Before screen shot 2016-03-10 at 10 09 59 pm

After screen shot 2016-03-10 at 10 10 11 pm

Alpha Helix

Before screen shot 2016-03-10 at 10 29 59 pm

After screen shot 2016-03-10 at 10 30 40 pm

biasmv commented 8 years ago

Hi Javier,

that doesn't look great :(. There are other ways to achieve what you want. To recolor a part of a structure, you can also just specify subset of atoms you want to color to colorBy:

http://pv.readthedocs.org/en/v1.8.1/scene.html#pv.BaseGeom.colorBy http://pv.readthedocs.org/en/latest/sample-hover.html

If you want to use it for highlighting, you can also use setSelection():

http://pv.readthedocs.org/en/latest/scene.html#pv.BaseGeom.setSelection

Here is a sample of this in action:

http://pv.readthedocs.org/en/latest/sample-select.html

javierbq commented 8 years ago

Hi Marco,

Your solution works well for coloring. Is it posible to do something like this for style?

I am trying to change the style of only a section of the protein by rendering the protein as 3 different structures and I get the same problem with the cartoon visualization that I was having before.

image

Is there any good way of doing this?

biasmv commented 8 years ago

Ah, I see. That's something I haven't been optimizing and checking for too much. I'll have to take a look what can be done about that. It's certainly not going to be a quick fix, though.

biasmv commented 8 years ago

I've fixed part of the issue in one of the latest commits. At least the twist at the beginning is gone.

javierbq commented 8 years ago

Thanks Marco, it's looking much better!