From: Bob Hanson <hansonr@st...>  20070909 14:02:06

Jmol 11.3.17 will be released soon. It includes a couple of bug fixes and several new Jmol math capabilities. # bug fix: problem with unescaping commaseparated point strings "{1,2,3}" as a point. # bug fix: drawn arrows scale improperly when zooming; arrow heads offkilter DRAW ARROW  # new feature: set defaultDrawArrowScale # 0.5 initially # Drawn arrows now have a head size that can be set and a dimension that # scales with the model, so arrow head:atom size ratio remains constant COLOR  Two of the color schemes introduced in 11.3.16 have been renamed since Angel pointed out that RasMol uses both shapely and amino. # rename byResidue_jmol > byResidue_shapely # rename byResidue_rasmol > byResidue_amino # CUSTOM DEFAULT COLORS  # new feature: setting Jmol,Rasmol,Shapely,Amino,Roygb,Rwb # color schemes makes those colors the default colors for these schemes. So if you do color "jmol=[xff0000] [xffff00] [x00ff00] [x00ffff] [x0000ff]" then when you use color atoms jmol you get your colors. New Command: PRINT  # new feature: print command prints a variable expression # # print x # print x * 3 # print x[4] + x[3] # print x.split(" ")[2][0] The print command prints to the console, the message queue, and the return value of the jmolScriptWait() JavaScript command. Basically you can do math and see the result. Should be helpful in debugging, but with the added business below, one can do something like this: x = plane({atomno=1} {atomno=2} {atomno=3}) print {atomno=4}.distance(x) Jmol Math  Variables as Arrays  Lots new here. All simple little changes, but the combined effect is significant. # new feature: array variables saved as arrays # prior to 11.3.17, you could not do: # # x = "this is a test".split(" ") # y = x[3] # # because x was only saved as a string, not an array # now x is saved as an array, so this is no problem. # Jmol Math  point() Function  This could be considered a bug fix in that you might think that r=10;g=100;b=10; x = {r,g,b} would work. And now it does. # new feature Jmol math point(x,y,z) function # # point(a,b,c) or point("{x,y,z}") # pts = "{2,3,4}{4,5,6}".split("") pt1 = point(pts[1]) d = point(pts[1]).distance(point(pts[2])) Jmol Math  Array Element Assignments  You can now do this sort of thing in Jmol math: a = "2,3,4,5".split(",") a[3] = "now the 4 becomes this phrase" a[a[2]] = "not any more; now it's this" a[0] = "setting the final element" a[6] = "expanding the array" a[1] = "setting the nexttolast element" print a >> 2 >> 3 >> not any more; now it's this >> setting the final element >> setting the nexttolast element >> expanding the array This works with strings as well: a = "this is a test" a[8] = " not" print a >> a = "this is not a test" Jmol Math  plane() Function  Define a plane and make measurements from it. If you give four points, you can designate which side you want to be the "above" the plane  where distances measured are positive, and which side will be "below" the plane  where distances measured are negative. # new feature Jmol math plane(x,y,z,w) function # # plane(a,b,c,d) or plane("{x,y,z,w}") # or through three points: # plane({atomExprOrPoint},{atomExprOrPoint},{atomExprOrPoint}) # or through three points with a reference point # plane({atomExprOrPoint},{atomExprOrPoint},{atomExprOrPoint},{atomExprOrPoint}) # # x = plane(y[3], y[6], y[2], 3.0) # x = plane("{2,3,5,4}") # x = plane({_H}[1],{_H}[2],{_H}[3],{_C}[1]) # print {_C}[1].distance(x) Jmol Math  aPlane.distance({some atoms}) Function  Mostly just a convenience, this measures the distance from a plane to the center of a set of atoms  same as {some atoms}.xyz.distance(aPlane) The reverse: {some atoms}.distance(aPlane) measures instead the average distance of the atoms to the plane, which could be considerably different.  Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr 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 
From: Bob Hanson <hansonr@st...>  20070910 01:06:41

