Crystallography extension ready for review

Hi list,

I think most of you have given up reviewing the crystal builder
extension since I just kept pushing updates. Sorry about that – I
kept adding more features before old ones were accepted and didn’t
want to flood the review board with changes that depended on
unaccepted, volatile code.

I’ve now added all the features I can think of to the builder, and
I’ll stop constantly pushing updates, I promise :wink: The extension has
been renamed to just “Crystallography Extension” and the interface has
been redesigned for a more seamless experience. The editors are now
dockable (which is great for small screens that can’t handle multiple
windows easily), there is no main dialog window, and all features are
now directly available through the main Avogadro window.

I’ve written a blog post with some screenshots here:

The new feature list:

Coordinate / cell editing:

  • Customizable docking editors allow direct editing of:
    ** Cell parameters a, b, c, alpha, beta, and gamma
    ** The cell matrix, as either row or column vectors
    ** The atomic coordinates, in either cartesian or fractional units
  • Customizable unit display:
    ** All lengths (parameters, cell matrix, cartesian coordinates) can be
    displayed in Angstrom or Bohr
    ** All angles can be displayed in degree or radian
  • Immediate feedback on invalid entry: Text turns red when an invalid
    entry is made
  • Plain text entry – perfect for copy/pasting to/from input/output files.

Tools:

  • Add / Remove unit cell
  • Symmetry tools:
    ** Detect spacegroup
    ** Manually set spacegroup
    ** Symmetrize cell and coordinates to detected space group
    ** Fill unit cell using a few atoms and the current space group’s
    symmetry operations
  • Structure reductions:
    ** Reduce to primitive cell
    ** Reduce to Niggli cell
  • Option to preserve either cartesian or fractional coordinates when
    the cell is modified
  • Display fractionalization matrix
  • Import POSCAR style data from clipboard (more formats to come)
  • Copy POSCAR to clipboard (handled through regular Avogadro copy function)
  • On-screen display of crystallographic properties:
    ** Lattice type
    ** Space group
    ** Cell Volume
  • Translate (“wrap”) atoms to lie inside unit cell
  • Rotate to standard orientation (i.e. A along x, B in x,y plane)
  • Scale cell to a specified volume (isotropic scaling)

So check it out and try to break it if you have time, and your reviews
won’t get buried in patches this time :stuck_out_tongue:

Dave

I’ve now added all the features I can think of to the builder, and
I’ll stop constantly pushing updates, I promise :wink:

Ooh, ooo, I can think of a few features. :slight_smile:

  • Library of “standard” crystal structures? There are also a few open crystallography databases, which might be good for “Import” commands. But I know many people who might want a database of common metals and oxides to ship with Avogadro.
  • Generate a slab along a particular Miller plane.
  • Draw an arbitrary Miller plane in the view.

But this looks really great! Your blog post mentions the Windows compile – I think we simply need to find someone who can push nightly Windows (and Linux?) binaries of stable and unstable git branches like I do for Mac.

Thanks!
-Geoff

On Mon, Mar 21, 2011 at 4:48 PM, Geoffrey Hutchison
geoff.hutchison@gmail.com wrote:

I’ve now added all the features I can think of to the builder, and
I’ll stop constantly pushing updates, I promise :wink:

Ooh, ooo, I can think of a few features. :slight_smile:

  • Library of “standard” crystal structures? There are also a few open crystallography databases, which might be good for “Import” commands. But I know many people who might want a database of common metals and oxides to ship with Avogadro.

Hmm…like the fragment database. That would be useful. Do you know of
an existing database that can be queried like we do for proteins? Or
an open one that we could mine and ship with Avo?

  • Generate a slab along a particular Miller plane.
  • Draw an arbitrary Miller plane in the view.

Actually, one of my coworkers has already requested these, thanks for
reminding me! This would be very useful.

But this looks really great! Your blog post mentions the Windows compile – I think we simply need to find someone who can push nightly Windows (and Linux?) binaries of stable and unstable git branches like I do for Mac.

I actually have a windows VM that I meant to set up to do this…I
just lack motivation towards the goal and the knowledge necessary to
automate such a thing on Windows. If someone could send me
step-by-step instructions for automating the builds, I’ll gladly set
up the nightly Windows builds (because then I can do nightly XtalOpt
builds, too :wink: ).

