Save ribbons and surfaces with minimal amount of vertices/faces

Hi ChimeraX team and others, I got a bit of an unusual question and am interested to see whether it is possible! I am trying to use a short helix in ribbon style from ChimeraX into Blender, and use it to create a 'skeleton' for animations. For this, it would be most useful to have as few vertices as possible for the helix (basically only the 'invisible' coordinates themselves as 'line', instead of having it as a 3D view/thick helix. When I export a helix even with a very thin ribbon style through the command line (e.g. width and thickness to 0.1), this is unfortunately still too thick and creates too many vertices/faces. Setting these values to 0 gives errors. I have looked at the ribbon style editor in Chimera as well, and unfortunately the minimum settings are 0.05. Would it be possible to somehow set any of these parameters to 0 and save this as a file format suitable for 3D softwares (e.g. .glb)? Would it work through a python script potentially? (I'm not familiar with python in chimera yet but happy to learn more about this). And if so, would this be also applicable for surfaces, to reduce the numbers of vertices/faces that are exported? On another note, I was wondering whether it would be possible to set the chimaera scene 'world origin' to a particular coordinate set; I think in Pymol this is possible with resetting the camera view: cmd.set_view([ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40.0, 100.0, -20.0]) Sorry for these unusual question but looking forward to hearing back from anyone who might have any suggestions! Cheers, Sarah

Hi Sarah, For the last part of your question, you can set the camera position with the "camera" option of the "view matrix" command, see: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#matrix> For example: view matrix camera 1,0,0,0,0,1,0,0,0,0,1,0 I'm not familiar with the Pymol command or why it has so many numbers in it, so the above may not do the same thing as your example. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 12, 2021, at 2:35 AM, Sarah Piper via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi ChimeraX team and others, I got a bit of an unusual question and am interested to see whether it is possible!
I am trying to use a short helix in ribbon style from ChimeraX into Blender, and use it to create a 'skeleton' for animations. For this, it would be most useful to have as few vertices as possible for the helix (basically only the 'invisible' coordinates themselves as 'line', instead of having it as a 3D view/thick helix. When I export a helix even with a very thin ribbon style through the command line (e.g. width and thickness to 0.1), this is unfortunately still too thick and creates too many vertices/faces. Setting these values to 0 gives errors.
I have looked at the ribbon style editor in Chimera as well, and unfortunately the minimum settings are 0.05. Would it be possible to somehow set any of these parameters to 0 and save this as a file format suitable for 3D softwares (e.g. .glb)? Would it work through a python script potentially? (I'm not familiar with python in chimera yet but happy to learn more about this). And if so, would this be also applicable for surfaces, to reduce the numbers of vertices/faces that are exported?
On another note, I was wondering whether it would be possible to set the chimaera scene 'world origin' to a particular coordinate set; I think in Pymol this is possible with resetting the camera view:
cmd.set_view([ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40.0, 100.0, -20.0])
Sorry for these unusual question but looking forward to hearing back from anyone who might have any suggestions! Cheers, Sarah

Hi Sarah, For the skeleton, couldn't you use the alpha-carbons instead of a ribbon? Or N, CA, C? E.g. ChimeraX commands: hide hide ribbons show @ca - OR - show @n,ca,c For reducing vertices in ChimeraX, see commands "graphics quality" and "graphics triangles": <https://rbvi.ucsf.edu/chimerax/docs/user/commands/graphics.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 12, 2021, at 9:03 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Sarah, For the last part of your question, you can set the camera position with the "camera" option of the "view matrix" command, see:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#matrix>
For example: view matrix camera 1,0,0,0,0,1,0,0,0,0,1,0
I'm not familiar with the Pymol command or why it has so many numbers in it, so the above may not do the same thing as your example.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 12, 2021, at 2:35 AM, Sarah Piper via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi ChimeraX team and others, I got a bit of an unusual question and am interested to see whether it is possible!
I am trying to use a short helix in ribbon style from ChimeraX into Blender, and use it to create a 'skeleton' for animations. For this, it would be most useful to have as few vertices as possible for the helix (basically only the 'invisible' coordinates themselves as 'line', instead of having it as a 3D view/thick helix. When I export a helix even with a very thin ribbon style through the command line (e.g. width and thickness to 0.1), this is unfortunately still too thick and creates too many vertices/faces. Setting these values to 0 gives errors.
I have looked at the ribbon style editor in Chimera as well, and unfortunately the minimum settings are 0.05. Would it be possible to somehow set any of these parameters to 0 and save this as a file format suitable for 3D softwares (e.g. .glb)? Would it work through a python script potentially? (I'm not familiar with python in chimera yet but happy to learn more about this). And if so, would this be also applicable for surfaces, to reduce the numbers of vertices/faces that are exported?
On another note, I was wondering whether it would be possible to set the chimaera scene 'world origin' to a particular coordinate set; I think in Pymol this is possible with resetting the camera view:
cmd.set_view([ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40.0, 100.0, -20.0])
Sorry for these unusual question but looking forward to hearing back from anyone who might have any suggestions! Cheers, Sarah

Thank Elaine, that's a very smart idea and very helpful indeed! Thanks so much for your help and your quick reply! Sarah ......................... Sarah Piper, PhD Postdoctoral Research Fellow Drug Discovery Biology Monash Institute of Pharmaceutical Sciences, Monash University 399 Royal Parade, Parkville, 3052 VIC, Australia Phone: +61 3 9903 9239 Email: sarah.piper@monash.edu LinkedIn: www.linkedin.com/in/sjpiper89/ On Tue, 14 Dec 2021 at 04:18, Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Sarah, For the skeleton, couldn't you use the alpha-carbons instead of a ribbon? Or N, CA, C?
E.g. ChimeraX commands:
hide hide ribbons show @ca - OR - show @n,ca,c
For reducing vertices in ChimeraX, see commands "graphics quality" and "graphics triangles": <https://rbvi.ucsf.edu/chimerax/docs/user/commands/graphics.html>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 12, 2021, at 9:03 AM, Elaine Meng via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hi Sarah, For the last part of your question, you can set the camera position with the "camera" option of the "view matrix" command, see:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#matrix>
For example: view matrix camera 1,0,0,0,0,1,0,0,0,0,1,0
I'm not familiar with the Pymol command or why it has so many numbers in it, so the above may not do the same thing as your example.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 12, 2021, at 2:35 AM, Sarah Piper via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hi ChimeraX team and others, I got a bit of an unusual question and am interested to see whether it is possible!
I am trying to use a short helix in ribbon style from ChimeraX into Blender, and use it to create a 'skeleton' for animations. For this, it would be most useful to have as few vertices as possible for the helix (basically only the 'invisible' coordinates themselves as 'line', instead of having it as a 3D view/thick helix. When I export a helix even with a very thin ribbon style through the command line (e.g. width and thickness to 0.1), this is unfortunately still too thick and creates too many vertices/faces. Setting these values to 0 gives errors.
I have looked at the ribbon style editor in Chimera as well, and unfortunately the minimum settings are 0.05. Would it be possible to somehow set any of these parameters to 0 and save this as a file format suitable for 3D softwares (e.g. .glb)? Would it work through a python script potentially? (I'm not familiar with python in chimera yet but happy to learn more about this). And if so, would this be also applicable for surfaces, to reduce the numbers of vertices/faces that are exported?
On another note, I was wondering whether it would be possible to set the chimaera scene 'world origin' to a particular coordinate set; I think in Pymol this is possible with resetting the camera view:
cmd.set_view([ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40.0, 100.0, -20.0])
Sorry for these unusual question but looking forward to hearing back from anyone who might have any suggestions! Cheers, Sarah

This tutorial on exporting GLTF from ChimeraX has a section talking about how to reduce the number of triangles https://www.rbvi.ucsf.edu/chimerax/data/texture-may2021/export_3d.html <https://www.rbvi.ucsf.edu/chimerax/data/texture-may2021/export_3d.html> The graphics quality command ribbonDivisions and ribbonSides are probably what you want. graphics quality ribbonDivisions 2 ribbonSides 4 Tom
On Dec 12, 2021, at 2:35 AM, Sarah Piper via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi ChimeraX team and others, I got a bit of an unusual question and am interested to see whether it is possible!
I am trying to use a short helix in ribbon style from ChimeraX into Blender, and use it to create a 'skeleton' for animations. For this, it would be most useful to have as few vertices as possible for the helix (basically only the 'invisible' coordinates themselves as 'line', instead of having it as a 3D view/thick helix. When I export a helix even with a very thin ribbon style through the command line (e.g. width and thickness to 0.1), this is unfortunately still too thick and creates too many vertices/faces. Setting these values to 0 gives errors.
I have looked at the ribbon style editor in Chimera as well, and unfortunately the minimum settings are 0.05. Would it be possible to somehow set any of these parameters to 0 and save this as a file format suitable for 3D softwares (e.g. .glb)? Would it work through a python script potentially? (I'm not familiar with python in chimera yet but happy to learn more about this). And if so, would this be also applicable for surfaces, to reduce the numbers of vertices/faces that are exported?
On another note, I was wondering whether it would be possible to set the chimaera scene 'world origin' to a particular coordinate set; I think in Pymol this is possible with resetting the camera view:
cmd.set_view([ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40.0, 100.0, -20.0])
Sorry for these unusual question but looking forward to hearing back from anyone who might have any suggestions!
Cheers,
Sarah
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Elaine Meng
-
Sarah Piper
-
Tom Goddard