Jmol Developers, I made a mistake in 11.3.17 having to do with saving the state after using arrays. Not a terribly big deal, but it could cause problems in certain cases. Please wait for 11.3.18 to try the array business in the context of "save state". Bob Bob Hanson wrote: > Jmol 11.3.17 will be released soon. It includes a couple of bug fixes > and several new Jmol math capabilities. > > # bug fix: problem with unescaping commaseparated point strings > "{1,2,3}" as a point. > # bug fix: drawn arrows scale improperly when zooming; arrow heads > offkilter > > DRAW ARROW >  > # new feature: set defaultDrawArrowScale # 0.5 initially > # Drawn arrows now have a head size that can be set and a dimension that > # scales with the model, so arrow head:atom size ratio remains constant > > > COLOR >  > Two of the color schemes introduced in 11.3.16 have been renamed since > Angel pointed out that RasMol uses both shapely and amino. > > # rename byResidue_jmol > byResidue_shapely > # rename byResidue_rasmol > byResidue_amino > # > > CUSTOM DEFAULT COLORS >  > # new feature: setting Jmol,Rasmol,Shapely,Amino,Roygb,Rwb > # color schemes makes those colors the default colors for these schemes. > > So if you do > > color "jmol=[xff0000] [xffff00] [x00ff00] [x00ffff] [x0000ff]" > > then when you use > > color atoms jmol > > you get your colors. > > New Command: PRINT >  > > # new feature: print command prints a variable expression > # > # print x > # print x * 3 > # print x[4] + x[3] > # print x.split(" ")[2][0] > > The print command prints to the console, the message queue, and the > return value of the jmolScriptWait() JavaScript command. Basically you > can do math and see the result. Should be helpful in debugging, but > with the added business below, one can do something like this: > > x = plane({atomno=1} {atomno=2} {atomno=3}) > print {atomno=4}.distance(x) > > > > Jmol Math  Variables as Arrays >  > > Lots new here. All simple little changes, but the combined effect is > significant. > > # new feature: array variables saved as arrays > # prior to 11.3.17, you could not do: > # > # x = "this is a test".split(" ") > # y = x[3] > # > # because x was only saved as a string, not an array > # now x is saved as an array, so this is no problem. > # > > Jmol Math  point() Function >  > This could be considered a bug fix in that you might think that > > r=10;g=100;b=10; > x = {r,g,b} > > would work. And now it does. > > # new feature Jmol math point(x,y,z) function > # > # point(a,b,c) or point("{x,y,z}") > # > > pts = "{2,3,4}{4,5,6}".split("") > pt1 = point(pts[1]) > d = point(pts[1]).distance(point(pts[2])) > > > Jmol Math  Array Element Assignments >  > You can now do this sort of thing in Jmol math: > > a = "2,3,4,5".split(",") > > a[3] = "now the 4 becomes this phrase" > a[a[2]] = "not any more; now it's this" > a[0] = "setting the final element" > a[6] = "expanding the array" > a[1] = "setting the nexttolast element" > print a > > >> 2 > >> 3 > >> not any more; now it's this > >> setting the final element > >> setting the nexttolast element > >> expanding the array > > This works with strings as well: > > a = "this is a test" > a[8] = " not" print a > > >> a = "this is not a test" > > > Jmol Math  plane() Function >  > > Define a plane and make measurements from it. If you give four points, > you can designate which side you want to be the "above" the plane  > where distances measured are positive, and which side will be "below" > the plane  where distances measured are negative. > > # new feature Jmol math plane(x,y,z,w) function > # > # plane(a,b,c,d) or plane("{x,y,z,w}") > # or through three points: > # plane({atomExprOrPoint},{atomExprOrPoint},{atomExprOrPoint}) > # or through three points with a reference point > # > plane({atomExprOrPoint},{atomExprOrPoint},{atomExprOrPoint},{atomExprOrPoint}) > > # > # x = plane(y[3], y[6], y[2], 3.0) > # x = plane("{2,3,5,4}") > # x = plane({_H}[1],{_H}[2],{_H}[3],{_C}[1]) > # print {_C}[1].distance(x) > > Jmol Math  aPlane.distance({some atoms}) Function >  > > Mostly just a convenience, this measures the distance from a plane to > the center of a set of atoms  same as > > {some atoms}.xyz.distance(aPlane) > > The reverse: > > {some atoms}.distance(aPlane) > > measures instead the average distance of the atoms to the plane, which > could be considerably different. > > >  Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr 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 