As for linux, I’m unsure of what kind of package would be best to
produce. I really like Konstantin’s installers, perhaps something like
that?

Dave

On Mar 21, 2011, at 5:15 PM, David Lonie wrote:

Hmm…like the fragment database. … Or
an open one that we could mine and ship with Avo?

There are a few, and I found a few new ones when searching tonight:
http://nanocrystallography.research.pdx.edu/search.py/search?database=wcd
http://cod.ibt.lt/
http://rruff.geo.arizona.edu/AMS/amcsd.php

step-by-step instructions for automating the builds, I’ll gladly set
up the nightly Windows builds (because then I can do nightly XtalOpt
builds, too :wink:

At one point, Marcus set up such a thing. Tim also made a pile of Windows builds. Guys?

As for linux, I’m unsure of what kind of package would be best to
produce.

Yes, that’s exactly right. I’d prefer to see an automated build along the lines of Konstantin’s.

The beauty of the nightly builds is that they can also be distributed on USB sticks. :slight_smile:

Cheers,
-Geoff

Am 21.03.2011 19:04, schrieb David Lonie:

Hi list,

I think most of you have given up reviewing the crystal builder
extension since I just kept pushing updates. Sorry about that – I
kept adding more features before old ones were accepted and didn’t
want to flood the review board with changes that depended on
unaccepted, volatile code.

I’ve now added all the features I can think of to the builder, and
I’ll stop constantly pushing updates, I promise :wink:

My 2 cents as a chemistry/biology teacher:

I (and some of my collegues) are using Avogadro to
demonstrate/illustrate crystals such as NaCl. In most cases I open a
.cif file (taken from JMOL:
Index of /jmol/docs/examples-11/data ). Often I create
a 3x3x3 array at the beginning so that my students can see how the ions
are arranged in 3D. We have one of these interactive whiteboards [1] so
it is quite cool to rotate the cell by moving a stick/pen on the wall.
Makes fun.

Then I remove the third axis and make a 3x3x0 array so that it is easier
to understand the layers.

I haven’t tested your code but what I don’t like about the 1.0.1-version
of Avogadro is this: If I open a .mol-file I don’t have those grey
lines. I found no way to get rid of those lines. (see [2] or [3] if you
don’t know which lines I mean) I simply see no need for these lines, at
least not as the default setting.

I think it would be nice to have the unitcell dialog integrated in the
UI (no dialog) as it would mean less mouseclicks to change the crystal.

As soon as you have a windows-binary for me to test I will test your
code and report back.

Carsten

[1]
http://www.prometheanworld.com/german/upload/img_200/ActivBoard2_300-web.jpg
[2]


[3] http://avogadro.openmolecules.net/w/images/7/75/Avogadro-unitcell.png

On Mar 22, 2011, at 3:27 PM, Carsten Niehaus wrote:

I haven’t tested your code but what I don’t like about the 1.0.1-version
of Avogadro is this: If I open a .mol-file I don’t have those grey
lines.

Go to the View menu:

View > Display Unit Cell Axes

That’s it. We’ve left that as the default because many people do expect to see the unit cell when displaying crystals. But even v.1.0.1 allows you to turn them off.

Hope that helps,
-Geoff

Hi Carsten,

On Tue, Mar 22, 2011 at 3:27 PM, Carsten Niehaus cniehaus@gmx.de wrote:

I haven’t tested your code but what I don’t like about the 1.0.1-version of
Avogadro is this: If I open a .mol-file I don’t have those grey lines. I
found no way to get rid of those lines. (see [2] or [3] if you don’t know
which lines I mean) I simply see no need for these lines, at least not as
the default setting.

By grey lines, are you referring to the unit cell rendering, i.e. the
“box” delimiting the cell? That can be disabled via “View->Display
Unit Cell Axes”. Or would you like the ability to display a supercell
without each individual unit cell being drawn?

It seems to me that it would be more useful for the students to see
the individual unit cells to emphasize the periodicity of the system.
But if I remember the glwidget code well enough, it would be easy to
add an option to remove the individual cell lines. I will look into
this.

I think it would be nice to have the unitcell dialog integrated in the UI
(no dialog) as it would mean less mouseclicks to change the crystal.

I agree. I will be merging the super cell builder and unit cell
extensions into the crystallography extension soon.

As soon as you have a windows-binary for me to test I will test your code
and report back.

I will try to get one pushed out today.

Dave