Thanks  Bob, I'm pleased that my reading of the commands was far out. 

I tried switching to an updated based on the changes you suggested version c.f.

 var script = "load ./inorganicmodels/" + model + "; select *; connect 2.7 (oxygen) ; connect 3.0 (fluorine) ; connect 2.9 (bromine); connect 3.0 (iodine); connect 3.3 (sulfur or selenium) ; connect 2.9 (sodium) (chlorine); connect 3.8 (caesium) (chlorine); polyhedra bonds; select *; polyhedra frontedges;  select silicon; colour blue; select *;connect; wireframe on; select *";

But I think my 10.0.48 doesn't like it and you link to you code version is broken I think. In fact the link on the JMOL home site to your work 


In my current version of  commands before reading your message I adopted the Delete commands to remove unwanted overlapping polyhedra.

var script = "load ./inorganicmodels/" + model + "; select *; connect DELETE; select *; connect 1.0 2.7 (oxygen); connect 1.0 3.3 (sulphur); connect 1.0 2.8 (nitrogen);  connect 1.0 3.3 (hydrogen);  connect 1.0 3.3 (selenium);  connect 1.0 3.3 (carbon); connect 1.0 3.3 (arsenic);  connect 1.0 3.0 (fluorine); select sodium; connect 1.0 2.9 (chlorine); select caesium; connect 1.0 3.8 (chlorine);  connect 1.0 2.9 (bromine); connect 1.0 3.6 (iodine); select *; polyhedra bonds;  polyhedra frontedges;  select sodium; polyhedra DELETE; select calcium; polyhedra DELETE;  select silicon; colour blue; select *;connect; wireframe on; select *";

I like the select box idea but don't know how to implement it with the load command, is there an example somewhere.

I also really like the idea of the polyhedra bonds number specification, so that would be really useful for a case by case code but the code I want is generic for a large number of structures which would include 4 and 6 structures.

Having 8 for a polyhedra as an option would be nice too. The classic CsCl structure. Though in my example code, I cannot even Cs Cl get to have a wireframe structure even though I've set "select caesium; connect 1.0 3.8 (chlorine);"

In my examples I don't know why, LiCl and KCl are not displaying at least a wireframe whereas AgCl is.

Overall, I'm really pleased the way the polyhedra works and look forward to progress here.

The collection if you are wondering is for the latest Shriver and Atkins "Inorganic Chemistry" v4 website. This has 1700 JMOL structures to illustrate the book, available online really soon.

Regards, Karl




Karl, this is great! Congratulations. I'm delighted the connect command 

is working so well for you.

Suggestion to compact it a bit:


1)  you don't need "1.0" unless you really think there are connections 

shorter than that that you DON'T want to bond.


2) You no longer need to select, but if you use it, you don't have to 

specify it over and over. The following should work:


select *;

connect 2.7 (oxygen) ;

connect 3.0 (fluorine) ;

connect 2.9 (bromine);

connect 3.0 (iodine);

connect 3.3 (sulfur or selenium) ;

connect 2.9 (sodium) (chlorine);

connect 3.8 (caesium) (chlorine);


(if that wasn't in 10.00.48, it's in 

http://www.stolaf.edu/people/hansonr/jmol/test/json)


3) putting those radio buttons in a select box would be friendier!  :)


4) for polyhedra, I'd select one or the other of the elements such as Na 

or Cl, but not both. That way they won't overlap. One possibility would 

be to select all the anions prior to the polyhedrons command:


select chlorine or fluorine or .....

polyhedra bonds


5) for fun, I just modified the polyhedra command so that it allows you 

to specify the number of bonds to allow. so if you say


polyhedra bonds 6


then ONLY octahedra will show. Does that sound useful?


Something else that might be useful: since connect can dynamically 

change the bonding, you can now connect some atoms, create polyhedra, 

unconnect them, connect others, make new polyhedra, etc.


If you find that aspects of the polyhedra command need improvement, 

please do ask. I'm VERY interested in this.



    Bob Hanson


Reply via email to