@@ -31,14 +31,14 @@ def pymol_drawing(filepath, geometric_centers, rot_centers, twist_axis, pitch_ax
3131 for i in range (num_centers ):
3232 cmd .pseudoatom ('geo_centers' , pos = tuple (geometric_centers [i ]))
3333 # Uncommented lines preserved from original function:
34- # cmd.pseudoatom('ref_1', pos=tuple(geometric_centers[i] + 6 * unit_vector))
35- # cmd.pseudoatom('ref_2', pos=tuple(geometric_centers[i] - 6 * unit_vector ))
36- # cmd.select('unit_1', selection='model ref_1 and name PS{}'.format(str(i + 1)))
37- # cmd.select('unit_2', selection='model ref_2 and name PS{}'.format(str(i + 1)))
38- # cmd.distance('unit_vector', selection1='unit_1', selection2='unit_2')
34+ cmd .pseudoatom ('ref_1' , pos = tuple (geometric_centers [i ] + 6 * unit_vector ))
35+ cmd .pseudoatom ('ref_2' , pos = tuple (geometric_centers [i ]))
36+ cmd .select ('unit_1' , selection = 'model ref_1 and name PS{}' .format (str (i + 1 )))
37+ cmd .select ('unit_2' , selection = 'model ref_2 and name PS{}' .format (str (i + 1 )))
38+ cmd .distance ('unit_vector' , selection1 = 'unit_1' , selection2 = 'unit_2' )
3939
4040 if i < num_centers - 1 :
41- unit_vector = units_rots [i ] @ (rots [i ][0 ].apply (unit_vector ))
41+ unit_vector = units_rots [i ] @ (rots [i ][0 ].apply (unit_vector )) # matrix multiplication
4242 unit_vector = rots [i ][1 ].apply (unit_vector , inverse = True )
4343
4444
@@ -77,6 +77,9 @@ def pymol_drawing(filepath, geometric_centers, rot_centers, twist_axis, pitch_ax
7777 cmd .distance ('curvature_axis' , selection1 = 'point1' , selection2 = 'curvature_point' )
7878
7979
80+
81+
82+
8083 # Place pseudoatoms for the last geometric center
8184 l = np .sqrt (np .sum ((geometric_centers [- 1 ] - geometric_centers [- 2 ]) ** 2 , axis = 0 )) * 1.5
8285 cmd .pseudoatom ('twist_ref' , pos = tuple (geometric_centers [- 1 ] + l * twist_axis [- 1 ][1 ]))
0 commit comments