Warren,

I have found a CGO-drawing problem for which I cannot find a solution.
I've been trying to perfect my script for drawing symmetry axes of
crystal structures. I noticed that the script wasn't drawing all of the
axes that it should have (i.e. not all of those that were listed by the
script). I did some investigating of the behaviour by writing the CGO
objects out to a file and then editing it down to just a few cylinder
objects.

The grand conclusion, is that if you create a CGO cylinder that goes
from 0,0,0 to x,-x,x (or parallel to that direction) apparently no
matter what the value of x, it does not appear in the graphics window.

Here are some samples.

First I was trying to draw the four 3-fold axes of space group P23:

#! /usr/bin/python
from pymol.cgo import *
from pymol import cmd

ax = [
CYLINDER, 0.0, 0.0, 0.0, -30.0, -30.0, 30.0, 0.2, 1.0, 0.5, 0.0, 1.0, 0.5, 0.0, 
CYLINDER, 0.0, 0.0, 0.0, -30.0, 30.0, 30.0, 0.2, 1.0, 0.5, 0.0, 1.0, 0.5, 0.0, 
CYLINDER, 0.0, 0.0, 0.0, 30.0, -30.0, 30.0, 0.2, 1.0, 0.5, 0.0, 1.0, 0.5, 0.0, 
CYLINDER, 0.0, 0.0, 0.0, 30.0, 30.0, 30.0, 0.2, 1.0, 0.5, 0.0, 1.0, 0.5, 0.0, 
]
cmd.load_cgo(ax,'ax')

but the 3rd of these cylinders does not appear.  So I altered one of the
end-point values ever so slightly:

ax2 = [
CYLINDER, 0.0, 0.0, 0.0, -30.0, -30.0, 30.0, 0.2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 
CYLINDER, 0.0, 0.0, 0.0, -30.0, 30.0, 30.0, 0.2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 
CYLINDER, 0.0, 0.0, 0.0, 30.00001, -30.0, 30.0, 0.2, 1.0, 0.0, 0.0, 1.0, 0.0, 
0.0, 
CYLINDER, 0.0, 0.0, 0.0, 30.0, 30.0, 30.0, 0.2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 
]
cmd.load_cgo(ax2,'ax2')

Now the 3rd cylinder appears. Similarly, changing one of the starting
points, (X, Y or Z -- doesn't matter which) and the cylinder will
appear. I tried rearranging the order of the cylinders and it always
seems to be that particular cylinder that is not drawn. So finally I
tried drawing individual cylinders and found that for example, the
following also will not appear:

ax3 = [CYLINDER, 0.0, 0.0, 0.0, 2., -2.0, 2.0, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 
1.0]
cmd.load_cgo(ax3,'ax3')

Changing any X, Y or Z value for either the starting or end point of
the cylinder will make the cylinder reappear. Finally, cylinders from
(0,0,0) to (-x,x,-x) and from (x,-x,x) to (0,0,0) also do not appear
(i.e. the same direction).  The presence of (0,0,0) as one of the
starting or end points doesn't matter: (2.0, 2.0, 2.0) to (4.0, 0.0, 4.0)
also does not appear.  

There is something strange about this (1,-1, 1) direction!

I have found this to be true with the CVS version as well as the 0.78
version (both running under Linux) and the CVS and 0.68 version under
IRIX. It doesn't appear to matter what display settings are set.

But the cylinder does appear when the image is ray-traced!

I don't think there is anything that I'm doing wrong here, but if you
have a clue, I'd be very interested!

Cheers,
Robert
-- 
Robert L. Campbell, Ph.D.               http://biophysics.med.jhmi.edu/rlc
r...@k2.med.jhmi.edu                                    phone: 410-614-6313
Research Specialist/X-ray Facility Manager
HHMI/Dept. of Biophysics & Biophysical Chem., The Johns Hopkins University
    PGP Fingerprint: 9B49 3D3F A489 05DC B35C  8E33 F238 A8F5 F635 C0E2

Reply via email to