From: <ha...@us...> - 2007-10-31 21:28:43
|
Revision: 8551 http://jmol.svn.sourceforge.net/jmol/?rev=8551&view=rev Author: hansonr Date: 2007-10-31 14:28:40 -0700 (Wed, 31 Oct 2007) Log Message: ----------- version=11.3.40_dev # POV-Ray clipping codeing minor tweak Modified Paths: -------------- trunk/Jmol/src/org/jmol/export/_PovrayExporter.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/export/_PovrayExporter.java =================================================================== --- trunk/Jmol/src/org/jmol/export/_PovrayExporter.java 2007-10-31 20:33:40 UTC (rev 8550) +++ trunk/Jmol/src/org/jmol/export/_PovrayExporter.java 2007-10-31 21:28:40 UTC (rev 8551) @@ -51,6 +51,7 @@ public class _PovrayExporter extends _Exporter { private int nBytes; + private boolean isSlabEnabled; public _PovrayExporter() { use2dBondOrderCalculation = true; @@ -72,11 +73,11 @@ public void getHeader() { nBytes = 0; + isSlabEnabled = viewer.getSlabEnabled(); float zoom = viewer.getRotationRadius() * 2; zoom *= 1.1f; // for some reason I need a little more margin zoom /= viewer.getZoomPercentFloat() / 100f; int minScreenDimension = Math.min(screenWidth, screenHeight); - output("// ******************************************************\n"); output("// Created by Jmol " + Viewer.getJmolVersion() + "\n"); output("//\n"); @@ -143,34 +144,32 @@ + " roughness .00001\n metallic\n phong 0.9\n phong_size 120\n}}" + "\n\n"); - output("#declare boundBox = " - + " box {<0,0," + slabZ + ">,<Width,Height," + depthZ + ">}\n" - + "#declare boundBoxslabZ = " + slabZ + ";\n" - + "#declare boundBoxdepthZ = " + depthZ + ";\n\n"); + output("#declare slabZ = " + slabZ + ";\n" + + "#declare depthZ = " + depthZ + ";\n\n"); output("#macro clip()\n" - + " clipped_by { box {<0,0," + slabZ + ">,<Width,Height," + depthZ + ">}}\n" + + " clipped_by { box {<0,0,slabZ>,<Width,Height,depthZ>} }\n" + "#end\n\n"); output("#macro circleCap(Z,RADIUS,R,G,B,T)\n" + "// cap for lower clip\n" - + " #local cutDiff = Z - boundBoxslabZ;\n" + + " #local cutDiff = Z - slabZ;\n" + " #local cutRadius2 = (RADIUS*RADIUS) - (cutDiff*cutDiff);\n" + " #if (cutRadius2 > 0)\n" + " #local cutRadius = sqrt(cutRadius2);\n" - + " cylinder{<X,Y,boundBoxslabZ>," - + "<X,Y,(boundBoxslabZ-(boundBoxslabZ/Z))>,cutRadius\n" + + " cylinder{<X,Y,slabZ>," + + "<X,Y,(slabZ-(slabZ/Z))>,cutRadius\n" + " pigment{rgbt<R,G,B,T>}\n" + " translucentFinish(T)\n" + " no_shadow}\n" + " #end\n" + "// cap for upper clip\n" - + " #declare cutDiff = Z - boundBoxdepthZ;\n" + + " #declare cutDiff = Z - depthZ;\n" + " #declare cutRadius2 = (RADIUS*RADIUS) - (cutDiff*cutDiff);\n" + " #if (cutRadius2 > 0)\n" + " #local cutRadius = sqrt(cutRadius2);\n" - + " cylinder{<X,Y,boundBoxdepthZ>," - + "<X,Y,(boundBoxdepthZ+(boundBoxdepthZ/Z))>,cutRadius\n" + + " cylinder{<X,Y,depthZ>," + + "<X,Y,(depthZ+(depthZ/Z))>,cutRadius\n" + " pigment{rgbt<R,G,B,T>}\n" + " translucentFinish(T)\n" + " no_shadow}\n" @@ -214,7 +213,7 @@ + " translucentFinish(T)\n" + " clip()\n" + " no_shadow}\n" - + " circleCap(Z,RADIUS,R,G,B,T)\n" + + (isSlabEnabled? " circleCap(Z,RADIUS,R,G,B,T)\n" : "") + "#end\n\n"); } @@ -238,7 +237,7 @@ + " translucentFinish(T)\n" + " clip()\n" + " no_shadow}\n" - + " circleCap(Z,RADIUS,R,G,B,T)\n" + + (isSlabEnabled? " circleCap(Z,RADIUS,R,G,B,T)\n" : "") + "#end\n\n"); } Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2007-10-31 20:33:40 UTC (rev 8550) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2007-10-31 21:28:40 UTC (rev 8551) @@ -1,5 +1,6 @@ version=11.3.40_dev +# POV-Ray clipping coding minor tweak # POV-Ray fix for number formatting width > 999 # new feature: model-based parallel array calculations: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |