本文整理汇总了Python中Matrix.transformation_description方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.transformation_description方法的具体用法?Python Matrix.transformation_description怎么用?Python Matrix.transformation_description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix.transformation_description方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rotation_axis
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import transformation_description [as 别名]
def rotation_axis(operation, model1, model2,
showAxis = True, showSlabs = False, color = None):
os1 = set([m.openState for m in model1])
os2 = set([m.openState for m in model2])
if len(os1) != 1:
raise CommandError, 'First model spec names %d models, require 1' % len(os1)
if len(os2) != 1:
raise CommandError, 'Second model spec names %d models, require 1' % len(os2)
os1 = os1.pop()
os2 = os2.pop()
xf = os1.xform.inverse()
xf.multiply(os2.xform)
import Matrix
tf = Matrix.xform_matrix(xf)
message = ('Position of %s (%s) relative to %s (%s) coordinates:\n'
% (model2[0].name, model2[0].oslIdent(),
model1[0].name, model1[0].oslIdent()))
message += Matrix.transformation_description(tf)
from chimera import replyobj
replyobj.info(message)
from chimera import MaterialColor
if isinstance(color, MaterialColor):
color = color.rgba()
elif not color is None:
raise CommandError, 'Unknown color "%s"' % str(color)
if showAxis:
show_axis(tf, color, os1)
if showSlabs:
show_slabs(xf, color, os1)