本文整理汇总了Python中nodebox.graphics.Path.addPoint方法的典型用法代码示例。如果您正苦于以下问题:Python Path.addPoint方法的具体用法?Python Path.addPoint怎么用?Python Path.addPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nodebox.graphics.Path
的用法示例。
在下文中一共展示了Path.addPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: transform
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import addPoint [as 别名]
def transform(path, m, n1, n2, n3, scale=1.0, points=100, range=TWOPI):
new_path = Path()
for i in _range(points):
pt = path.pointAt(float(i) / points)
phi = i * range / points
dx, dy = supercalc(m, n1, n2, n3, phi)
new_path.addPoint(pt.x + dx * scale, pt.y + dy * scale)
return new_path
示例2: path
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import addPoint [as 别名]
def path(position, width, height, m, n1, n2, n3, points=1000, percentage=1.0, range=TWOPI):
path = Path()
for i in _range(points):
if i > points*percentage:
continue
phi = i * range / points
dx, dy = supercalc(m, n1, n2, n3, phi)
dx = (dx * width / 2) + position.x
dy = (dy * height / 2) + position.y
path.addPoint(dx, dy)
return path