Interesting. Try this:

function rotToHKL(h, k, l) {

# 1. find the normal to the plane and the axis perpendicular to it and the
the z axis

    Var norm = hkl(h,k,l)%4
    Var axis = cross({0 0 1}, norm)

# 2. find the rotation necessary to rotate the plane normal to the z axis

    Var rot = 180 + angle({0 0 1}, axis, {0 0 0} , norm)

# 3. undo the current rotation (reset, but keeping the zoom the same)

    Var q0 = !quaternion(script("show rotation"))
    rotate @q0

# 4. apply the rotation

    Var q1 = quaternion(axis, rot)
    rotate molecular quaternion @q1

# 5. show the plane, just to confirm

    isosurface hkl @{point(h,k,l)} translucent

# 6. center the structure?

    center

}


Bob

On Fri, Jul 16, 2010 at 8:21 AM, P.Canepa <[email protected]> wrote:

>  Dear all,
>
> is in Jmol anyway to orient one crystal along miller planes. Reading
> through  the Jmol interactive scripting documentation i can't figure out any
> way to do that
>
> Thanks, Piero
>
>
> --
> Please consider the environment before printing this e-mail.
>
> Pieremanuele Canepa
> Room 104
> Functional Material Group
> School of Physical Sciences, Ingram Building,
> University of Kent, Canterbury, Kent,
> CT2 7NH
> United Kingdom
>
> e-mail: [email protected]
> mobile: +44 (0) 7772-9756456
> -----------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> 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
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to