Skip to content

Commit ec24dbc

Browse files
committed
fix RB triplet axes plotting as dashed lines & properly track with RB
1 parent 3422c6d commit ec24dbc

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

GSASII/GSASIIplot.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6778,7 +6778,7 @@ def RenderUnitVectors(x,y,z):
67786778
GL.glDisable(GL.GL_COLOR_MATERIAL)
67796779
GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.2,.2,.2,1])
67806780

6781-
def RenderRBtriplet(orig,Q,Bmat,symAxis=None):
6781+
def RenderRBtriplet(orig,Q0,Q,Bmat):
67826782
'''draw an axes triplet located at the origin of a rigid body
67836783
and with the x, y & z axes drawn as red, green and blue.
67846784
'''
@@ -6790,21 +6790,23 @@ def RenderRBtriplet(orig,Q,Bmat,symAxis=None):
67906790
GL.glEnable(GL.GL_LINE_SMOOTH)
67916791
GL.glPushMatrix()
67926792
GL.glTranslate(*orig)
6793+
GL.glLineStipple(1,255)
6794+
GL.glEnable(GL.GL_LINE_STIPPLE)
67936795
GL.glBegin(GL.GL_LINES)
6794-
# lines = G2mth.RotateRBXYZ(Bmat,np.eye(3),Q,symAxis)
67956796
lines = G2mth.RotateRBXYZ(Bmat,np.eye(3),Q,None)
67966797
colors = [Rd,Gr,Bl]
67976798
# lines along axial directions
67986799
for line,color in zip(lines,colors):
67996800
GL.glColor3ubv(color)
68006801
GL.glVertex3fv(np.zeros(3))
68016802
GL.glVertex3fv(line)
6802-
A,V = G2mth.Q2AVdeg(Q)
6803+
A,V = G2mth.Q2AVdeg(Q0)
68036804
Vfrac = np.inner(Bmat,V)
68046805
GL.glColor3ubv([255,255,255])
68056806
GL.glVertex3fv(np.zeros(3))
68066807
GL.glVertex3fv(1.5*Vfrac)
68076808
GL.glEnd()
6809+
GL.glDisable(GL.GL_LINE_STIPPLE)
68086810
GL.glPopMatrix()
68096811
GL.glColor4ubv([0,0,0,0])
68106812
GL.glDisable(GL.GL_LINE_SMOOTH)
@@ -7613,8 +7615,9 @@ def SetProjection(Zclip):
76137615
if testRBObj['rbType'] != 'Spin':
76147616
RenderBonds(x,y,z,rbBonds[ind],0.03,Gr)
76157617
RenderLabel(x,y,z,name,0.2,wxOrange,matRot)
7616-
RenderRBtriplet(testRBObj['rbObj']['Orig'][0],testRBObj['rbObj']['Orient'][0],
7617-
Bmat,testRBObj['rbObj'].get('symAxis'))
7618+
Q0 = testRBObj['rbObj']['Orient'][0]
7619+
Q = G2mth.QsymAxis(Q0,testRBObj['symAxis'])
7620+
RenderRBtriplet(testRBObj['rbObj']['Orig'][0],Q0,Q,Bmat)
76187621
if len(mcsaModels) > 1 and pageName == 'MC/SA': #skip the default MD entry
76197622
for ind,[x,y,z] in enumerate(mcsaXYZ):
76207623
aType = mcsaTypes[ind]

0 commit comments

Comments
 (0)