@@ -6747,6 +6747,34 @@ def RenderRBtriplet(orig,Q,Bmat,symAxis=None):
67476747 GL .glDisable (GL .GL_COLOR_MATERIAL )
67486748 GL .glLightfv (GL .GL_LIGHT0 ,GL .GL_AMBIENT ,[.2 ,.2 ,.2 ,1 ])
67496749
6750+ def RenderTriplet (orig ,Rmat ,Bmat ):
6751+ '''draw an axes triplet located at the origin of a deformation atom
6752+ and with the x, y & z axes drawn as red, green and blue.
6753+ '''
6754+ GL .glLightfv (GL .GL_LIGHT0 ,GL .GL_AMBIENT ,[.7 ,.7 ,.7 ,1 ])
6755+ GL .glEnable (GL .GL_COLOR_MATERIAL )
6756+ GL .glLineWidth (3 )
6757+ GL .glEnable (GL .GL_BLEND )
6758+ GL .glBlendFunc (GL .GL_SRC_ALPHA ,GL .GL_ONE_MINUS_SRC_ALPHA )
6759+ GL .glEnable (GL .GL_LINE_SMOOTH )
6760+ GL .glPushMatrix ()
6761+ GL .glTranslate (* orig )
6762+ GL .glBegin (GL .GL_LINES )
6763+ lines = np .inner (np .inner (np .eye (3 ),Rmat ),Bmat )* .75
6764+ colors = [Rd ,Gr ,Bl ]
6765+ # lines along axial directions
6766+ for line ,color in zip (lines ,colors ):
6767+ GL .glColor3ubv (color )
6768+ GL .glVertex3fv (np .zeros (3 ))
6769+ GL .glVertex3fv (line )
6770+ GL .glEnd ()
6771+ GL .glPopMatrix ()
6772+ GL .glColor4ubv ([0 ,0 ,0 ,0 ])
6773+ GL .glDisable (GL .GL_LINE_SMOOTH )
6774+ GL .glDisable (GL .GL_BLEND )
6775+ GL .glDisable (GL .GL_COLOR_MATERIAL )
6776+ GL .glLightfv (GL .GL_LIGHT0 ,GL .GL_AMBIENT ,[.2 ,.2 ,.2 ,1 ])
6777+
67506778 def RenderPlane (plane ,color ):
67516779 fade = list (color ) + [.25 ,]
67526780 GL .glMaterialfv (GL .GL_FRONT_AND_BACK ,GL .GL_AMBIENT_AND_DIFFUSE ,fade )
@@ -7351,11 +7379,13 @@ def Draw(caller='',Fade=[],NPkey=False):
73517379 atcolor = atColor * 255
73527380 defParms = deformationData [atom [ci ]]
73537381 SytSym = G2spc .SytSym (atom [cx :cx + 3 ],SGData )[0 ]
7354- SGM = np .array (G2spc .GetOpFromCode (atom [cs - 1 ],SGData )[0 ])
73557382 SHC = defParms [0 ][1 ]
73567383 SHC = {item .replace ('D' ,'C' ):SHC [item ] for item in SHC if item not in ['Ne' ,'kappa' ]}
7384+ SGM = np .array (G2spc .GetOpFromCode (atom [cs - 1 ],SGData )[0 ])
73577385 SGC = nl .inv (G2lat .CrysM2CartM (Amat ,Bmat ,SGM ))
73587386 UVMat = np .inner (defCtrls ['UVmat' ],SGC .T )
7387+ UVMat1 = np .inner (defCtrls ['UVmat' ].T ,SGC .T ).T
7388+ RenderTriplet ([x ,y ,z ],UVMat1 ,Bmat )
73597389 Npsi ,Ngam = 60 ,30
73607390 PSI ,GAM = np .mgrid [0 :Npsi ,0 :Ngam ] #[azm,pol]
73617391 PSI = PSI .flatten ()* 360. / Npsi #azimuth 0-360 incl
0 commit comments