本文整理汇总了Python中canoepaddle.pen.Pen.outline_mode方法的典型用法代码示例。如果您正苦于以下问题:Python Pen.outline_mode方法的具体用法?Python Pen.outline_mode怎么用?Python Pen.outline_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类canoepaddle.pen.Pen
的用法示例。
在下文中一共展示了Pen.outline_mode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_start_slant_legal_joint
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import outline_mode [as 别名]
def test_start_slant_legal_joint():
# Create a joint that is only legal because of the start slant.
p = Pen()
p.outline_mode(1.0, 0.1)
p.move_to((0, 0))
p.turn_to(0)
p.line_forward(0.8, start_slant=-45)
p.turn_left(90)
p.outline_mode(2.0, 0.1)
p.line_forward(5)
示例2: test_outline
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import outline_mode [as 别名]
def test_outline():
p = Pen()
p.move_to((0, 0))
p.turn_to(0)
p.outline_mode(1.0, 0.2)
p.line_forward(3)
assert_path_data(
p, 1,
(
'M-0.1,-0.6 L-0.1,0.6 L3.1,0.6 L3.1,-0.6 L-0.1,-0.6 z '
'M0.1,-0.4 L2.9,-0.4 L2.9,0.4 L0.1,0.4 L0.1,-0.4 z'
)
)
示例3: test_change_outline_width
# 需要导入模块: from canoepaddle.pen import Pen [as 别名]
# 或者: from canoepaddle.pen.Pen import outline_mode [as 别名]
def test_change_outline_width():
# Changing the outline width starts a new path.
p = Pen()
p.move_to((0, 0))
p.turn_to(0)
p.outline_mode(1.0, 0.2)
p.line_forward(3)
p.outline_mode(1.0, 0.4)
p.line_forward(3)
assert_path_data(
p, 1,
[
(
'M-0.1,-0.6 L-0.1,0.6 L3.1,0.6 L3.1,-0.6 L-0.1,-0.6 z '
'M0.1,-0.4 L2.9,-0.4 L2.9,0.4 L0.1,0.4 L0.1,-0.4 z'
),
(
'M2.8,-0.7 L2.8,0.7 L6.2,0.7 L6.2,-0.7 L2.8,-0.7 z '
'M3.2,-0.3 L5.8,-0.3 L5.8,0.3 L3.2,0.3 L3.2,-0.3 z'
),
]
)