# [Chimera-users] [EXTERNAL] Elliptical cylinders

Tom Goddard goddard at sonic.net
Thu Nov 14 18:19:45 PST 2019

```Hi John,

If you don't mind hacking Chimera slightly you can make a cylinder with ellipse cross-section.  The idea is that the "sop transform" command can scale a surface, but only by the same factor along all axes.  But changing one line of code in this file (this is the location on Mac, but you can find it on Linux or Windows)

Chimera.app/Contents/Resources/share/Surface/transform.py

from

stf = ((scale,0,0,0),(0,scale,0,0),(0,0,scale,0))

to

stf = ((scale,0,0,0),(0,1,0,0),(0,0,1,0))

makes that command just scale along the screen x axis.  So then when I make a cylinder with Chimera command

shape cylinder radius 10 height 3 caps true

I can stretch it along the x-axis with command

sop transform #0 scale 2

You can use the "reset" command to get the cylinder aligned with its x-axis parallel to the screen x-axis before stretching.

Tom

> On Nov 14, 2019, at 2:43 PM, John Hackett <John.Hackett at vcuhealth.org> wrote:
>
> Elaine, Thank you very much for your help. , (B) is very clever, although I would need to read about per-model clipping to ensure that I am producing volumes of the correct dimensions. (A) works as well. I was able to generate the volumes in matlab, convert to vrml, then read them into Chimera. I didn't know the latter was possible. Unfortunately, I lose my cylinder caps. Need to figure out why that is.
>
> Best, -jch
>
>> On Nov 14, 2019, at 1:32 PM, Elaine Meng <meng at cgl.ucsf.edu <mailto:meng at cgl.ucsf.edu>> wrote:
>>
>> Hi John,
>> Sorry, there is no option to create elliptical cylinders per se.  However, there may be a devious approach to getting what you want, detailed below.
>>
>> There are several ways to make standard (circular cross-section) cylinders and  at least a couple ways to make 3D ellipsoids, as listed here with links:
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/print.html#objects <https://urldefense.com/v3/__http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/print.html*objects__;Iw!632Gf1zpPew!1QNjjblTvlQGsuhx-UuwdTuCwUc4YZMYIzSW4VjWL0yTTb5wtFAW4ZB2eW9OOQDaCg\$>>
>>
>> For example, the “shape” command can make either of those.
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html <https://urldefense.com/v3/__http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html__;!632Gf1zpPew!1QNjjblTvlQGsuhx-UuwdTuCwUc4YZMYIzSW4VjWL0yTTb5wtFAW4ZB2eW_uRpxoqg\$>>
>>
>> The ideas I had are:
>> (A) find some other program to create the shape as a VRML file, then open it in Chimera
>> (B) try to fudge it by creating a 3D ellipsoid in Chimera and then using Per-Model Clipping to show only a slab slice of that ellipsoid
>>
>> I tried “B” and it actually looked better than I thought it would.  However, it may take some messing around to get the look and size that you want, and then to position it appropriately relative to your membrane protein structure.
>>
>> Here’s what I did to generate what is shown in the attached image.  Hard to tell from the image but it is indeed elliptical in cross-section.
>>
>> (1) command: shape ellipsoid radius 5,10,50 color light blue
>> (2) after rotating it around to admire it, reset to initial position, command: reset
>> (3) start Per-Model Clipping, menu: Tools… Depiction… Per-Model Clipping
>> (4) in that dialog, check that the Model is set to the ellipsoid, check “Enable clipping” and “Use slab mode” (changed thickness to 5), clicked “Orient plane” perpendicular to line of sight
>> (5) then rotate with mouse to admire the clipped shape
>>
>> Of course you would use different dimensions and color as desired, and then open your molecule and use the Active checkboxes to freeze one or the other to position them relative to one another.
>>
>> Best,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry
>> University of California, San Francisco
>>
>>> On Nov 14, 2019, at 7:29 AM, John Hackett <John.Hackett at vcuhealth.org <mailto:John.Hackett at vcuhealth.org>> wrote:
>>>
>>> Good morning, is to possible to draw capped elliptical cylinders in Chimera? I would like to render elliptical cylinder representations of nanodiscs together with a membrane protein to visualize results from small-angle scattering experiments. Thanks, -jch
>> <disc.png>
>>
>
> ________________________________
> John C Hackett, PhD, RPh
> Associate Professor, Physiology & Biophysics
> VCU School of Medicine
> Goodwin Research Laboratory Rm. 165
> Massey Cancer Center
> 401 College St.
> Richmond, Virginia 23298-0035
> Telephone: +1.804.828.5679
> ________________________________
>
>
>
>
>
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20191114/7a9b79f7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ellipse.png
Type: image/png
Size: 16077 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20191114/7a9b79f7/attachment-0001.png>
```

More information about the Chimera-users mailing list