当前位置: 首页>>代码示例>>Python>>正文


Python Geometry.rotatePointList方法代码示例

本文整理汇总了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",
        )
开发者ID:owenstranathan,项目名称:Pypeline,代码行数:33,代码来源:PypeGraph.py


注:本文中的Geometry.rotatePointList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。