[Chimera-users] Resolution of .stl file of ribbon representatiom

Tom Goddard goddard at sonic.net
Fri Apr 4 11:22:39 PDT 2014


Hi Gavin,

  Yes zoom level can make a huge difference in STL file size with atoms shown as spheres.  If you are zoomed in so an atom sphere is big on the screen it will be drawn using about 1000 triangles.  If you are zoomed out so each atom is only a few pixels on the screen, it is drawn with only 8 triangles, more than 100 times fewer triangles and the STL file size will be more than 100 times smaller.  This level-of-detail with zooming is to give you the best graphics performance.  When you export the model as STL what fineness should Chimera use?  It has no way of knowing what your requirements are, so it simply uses what it is using on your display.  One solution is to have the Chimera Export dialog show an option “Output resolution in Angstroms” with some default value filled in based on your current zoom level or maybe 1/1000 times the maximum x,y,z extent of your models.  We don’t have that option now.

	Tom


On Apr 4, 2014, at 2:31 AM, Gavin Whittaker wrote:

> 
> Darrell, Tom, 
> 
>    VERY many thanks for the advice, information and really useful handles on how to minimise the file size.  I think I'm most surprised by the effect of zooming, although it does explain why I found .stl files from the same protein, taken at different times, were slightly different in size (75Mb v. 82Mb, for example) for no obvious reason; clearly the slight difference in zooming was enough to effect this difference.  It's (almost!) obvious in hindsight...
> 
>     One thing the zooming certainly improves on, relative to lowering the resolution post-Chimera, is the rendering of spheres.   My ribbon model included some metal atoms, and lowering resolution outside Chimera meant that they ended up looking like icosahedra and needing repair in CAD software... 
> 
>    Anyway, thanks again - you've been incredibly helpful!
> 
>       Best wishes, 
> 
>           Gavin
> 
> 
> On 03/04/2014 21:06, Hurt, Darrell (NIH/NIAID) [E] wrote:
>> The differences in file size in my testing associated with ribbon scaling are likely just because of my imprecise zooming back and forth. But there certainly are file size reductions to be realized by zooming out and by simplifying the cross section. I can totally use this!
>> 
>> Darrell Hurt, Ph.D.
>> Section Head, Computational Biology
>> Bioinformatics and Computational Biosciences Branch (BCBB)
>> OCICB/OSMO/OD/NIAID/NIH
>> 
>> 31 Center Drive, Room 3B62B, MSC 2135
>> Bethesda, MD 20892-2135
>> 
>> Office  301-402-0095
>> Mobile 301-758-3559
>> http://bioinformatics.niaid.nih.gov (Within NIH)
>> http://exon.niaid.nih.gov (Public)
>> 
>> Disclaimer: The information in this e-mail and any of its attachments is confidential and may contain sensitive information. It should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage devices. National Institute of Allergy and Infectious Diseases shall not accept liability for any statements made that are sender's own and not expressly made on behalf of the NIAID by one of its representatives.
>> 
>> ----- Original Message -----
>> From: Tom Goddard [mailto:goddard at sonic.net]
>> Sent: Thursday, April 03, 2014 02:32 PM
>> To: Hurt, Darrell (NIH/NIAID) [E]
>> Cc: Gavin Whittaker <g.whittaker at ed.ac.uk>; chimera-users at cgl.ucsf.edu BB <chimera-users at cgl.ucsf.edu>
>> Subject: Re: [Chimera-users] Resolution of .stl file of ribbon representatiom
>> 
>> Hi Darrell,
>> 
>>   Thanks for the test results!
>> 
>>   The scaling of the ribbon cross-section done by the Scaling tab of the Ribbon Style Editor (menu Tools / Depiction) should not change the size of the exported STL file at all.  It only moves the vertices of the triangles, but you still get the same number of triangles.
>> 
>>   The STL file uses 48 bytes for each triangle (x,y,z coords for 3 vertices, plus nx,ny,nz normal vector for triangle, giving 12 floating point values each taking 4 bytes).  That is rather inefficient.  Chimera uses only 24 bytes per triangle in memory, and for 3d printing you don't need the normal vectors and 18 bytes per triangle would be possible.  And if 16-bit precision on coordinates were adequate you could drop that to 9 bytes per triangle, about 5x smaller than STL files.  But without a standard file format that can handle that format it doesn't help.  Also the 3d printing software is probably not struggling with the size of the file, it is the large number of triangles that it has trouble with.  The Catalyst 4.3 uPrint 3d printer software we use is very bad, usually crashing, sometimes just extremely slow (hours to process), with large files (100 Mbytes).  I believe the job done by that software could be done 100 times more efficiently, but the 3d printer vendors pr!
>>  obably a
>> ren't doing it because common uses don't produce such large files.
>> 
>> 	Tom
>> 
>>   
>> On Apr 3, 2014, at 9:18 AM, "Hurt, Darrell (NIH/NIAID) [E]" <darrellh at niaid.nih.gov> wrote:
>> 
>>> Hi guys,
>>> 
>>> I think both of you have it. Gavin is right that simplifying the cross-section of the ribbon will reduce the triangle count. Tom is right that simply zooming out reduces the subdivisions along the ribbon (and therefore the triangle count). I'm using the "large_octagon" cross section preset and applying the "for3Dprint1round" scaling preset. Here's what I find:
>>> 
>>> Load up a PDB and hide any atoms that show up (so I'm considering only the ribbon)
>>> 
>>> File > Export without zooming: 4.2 MB X3D or 6.0 MB STL
>>> File > Export with zoom-out: 2.0 MB X3D or 2.3 MB STL
>>> File > Export without zooming but with scaling only: 4.7 MB X3D or 6.8 MB STL
>>> File > Export with zoom-out and scaling only: 1.6 MB X3D or 1.6 MB STL
>>> File > Export without zooming but with scaling and simple cross-section: 1.9 MB X3D or 2.7 MB STL
>>> File > Export with zoom-out and scaling and simple cross-section: 898 KB X3D or 928 KB STL
>>> 
>>> When I view the meshes, it is apparent that zooming out does indeed reduce the subdivision frequency along the ribbon length and simplifying the ribbon cross section reduces the subdivision around the ribbon. It can be at least an 85% savings in triangle count!
>>> 
>>> Great tip!
>>> 
>>> Thanks,
>>> Darrell
>>> 
>>> --
>>> Darrell Hurt, Ph.D.
>>> Section Head, Computational Biology
>>> Bioinformatics and Computational Biosciences Branch (BCBB)
>>> OCICB/OSMO/OD/NIAID/NIH
>>> 
>>> 31 Center Drive, Room 3B62B, MSC 2135
>>> Bethesda, MD 20892-2135
>>> Office: 301-402-0095
>>> Mobile: 301-758-3559
>>> Web: BCBB Home Page<http://www.niaid.nih.gov/about/organization/odoffices/omo/ocicb/Pages/bcbb.aspx#niaid_inlineNav_Anchor>
>>> Twitter: @niaidbioit<https://twitter.com/niaidbioit>
>>> 
>>> Disclaimer: The information in this e-mail and any of its attachments is confidential and may contain sensitive information. It should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage devices. National Institute of Allergy and Infectious Diseases shall not accept liability for any statements made that are sender's own and not expressly made on behalf of the NIAID by one of its representatives.
>>> 
>>> From: Tom Goddard <goddard at sonic.net<mailto:goddard at sonic.net>>
>>> Date: Thursday, April 3, 2014 11:31 AM
>>> To: Gavin Whittaker <g.whittaker at ed.ac.uk<mailto:g.whittaker at ed.ac.uk>>
>>> Cc: "chimera-users at cgl.ucsf.edu<mailto:chimera-users at cgl.ucsf.edu> BB" <chimera-users at cgl.ucsf.edu<mailto:chimera-users at cgl.ucsf.edu>>
>>> Subject: Re: [Chimera-users] Resolution of .stl file of ribbon representatiom
>>> 
>>> Hi Gavin,
>>> 
>>>  The “subdivision” setting under “graphics quality” in the Effects dialog (menu Tools / Viewing Controls / Effects) controls the fineness of the ribbon mesh.  Actually it only controls the subdivisions along the ribbon.  I believe the standard round (oval) cross-section always has 20 subdivisions around the circumference no matter what the subdivision setting is.  So you may still need to use an external program to reduce the fineness.
>>> 
>>>  The default subdivision is I believe 1.5, and a lower value like 0.5 or 0.1 should reduce the ribbon stl file substantially.
>>> 
>>>  Aha, there is more to it.  The level of subdivision is intended to maintain good quality appearance on your display.  So when you zoom in the ribbon gets finer, and when you zoom out it gets coarser.  I just did a ltest, and when I export a ribbon where I am zoomed out so the protein only is an inch wide on my display the STL file is 3 Mbytes, but when I zoom in so the protein is 10 inches wide, the exported file is 18 Mbytes!  So siimply zooming out before you export will control fineness.  Again I believe that it only controls fineness along the length, with subdivisions around the circumference fixed.  When you export using different zoom levels the coordinates of the ribbon will not be shifted since zooming is just moving the camera closer or further away while the protein stays in the same place.
>>> 
>>> Tom
>>> 
>>> 
>>> On Apr 3, 2014, at 2:48 AM, Gavin Whittaker  wrote:
>>> 
>>> Dear all,
>>> 
>>>   I'm in the process of 3d printing a large protein in ribbon format;  I've generated the .stl file, but the resolution of the mesh that Chimera creates means that the resulting file is too large to use easily.  I've managed to use other software to reduce the resolution of the mesh, so I can now get around the problem, but can anyone tell me if it's possible to reduce the resolution of the mesh in Chimera to save me a step for future models?
>>> 
>>>  I know how to reduce the resolution of a surface mesh, but files of ribbon representations remain obstinately large.  One method I've used that gives limited results is to simplify the cross-sectional form of the ribbon, but I wonder, am I missing something obvious and more effective?
>>> 
>>>   thanks!
>>> 
>>>      Gavin
>>> _______________________________________________
>>> Chimera-users mailing list
>>> Chimera-users at cgl.ucsf.edu<mailto:Chimera-users at cgl.ucsf.edu>
>>> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>>> 
>>> 
>>> _______________________________________________
>>> Chimera-users mailing list
>>> Chimera-users at cgl.ucsf.edu
>>> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>>> 
> 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20140404/ba070db0/attachment-0001.html>


More information about the Chimera-users mailing list