本文整理汇总了Python中canoepaddle.pen.Pen.arc_right方法的典型用法代码示例。如果您正苦于以下问题:Python Pen.arc_right方法的具体用法?Python Pen.arc_right怎么用?Python Pen.arc_right使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类canoepaddle.pen.Pen
的用法示例。
在下文中一共展示了Pen.arc_right方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_offwidth_arc_joins
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_offwidth_arc_joins():
# Join arcs and lines of different widths.
p = Pen()
p.move_to((0, 0))
p.turn_to(0)
p.stroke_mode(0.8)
p.line_forward(5)
p.turn_left(45)
p.stroke_mode(3.0)
p.arc_left(90, 5)
p.turn_to(-180)
p.line_forward(5)
p.turn_left(45)
p.stroke_mode(0.8)
p.arc_left(45, 5)
p.turn_right(90)
p.stroke_mode(3.0)
p.arc_right(90, 4)
assert_svg_file(
p, 3,
'test_offwidth_arc_joins.svg'
)
示例2: test_arc_joint_continue
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_arc_joint_continue():
p = Pen()
p.stroke_mode(2.0)
p.move_to((0, 0))
p.turn_to(0)
p.arc_left(90, 5)
p.arc_left(90, 5)
p.move_to((0, 0))
p.turn_to(0)
p.arc_right(90, 5)
p.arc_right(90, 5)
assert_path_data(
p, 0,
(
'M0,-1 L0,1 A 6,6 0 0 0 6,-5 A 6,6 0 0 0 0,-11 '
'L0,-9 A 4,4 0 0 1 4,-5 A 4,4 0 0 1 0,-1 z '
'M0,-1 L0,1 A 4,4 0 0 1 4,5 A 4,4 0 0 1 0,9 '
'L0,11 A 6,6 0 0 0 6,5 A 6,6 0 0 0 0,-1 z'
),
)
示例3: test_arc_joint_numerical
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_arc_joint_numerical():
# Sometimes arc joints can miss the mark if they have odd float numbers.
p = Pen()
p.stroke_mode(0.5)
p.move_to((-26.685559703113075, 65.00539003547281))
p.turn_to(202.85281173472714)
p.arc_right(180, 1)
# This shouldn't error:
p.arc_right(50.443252846269075, center=(0.5, 0.5))
示例4: test_various_joins
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_various_joins():
p = Pen()
p.stroke_mode(0.5)
p.move_to((-2, 0))
p.turn_to(0)
p.line_forward(1)
p.turn_left(90)
p.line_forward(1)
p.turn_right(90)
p.arc_right(90, 1)
p.arc_left(90, 1)
p.turn_left(90)
p.line_forward(1)
p.paper.override_bounds(-3, -3, 3, 3)
assert_svg_file(
p, 2,
'test_various_joins.svg',
)
示例5: test_arc_error
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_arc_error():
# Don't allow drawing an arc without a center or radius.
p = Pen()
assert_raises(
TypeError,
lambda: p.arc_left(90)
)
assert_raises(
TypeError,
lambda: p.arc_right(90)
)
示例6: test_arc_center
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_arc_center():
# Draw the same arcs as in test_arc, but using centers instead of radii.
p = Pen()
p.fill_mode()
p.move_to((-5, 0))
p.turn_to(0)
p.arc_left(90, center=(-5, 5))
p.arc_right(270, center=(5, 5))
p.move_to((-5, 0))
p.turn_to(0)
p.arc_right(90, center=(-5, -5))
p.arc_left(270, center=(5, -5))
assert_path_data(
p, 0,
(
'M-5,0 A 5,5 0 0 0 0,-5 A 5,5 0 1 1 5,0 '
'M-5,0 A 5,5 0 0 1 0,5 A 5,5 0 1 0 5,0'
),
)
示例7: test_arc
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import arc_right [as 别名]
def test_arc():
# Draw arcs with all four combinations of sweep and direction flags.
p = Pen()
p.fill_mode()
p.move_to((-5, 0))
p.turn_to(0)
p.arc_left(90, radius=5)
p.arc_right(270, radius=5)
p.move_to((-5, 0))
p.turn_to(0)
p.arc_right(90, radius=5)
p.arc_left(270, radius=5)
assert_path_data(
p, 0,
(
'M-5,0 A 5,5 0 0 0 0,-5 A 5,5 0 1 1 5,0 '
'M-5,0 A 5,5 0 0 1 0,5 A 5,5 0 1 0 5,0'
)
)