本文整理汇总了Python中Geometry.rotatePointList方法的典型用法代码示例。如果您正苦于以下问题:Python Geometry.rotatePointList方法的具体用法?Python Geometry.rotatePointList怎么用?Python Geometry.rotatePointList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry.rotatePointList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw
# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import rotatePointList [as 别名]
def draw(self, Canvas, line):
r_size = 10 / Canvas.Scale
point = self.pos
rightPoint = (point[0] - r_size, point[1])
leftPoint = (point[0] + r_size, point[1])
upRightPoint = (rightPoint[0], rightPoint[1]+ r_size)
downRightPoint = (rightPoint[0], rightPoint[1]-r_size)
upLeftPoint = (leftPoint[0], leftPoint[1]+r_size)
downLeftPoint = (leftPoint[0], leftPoint[1]-r_size)
theta = Geom.angleFromXaxis(line)
firstTriangle = [point, upRightPoint, downRightPoint]
secondTriangle = [point, upLeftPoint, downLeftPoint]
firstTriangle = Geom.rotatePointList(firstTriangle, theta, point)
secondTriangle = Geom.rotatePointList(secondTriangle, theta, point)
Canvas.AddPolygon(
firstTriangle,
LineWidth=1,
LineColor="BLUE",
FillColor="BLUE",
)
Canvas.AddPolygon(
secondTriangle,
LineWidth=1,
LineColor="BLUE",
FillColor="BLUE",
)