On 10/4/2010 1:14 PM, Robert Hanson wrote:
yes, I think so. Just adjust the vector parameters to make it any size
you want.
The top of the jvxl file with the cone:
[...]
functionXY
curveAsStringXY
-2 -5.0 -5.0 -5.0 ANGSTROMS
</jvxlFileTitle>
<jvxlVolumeData origin="{-5.0 -5.0 -5.0}"> <<<< changing these changes
origin
<jvxlVolumeVector type="0" count="51" vector="{0.2 0.0
0.0}"></jvxlVolumeVector> <<<< changing these changes size
<jvxlVolumeVector type="1" count="51" vector="{0.0 0.2
0.0}"></jvxlVolumeVector> <<<< changing these changes size
<jvxlVolumeVector type="2" count="51" vector="{0.0 0.0
0.2}"></jvxlVolumeVector> <<<< changing these changes size
[....]
I can change the origin, or size or make it elliptic (if the vectors are
not the same), but I do not know how to change the opening angle.
Thanks for your help,
PM
On Mon, Oct 4, 2010 at 11:08 AM, Pshemak Maslak <p...@chem.psu.edu
<mailto:p...@chem.psu.edu>> wrote:
On 10/1/2010 11:04 PM, Robert Hanson wrote:
>
> I lied. OK, see the JVXL file at
>
> http://stolaf.edu/people/hansonr/chemapps/jmol/docs/misc/cone.jvxl
>
> for a the surface z = sqrt(x^2 + y^2). Because it is a JVXL
file, you
> can go in and change the axes, change the scaling, change the
origin,
> etc., and have any cone you want. Even elliptical cones.
Thank you very much for creating this nice cone. Can I change its
opening angle directly in the jvxl file?
>
> This was created at
>
>
http://chemapps.stolaf.edu/jmol/docs/examples-11/isosurface.htm?USSIGNEDAPPLET&topic=14
<http://chemapps.stolaf.edu/jmol/docs/examples-11/isosurface.htm?USSIGNEDAPPLET&topic=14>
>
<http://chemapps.stolaf.edu/jmol/docs/examples-11/isosurface.htm?USSIGNEDAPPLET&topic=14
<http://chemapps.stolaf.edu/jmol/docs/examples-11/isosurface.htm?USSIGNEDAPPLET&topic=14>>
>
> by entering
>
> Math.sqrt(x^2 + y^2) into the input box, clicking the link discussed
> there to "set the function" and then issuing the following on the
> command line:
>
> javascript "x0=-5;y0=-5;dx=.2;dy=.2";isosurface functionXY
> "curveAsStringXY" {-5 -5 -5} {-51 0.2 0 0} {51 0 0.2 0} {51 0 0
0.2};
>
> followed by
>
> write isosurface "cone.jvxl"
I tried that (under item 14, after zapping the preloaded model). I
entered "Math.sqrt(x^2 + y^2)" into the box and clicked the "click
here
to set the function" link (confirmed by the message window). After
entering the script (above) on the command line I am getting a very
complicated "egg-box" shape.
If I do not click on the "click here to set the function" link I get a
half of an ellipsoid (a "cone" with parabolic cross-sections) with the
above script..
I am sure I am doing something wrong.
All below is above my head (I speak no programming language :-(). And
that is my problem.
Thanks for your help,
PM
>
>
> That instructs Jmol to get the Z coordinate of the function from the
> JavaScript function curveAsStringXY, which reads:
>
> function curveAsStringXY(app, nX, nY) {
> var i1 = Math.abs(parseInt(""+nX));
> var i2 = Math.abs(0.0 + parseInt(""+nY));
> var s = ""
> for (var i = 0; i < i1; i++)
> for (var j = 0; j < i2; j++) {
> s+= curveXY("",i, j) + "\n";
> }
> return s;
>
> }
>
>
> x0 = 0
> y0 = 0
> dx = 1
> dy = 1
> x = 0
> y = 0
>
> function curveXY(app, ix, iy) {
> setXY(ix, iy)
> return eval(myfunction);
> }
>
> function setXY(ix, iy) {
> x = ix * dx + x0
> y = iy * dy + y0
> }
>
>
> function setFunction(f,isSilent){
> myfunction =
> (arguments.length<1?document.getElementById("fOfXY").value:f)
> var x=1
> var y=1
> var z=NaN
> try{eval("z="+myfunction)}catch(e){alert(e)}
> if(isNaN(z)){
> alert("Your function is invalid")
> myfunction = "(x*x+y*y)"
> }
> try{curveXY("",1,1)}catch(e){alert(e);return}
> if (!isSilent)alert("The function Jmol will use is now z=" +
> myfunction)
> }
>
> myfunction = "(x*x + y*y)/3"
> setFunction(myfunction,1)
>
>
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking
non-virtualized
environment for deploying applications. Does it make network security
easier or more difficult to achieve? Read this whitepaper to
separate the
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
<mailto:Jmol-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/jmol-users
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security
easier or more difficult to achieve? Read this whitepaper to separate the
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users