[Chimera-users] STL Resolution Issues

Tom Goddard goddard at sonic.net
Thu Jun 19 10:37:13 PDT 2014

Hi Eric,

  I see what you mean.  I tried exporting 100,000 atoms as spheres (PDB 1jj2) and the STL file was larger than 100 Gbytes, or more than 1 Mbyte per sphere!  Ouch.  Each triangle takes 48 bytes in an STL file so that comes to 20,000 triangles per sphere.  Looking at the Chimera code I see that the trouble is that the Export Scene function does not use the subdivision shown on the screen for spheres.  Instead it exports to X3D format an exact description of a sphere (center and radius).  Then the x3d2stl conversion program is run by Chimera and it uses a fixed subdivision of each sphere which has an absurdly high resolution of ~11,000 vertices or 22,000 triangles per sphere for a 1.5 Angstrom radius sphere (also the subdivision is proportional to sphere radius squared, so it will give huge numbers of triangles if you make a sphere of radius 10, although it is capped at ~128,000 triangles per sphere).  Unfortunately Chimera does not have a way to say to use lower resolution for spheres when exporting the scene.  But there is a way to do it because the x3d2stl program that comes with Chimera has a resolution option.  So the trick will be to use Export Scene to write an x3d format file.  Then run x3d2stl by hand from a terminal “x3d2stl -r 0.1 -o file.stl < file.x3d”.  The default resolution is 100 and the number of sphere triangles scales linearly with the resolution value.  The minimum number of sphere triangles is 12.  I tried this for 1jj2, the x3d file sizes was just 15 Mbytes.

	/Applications/Chimera.app/Contents/Resources/bin/x3d2stl -o 1jj2.stl -r 0.01 < 1jj2.x3d

and the STL file came out to 59 Mbytes which agrees with 12 triangles per sphere taking about 500 bytes per sphere.  I’ve attached a close-up of what 12 triangle spheres looked like when I opened the 1jj2.stl file in Chimera.  The path to x3d2stl I used was on a Mac.  On Linux or Windows the program would be in chimera/bin.

  I’ll file a Chimera bug report to have the absurdly high subdivision fixed.


On Jun 18, 2014, at 6:09 PM, Eric Bell wrote:

> Hello,
> I am trying to change the resolution of the atoms for a large molecule packing, but no matter how I change the zoom or the subdivisions property in the viewing effects, it seems to always produce the same filesize (~900 MB, not something our software can handle).  Is this a bug or is it something that I'm doing incorrectly?  I'm running on a mac, and I have tested this both with a .mol2 and .pdb file.
> Thanks,
> Eric
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> 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/20140619/2b5aad10/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1jj2stl.jpg
Type: image/jpg
Size: 74634 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20140619/2b5aad10/attachment-0001.jpg>

More information about the Chimera-users mailing list