Opened 6 years ago

Closed 6 years ago

#2799 closed defect (fixed)

Normals parellel to Z axis inverted

Reported by: Tristan Croll Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core
ChimeraX Version: 0.92 (2020-02-03)
Description
If I use the below code to generate a set of dashed lines (representing symmetry axes in a crystal), the normals come out reversed for about half of them. Probably not coincidentally, all the offenders I see are exactly parallel to the Z axis. Looks like in this case `geometry.cylinder_rotations()` can return a reflection operator with all diagonal elements negative (when z0 is greater than z1?). Example `Places` array pasted below.  I've confirmed that flipping the offending diagonals back to positive values fixes the display.

{{{
def sym_axis_drawing_screw(fold_symmetry, screw_component, axyz0, axyz1, base_radius=0.3):
    '''
    Just draw as a dashed cylinder for now.
    '''
    import numpy
    from chimerax.surface.shapes import dashed_cylinder_geometry
    from chimerax.core.geometry import Places, cylinder_rotations, rotation
    n = len(axyz0)
    radius = base_radius*(1+0.1*fold_symmetry)
    radii = numpy.ones(n, numpy.float32)*radius

    rot44 = numpy.empty([n,4,4], numpy.float32)
    cylinder_rotations(axyz0, axyz1, radii, rot44)
    rot44[:,3,:3] = 0.5*(axyz0+axyz1)

    from chimerax.core.graphics import Drawing
    d = Drawing('{}-fold screw axis'.format(fold_symmetry))
    d.set_geometry(*dashed_cylinder_geometry(segments=15))
    d.color = _symmetry_colors[fold_symmetry][1]
    d.positions = Places(opengl_array=rot44)
    return d
}}}

{{{
fourfold.positions.array()
Out[30]: 
array([[[ 4.200e-01, -0.000e+00,  0.000e+00, -3.574e+01],
        [-0.000e+00,  4.200e-01,  2.424e-14, -1.212e-14],
        [-0.000e+00, -6.754e-17,  1.507e+02, -7.535e+01]],

       [[ 4.200e-01, -0.000e+00,  9.228e-15, -6.803e-15],
        [-0.000e+00,  4.200e-01,  0.000e+00, -3.574e+01],
        [-2.572e-17, -0.000e+00,  1.507e+02, -7.535e+01]],

       [[-4.200e-01, -0.000e+00,  0.000e+00, -7.148e+01],
        [-0.000e+00, -4.200e-01,  0.000e+00, -3.574e+01],
        [-0.000e+00, -0.000e+00, -1.507e+02, -7.535e+01]],

       [[-4.200e-01, -0.000e+00,  0.000e+00, -3.574e+01],
        [-0.000e+00, -4.200e-01,  0.000e+00, -7.148e+01],
        [-0.000e+00, -0.000e+00, -1.507e+02, -7.535e+01]]])
}}}

Log:
Startup Messages  
---  
warning | 'clip' is a prefix of an existing command 'clipper'  
  
UCSF ChimeraX version: 0.92 (2020-02-03)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 6h0w format mmCIF fromDatabase pdb structureFactors true

Summary of feedback from opening 6h0w fetched from pdb  
---  
warning | WARNING: multiple experimental reflection datasets found:  
F_meas_au, F_meas_sigma_au,  
pdbx_F_plus, pdbx_F_plus_sigma, pdbx_F_minus, pdbx_F_minus_sigma  
Automatically choosing "F_meas_au, F_meas_sigma_au".  
notes | Resolution: 1.2303244209351512  
  
6h0w title:  
Crystal Structure of KDM4D with tetrazolylhydrazide ligand NS035 [more
info...]  
  
Chain information for 6h0w  
---  
Chain | Description  
1.1/A | Lysine-specific demethylase 4D  
  
Non-standard residues in 6h0w #1.1  
---  
CL — chloride ion  
EDO — 1,2-ethanediol (ethylene glycol)  
EPE — 4-(2-hydroxyethyl)-1-piperazine ethanesulfonic acid (HEPES)  
FHW — (2~{R})-3-phenyl-2-(2~{H}-1,2,3,4-tetrazol-5-yl)propanehydrazide  
I1L — [2-(2~{H}-1,2,3,4-tetrazol-5-yl)ethanoylamino]azanium  
NA — sodium ion  
NI — nickel (II) ion  
SO4 — sulfate ion  
ZN — zinc ion  
  
  

> toolshed show Shell

/opt/UCSF/ChimeraX-daily/lib/python3.7/site-
packages/IPython/core/history.py:226: UserWarning: IPython History requires
SQLite, your history will not be saved  
warn("IPython History requires SQLite, your history will not be saved")  

> set bgColor white

> set bgColor black

> save /home/tic20/Desktop/wrong_normals.jpg

> close #1.4




OpenGL version: 3.3.0 NVIDIA 440.33.01
OpenGL renderer: TITAN Xp/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation

Change History (2)

comment:1 by pett, 6 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionNormals parellel to Z axis inverted

comment:2 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Same bug as #2793. Cylinders pointing along -z were not rotated properly due to floating point precision problems.

Note: See TracTickets for help on using tickets.