首页 > 编程语言 >Python绘画-红太狼是怎样炼成的

Python绘画-红太狼是怎样炼成的

时间:2023-12-29 11:56:37浏览次数:44  
标签:turtle 1.0 炼成 Python pencolor width points fillcolor 红太狼

红太狼简介

红太狼是狼堡的持有人,出身富裕世家,傲娇暴力女,虽然身为大小姐,但是懂得料理和家务。因为要独自照顾老公灰太狼,所以平时都摆出一副家主的气势。
表面上经常用平底锅砸灰太狼,也抱怨灰太狼不如其他狼(尤其是初恋情人小白狼)混得好,但内心其实是很爱灰太狼的,常常安慰在羊村战役中落败的丈夫。

 

在《喜羊羊与灰太狼之妈妈乐疯狂》后红太狼转为中立角色,在《喜羊羊与灰太狼之羊村守护者》后正式转为正面角色,与羊村的小羊们成为了好朋友。
之后性格发生了变化,不再那么暴躁,变得比从前温柔了许多,几乎不再用平底锅打灰太狼了。

                                                    

                   

   

Python绘画-画狼大法

接下来就分享一下画狼大法。

#绘画模块导入
import turtle def plotLine(points, pencolor=None, width=None, speed=None): ''' 功能:画折线 参数: - points : 一系列点,用列表或元组表示 - pencolor : 画笔颜色,默认不变 - width : 画笔宽度,默认不变 - speed : 绘制速度,默认不变 ''' # 记录旧参数 oldpencolor = turtle.pencolor() oldwidth = turtle.width() oldspeed = turtle.speed() # 修改新参数 if pencolor is not None: turtle.pencolor(pencolor) if width is not None: turtle.width(width) if speed is not None: turtle.speed(speed) # 绘制折线 turtle.up() turtle.goto(points[0]) turtle.down() for point in points[1:]: turtle.goto(point) # 恢复旧参数 turtle.pencolor(oldpencolor) turtle.width(oldwidth) turtle.speed(oldspeed) def plotPoly(points, fill=False, pencolor=None, fillcolor=None, width=None, speed=None): ''' 功能:绘制封闭多边形 ''' # 保存旧参数 oldfillcolor = turtle.fillcolor() # 更新新参数 if fillcolor is not None: turtle.fillcolor(fillcolor) # 绘制封闭多边形 points_plotline = list(points) + [points[0]] if fill: turtle.begin_fill() plotLine(points_plotline, pencolor, width, speed) turtle.end_fill() else: plotLine(points_plotline, pencolor, width, speed) # 恢复旧参数 turtle.fillcolor(oldfillcolor) # 设置一些参数 turtle.setup(495, 644, 100, 80) turtle.shape('turtle') turtle.turtlesize(2, 2, 2) # 绘图 # 轮廓 points = [ (-41, 207), (-41, 212), (-39, 217), (-39, 220), (-40, 222), (-42, 222), (-46, 219), (-48, 216), (-50, 213), (-52, 209), (-54, 207), (-56, 205), (-56, 211), (-56, 219), (-55, 225), (-53, 230), (-51, 235), (-47, 240), (-42, 245), (-35, 251), (-31, 255), (-26, 257), (-24, 259), (-23, 261), (-25, 262), (-31, 265), (-39, 266), (-45, 266), (-50, 264), (-55, 262), (-60, 258), (-63, 253), (-65, 248), (-66, 242), (-66, 232), (-64, 225), (-62, 219), (-61, 214), (-59, 208), (-57, 204), (-59, 204), (-62, 207), (-66, 210), (-70, 212), (-76, 212), (-79, 211), (-81, 210), (-82, 209), (-82, 207), (-80, 206), (-76, 203), (-72, 200), (-70, 198), (-74, 195), (-78, 195), (-83, 197), (-89, 200), (-96, 202), (-102, 204), (-100, 202), (-100, 202), (-101, 201), (-105, 202), (-112, 204), (-121, 206), (-129, 208), (-142, 208), (-151, 207), (-158, 206), (-167, 203), (-175, 201), (-173, 198), (-173, 197), (-179, 195), (-187, 192), (-195, 188), (-201, 183), (-205, 179), (-210, 173), (-215, 165), (-218, 160), (-221, 154), (-223, 150), (-223, 146), (-220, 144), (-217, 141), (-213, 140), (-209, 138), (-203, 137), (-196, 135), (-188, 133), (-182, 131), (-177, 128), (-172, 126), (-166, 122), (-162, 120), (-159, 117), (-163, 116), (-163, 114), (-161, 112), (-159, 108), (-157, 104), (-156, 100), (-157, 98), (-158, 92), (-161, 87), (-163, 82), (-165, 78), (-168, 74), (-170, 71), (-173, 67), (-176, 64), (-182, 61), (-186, 58), (-190, 56), (-194, 54), (-198, 49), (-199, 47), (-199, 45), (-196, 41), (-192, 37), (-190, 33), (-190, 26), (-192, 21), (-195, 18), (-200, 15), (-203, 12), (-204, 10), (-204, 6), (-203, 0), (-201, -4), (-196, -12), (-192, -17), (-186, -24), (-178, -31), (-169, -38), (-161, -42), (-149, -46), (-139, -51), (-132, -53), (-128, -58), (-123, -66), (-118, -71), (-112, -76), (-106, -81), (-99, -86), (-92, -91), (-83, -96), (-77, -99), (-70, -102), (-63, -105), (-58, -107), (-62, -108), (-67, -109), (-73, -110), (-79, -112), (-84, -114), (-88, -116), (-93, -119), (-97, -122), (-101, -125), (-105, -128), (-113, -129), (-116, -130), (-120, -132), (-125, -136), (-129, -140), (-132, -142), (-134, -146), (-134, -151), (-133, -154), (-132, -155), (-130, -154), (-130, -157), (-129, -158), (-127, -160), (-124, -160), (-123, -162), (-123, -164), (-121, -167), (-119, -167), (-116, -166), (-113, -163), (-111, -161), (-110, -159), (-108, -164), (-107, -166), (-106, -167), (-104, -168), (-102, -168), (-100, -167), (-98, -164), (-97, -159), (-94, -156), (-93, -152), (-92, -148), (-93, -144), (-93, -141), (-86, -135), (-79, -130), (-72, -127), (-66, -125), (-60, -124), (-55, -123), (-57, -129), (-58, -134), (-61, -139), (-63, -146), (-64, -153), (-66, -164), (-67, -173), (-67, -187), (-66, -196), (-65, -204), (-63, -213), (-62, -218), (-60, -221), (-58, -222), (-55, -223), (-50, -224), (-48, -225), (-49, -230), (-49, -232), (-49, -230), (-58, -230), (-63, -230), (-67, -231), (-72, -233), (-76, -236), (-80, -240), (-83, -244), (-84, -247), (-85, -250), (-85, -254), (-83, -258), (-80, -260), (-76, -262), (-72, -263), (-67, -264), (-57, -265), (-46, -264), (-41, -263), (-35, -261), (-30, -259), (-27, -256), (-24, -253), (-23, -250), (-22, -245), (-23, -241), (-25, -238), (-28, -235), (-30, -234), (-33, -233), (-33, -227), (-27, -228), (-21, -228), (-19, -228), (-18, -226), (-17, -221), (-15, -216), (-14, -211), (-13, -206), (-19, -205), (-7, -207), (-2, -207), (4, -207), (9, -207), (13, -206), (19, -205), (10, -207), (12, -211), (14, -214), (16, -219), (17, -224), (18, -227), (22, -227), (28, -227), (32, -227), (32, -233), (28, -235), (24, -238), (22, -242), (22, -248), (24, -253), (27, -257), (31, -259), (36, -262), (41, -263), (46, -264), (65, -264), (71, -263), (75, -262), (80, -259), (82, -255), (83, -253), (83, -248), (81, -243), (78, -239), (74, -236), (70, -232), (66, -231), (61, -230), (48, -230), (48, -233), (48, -225), (53, -223), (58, -221), (61, -218), (61, -214), (62, -210), (63, -206), (64, -201), (65, -199), (67, -197), (69, -195), (70, -193), (69, -192), (67, -191), (65, -190), (65, -188), (67, -188), (69, -186), (71, -183), (72, -181), (72, -176), (71, -174), (70, -172), (68, -170), (65, -170), (64, -162), (62, -154), (61, -147), (59, -141), (56, -137), (54, -131), (53, -126), (52, -124), (56, -125), (60, -126), (66, -128), (71, -132), (75, -136), (78, -139), (82, -141), (84, -143), (86, -145), (83, -146), (83, -148), (83, -152), (83, -155), (85, -159), (87, -162), (89, -167), (89, -169), (91, -171), (95, -171), (98, -168), (99, -165), (100, -162), (101, -163), (104, -167), (107, -169), (109, -170), (112, -169), (114, -167), (114, -163), (117, -163), (120, -161), (120, -157), (122, -158), (123, -157), (124, -155), (125, -152), (124, -149), (120, -142), (114, -137), (109, -134), (105, -132), (96, -131), (96, -133), (94, -130), (90, -126), (84, -122), (78, -117), (72, -113), (66, -111), (61, -109), (60, -107), (65, -105), (72, -103), (78, -100), (86, -97), (92, -93), (100, -88), (107, -83), (113, -77), (119, -70), (124, -64), (128, -58), (131, -52), (134, -48), (130, -47), (135, -46), (140, -45), (147, -42), (154, -39), (162, -36), (170, -31), (178, -26), (186, -19), (193, -13), (199, -6), (203, 1), (205, 7), (206, 10), (206, 14), (201, 18), (196, 21), (193, 25), (191, 28), (190, 30), (190, 37), (190, 39), (192, 41), (195, 43), (198, 47), (200, 48), (200, 51), (198, 54), (196, 56), (192, 59), (186, 64), (179, 68), (174, 73), (170, 78), (166, 83), (162, 89), (159, 96), (156, 102), (154, 106), (155, 112), (158, 116), (160, 119), (161, 121), (161, 123), (156, 123), (159, 126), (163, 128), (167, 132), (173, 135), (179, 138), (186, 141), (194, 144), (200, 146), (208, 147), (214, 150), (219, 152), (223, 155), (223, 160), (221, 165), (217, 171), (211, 178), (205, 185), (199, 191), (192, 197), (185, 201), (179, 204), (175, 206), (170, 207), (172, 209), (174, 210), (171, 212), (165, 214), (156, 216), (146, 216), (136, 216), (128, 215), (117, 213), (109, 211), (99, 208), (91, 206), (92, 208), (94, 210), (89, 207), (82, 204), (77, 201), (72, 197), (69, 194), (67, 193), (65, 194), (60, 197), (52, 201), (45, 204), (35, 206), (22, 209), (8, 210), (-14, 210), (-22, 210), (-31, 210), (-35, 208), ] plotPoly(points, True, pencolor=(0.18, 0.21, 0.23), fillcolor=(0.48, 0.48, 0.48), width=2) # 右耳 points = [ (-222, 146), (-213, 151), (-203, 156), (-192, 160), (-181, 164), (-174, 166), (-168, 168), (-162, 167), (-157, 168), (-161, 166), (-160, 165), (-153, 162), (-145, 158), (-138, 154), (-130, 149), (-124, 144), (-131, 144), (-134, 143), (-134, 142), (-134, 137), (-133, 131), (-141, 131), (-143, 130), (-145, 129), (-145, 126), (-143, 122), (-142, 121), (-143, 120), (-146, 119), (-148, 118), (-150, 115), (-150, 112), (-149, 110), (-148, 109), (-150, 108), (-152, 108), (-153, 107), (-154, 105), (-154, 101), (-154, 98), (-153, 96), (-156, 100), (-157, 105), (-159, 110), (-161, 113), (-164, 115), (-163, 116), (-160, 116), (-158, 116), (-160, 118), (-166, 122), (-174, 127), (-181, 130), (-188, 133), (-197, 135), (-202, 137), (-208, 138), (-214, 140), (-219, 143), ] plotPoly(points, True, pencolor=(0.18, 0.2, 0.24), fillcolor=(0.68, 0.68, 0.68), width=2) # 右耳朵阴影 points = [ (-212, 150), (-206, 153), (-200, 155), (-192, 158), (-185, 161), (-178, 164), (-172, 165), (-168, 166), (-164, 166), (-161, 165), (-158, 163), (-153, 161), (-149, 158), (-144, 155), (-139, 152), (-136, 150), (-132, 148), (-130, 147), (-128, 146), (-128, 145), (-132, 145), (-134, 145), (-135, 143), (-136, 139), (-135, 134), (-135, 133), (-139, 132), (-142, 132), (-144, 131), (-145, 130), (-146, 129), (-146, 126), (-144, 122), (-144, 121), (-147, 120), (-149, 119), (-150, 118), (-151, 116), (-151, 112), (-150, 109), (-152, 108), (-154, 107), (-155, 106), (-155, 102), (-156, 106), (-157, 108), (-155, 109), (-154, 111), (-154, 115), (-154, 117), (-153, 120), (-151, 122), (-150, 124), (-150, 128), (-150, 130), (-149, 133), (-147, 135), (-144, 136), (-141, 137), (-139, 139), (-139, 142), (-139, 144), (-138, 145), (-138, 146), (-141, 148), (-145, 150), (-149, 152), (-154, 154), (-161, 155), (-166, 156), (-172, 156), (-176, 156), (-181, 155), (-189, 154), (-195, 152), (-201, 151), (-207, 150), ] plotPoly(points, True, pencolor=(0.49, 0.49, 0.49), fillcolor=(0.49, 0.49, 0.49), width=0) # 左耳 points = [ (152, 102), (152, 108), (152, 113), (146, 114), (147, 117), (147, 121), (146, 123), (143, 125), (139, 127), (140, 130), (141, 132), (141, 135), (138, 137), (129, 137), (129, 142), (129, 147), (128, 149), (126, 150), (124, 150), (119, 149), (117, 148), (122, 152), (128, 156), (137, 162), (147, 168), (154, 172), (158, 174), (154, 174), (172, 174), (179, 172), (187, 170), (198, 166), (209, 162), (217, 158), (222, 155), (218, 152), (214, 150), (207, 147), (199, 145), (190, 142), (182, 140), (174, 135), (167, 131), (162, 128), (157, 124), (160, 123), (161, 122), (160, 119), (158, 116), (155, 111), (154, 106), ] plotPoly(points, True, pencolor=(0.25, 0.24, 0.25), fillcolor=(0.68, 0.68, 0.68), width=2) # 左耳阴影 points = [ (153, 109), (155, 111), (155, 113), (153, 115), (150, 115), (151, 118), (151, 122), (150, 125), (147, 127), (145, 129), (145, 131), (146, 133), (145, 137), (143, 139), (139, 141), (135, 141), (135, 146), (134, 150), (132, 152), (135, 154), (142, 158), (149, 160), (157, 162), (164, 164), (173, 164), (180, 164), (192, 163), (199, 162), (204, 161), (206, 161), (202, 163), (196, 165), (187, 168), (180, 171), (174, 173), (169, 173), (161, 173), (158, 172), (152, 169), (146, 165), (140, 161), (133, 158), (129, 155), (122, 151), (125, 150), (129, 150), (130, 147), (130, 138), (135, 137), (140, 137), (142, 135), (142, 130), (141, 128), (141, 127), (143, 127), (146, 125), (148, 123), (149, 119), (149, 116), (148, 115), ] plotPoly(points, True, pencolor=(0.49, 0.49, 0.49), fillcolor=(0.49, 0.49, 0.49), width=0) # 刘海 points = [ (-49, 135), (-49, 120), (-47, 112), (-43, 102), (-38, 92), (-30, 84), (-24, 78), (-16, 72), (-9, 67), (-7, 66), (-5, 67), (-4, 69), (-5, 73), (-8, 79), (-9, 82), (-9, 90), (-5, 84), (0, 78), (4, 73), (9, 69), (13, 65), (15, 61), (17, 55), (20, 48), (22, 44), (24, 42), (28, 41), (32, 45), (37, 51), (43, 60), (48, 71), (51, 83), (52, 93), (50, 107), (48, 119), (44, 128), (41, 135), ] plotLine(points, pencolor=(0.15, 0.15, 0.15), width=2) # 刘海阴影 points = [ (-40, 98), (-36, 92), (-32, 88), (-28, 83), (-24, 79), (-19, 75), (-14, 71), (-9, 68), (-7, 67), (-6, 67), (-6, 70), (-7, 75), (-9, 80), (-11, 85), (-11, 91), (-10, 92), (-7, 88), (-4, 86), (1, 79), (5, 74), (9, 70), (13, 67), (14, 65), (16, 62), (17, 61), (19, 54), (21, 49), (23, 45), (25, 42), (26, 42), (30, 45), (34, 49), (38, 54), (41, 59), (43, 63), (45, 67), (47, 73), (49, 80), (50, 88), (50, 102), (49, 109), (47, 116), (47, 111), (47, 102), (45, 90), (43, 77), (40, 69), (36, 62), (32, 57), (28, 52), (26, 52), (24, 57), (22, 63), (17, 70), (12, 75), (6, 81), (2, 85), (-3, 90), (-11, 99), (-13, 99), (-13, 96), (-13, 91), (-12, 83), (-11, 76), (-10, 74), (-14, 76), (-20, 81), (-25, 85), (-31, 91), (-35, 94), ] plotPoly(points, True, pencolor=(0.37, 0.37, 0.38), fillcolor=(0.37, 0.37, 0.38), width=1) # 右眉 points = [ (-91, 76), (-85, 76), (-78, 75), (-73, 74), (-68, 72), (-62, 70), (-58, 68), (-53, 66), (-48, 67), (-47, 68), (-47, 71), (-48, 73), (-53, 78), (-57, 80), (-63, 82), (-78, 82), (-81, 81), (-86, 79), ] plotPoly(points, True, pencolor=(0.13, 0.11, 0.13), fillcolor=(0.13, 0.11, 0.13), width=2) # 左眉 points = [ (51, 69), (52, 68), (55, 68), (59, 70), (63, 71), (68, 74), (73, 77), (76, 78), (81, 79), (92, 79), (93, 80), (91, 82), (86, 85), (81, 86), (74, 87), (66, 85), (60, 83), (56, 80), (54, 77), (51, 73), ] plotPoly(points, True, pencolor=(0.14, 0.11, 0.14), fillcolor=(0.14, 0.11, 0.14), width=2) # 右眼 points = [ (-58, 33), (-67, 34), (-79, 32), (-89, 29), (-97, 23), (-104, 17), (-110, 9), (-112, 0), (-114, -8), (-114, -19), (-112, -28), (-108, -35), (-103, -42), (-95, -49), (-86, -54), (-78, -57), (-68, -58), (-56, -57), (-44, -53), (-35, -47), (-28, -39), (-23, -30), (-20, -22), (-19, -12), (-20, -5), (-23, 7), (-30, 17), (-36, 24), (-48, 30), ] plotPoly(points, True, pencolor=(0.15, 0.11, 0.11), fillcolor=(1.0, 1.0, 0.99), width=2) # 右眼 points = [ (-70, 24), (-78, 22), (-85, 18), (-91, 14), (-97, 6), (-99, 0), (-100, -6), (-101, -13), (-99, -21), (-94, -31), (-89, -36), (-83, -41), (-75, -44), (-66, -45), (-56, -44), (-49, -40), (-41, -34), (-35, -26), (-32, -18), (-31, -9), (-34, 1), (-40, 11), (-47, 18), (-54, 22), (-62, 24), ] plotPoly(points, True, pencolor=(0.4, 0.58, 0.71), fillcolor=(0.4, 0.58, 0.71), width=2) # 右眼 points = [ (-75, 11), (-69, 13), (-62, 13), (-57, 11), (-52, 8), (-48, 3), (-44, -3), (-43, -9), (-43, -15), (-45, -20), (-48, -25), (-51, -28), (-55, -31), (-61, -33), (-67, -34), (-74, -33), (-81, -29), (-85, -24), (-88, -17), (-89, -13), (-89, -7), (-88, -3), (-85, 2), (-81, 7), ] plotPoly(points, True, pencolor=(0.0, 0.0, 0.0), fillcolor=(0.0, 0.0, 0.0), width=0) turtle.up() turtle.goto((-82, 3)) turtle.down() turtle.pencolor((1.0, 0.98, 1.0)) turtle.dot(30) turtle.up() turtle.goto((-48, -29)) turtle.down() turtle.pencolor((0.68, 0.78, 0.78)) turtle.dot(15) # 左眼 points = [ (78, 35), (65, 35), (53, 31), (46, 27), (39, 21), (33, 14), (28, 5), (26, -3), (26, -15), (28, -24), (32, -33), (37, -41), (45, -48), (53, -53), (62, -56), (73, -57), (85, -55), (95, -51), (103, -46), (110, -39), (115, -31), (119, -20), (120, -12), (119, -2), (116, 9), (110, 18), (103, 25), (96, 29), (88, 33), (83, 34), (76, 35), ] plotPoly(points, True, pencolor=(0.19, 0.19, 0.19), fillcolor=(0.97, 0.99, 0.98), width=2) # 左眼 points = [ (73, 24), (64, 23), (55, 18), (48, 12), (43, 5), (40, -2), (39, -10), (40, -20), (44, -29), (48, -34), (54, -39), (60, -43), (67, -45), (73, -46), (81, -45), (90, -42), (96, -37), (102, -30), (106, -21), (108, -12), (107, -3), (104, 6), (99, 12), (93, 17), (87, 21), (81, 23), ] plotPoly(points, True, pencolor=(0.39, 0.61, 0.73), fillcolor=(0.39, 0.61, 0.73), width=2) # 左眼 points = [ (73, 12), (65, 11), (60, 8), (56, 5), (52, 0), (51, -7), (51, -14), (53, -21), (57, -27), (62, -31), (66, -33), (72, -34), (80, -33), (86, -30), (90, -27), (93, -22), (96, -17), (97, -11), (95, -4), (93, 1), (89, 6), (84, 9), (80, 11), ] plotPoly(points, True, pencolor=(0.01, 0.01, 0.02), fillcolor=(0.01, 0.01, 0.02), width=2) turtle.up() turtle.goto((57, 3)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(30) turtle.up() turtle.goto((91, -29)) turtle.down() turtle.pencolor((0.67, 0.74, 0.78)) turtle.dot(15) # 右眼睫毛 points = [ (-108, 13), (-111, 13), (-114, 14), (-116, 15), (-120, 18), (-118, 14), (-115, 11), (-113, 9), (-110, 7), (-109, 9), (-109, 10), ] plotPoly(points, True, pencolor=(0.11, 0.1, 0.11), fillcolor=(0.11, 0.1, 0.11), width=2) # points = [ (-113, -1), (-117, -1), (-121, -1), (-124, 0), (-127, 0), (-126, -1), (-124, -3), (-121, -5), (-119, -6), (-116, -7), (-114, -7), (-114, -4), ] plotPoly(points, True, pencolor=(0.14, 0.11, 0.15), fillcolor=(0.14, 0.11, 0.15), width=2) # 右眼睫毛 points = [ (111, 16), (114, 17), (117, 18), (120, 20), (122, 22), (122, 19), (120, 17), (119, 16), (117, 14), (115, 13), (114, 12), (113, 13), ] plotPoly(points, True, pencolor=(0.12, 0.1, 0.11), fillcolor=(0.12, 0.1, 0.11), width=2) # points = [ (118, 3), (124, 4), (129, 5), (132, 6), (130, 3), (128, 1), (125, -1), (123, -2), (120, -3), (119, 0), ] plotPoly(points, True, pencolor=(0.11, 0.1, 0.12), fillcolor=(0.11, 0.1, 0.12), width=2) # 鼻子 points = [ (10, -44), (1, -44), (-4, -45), (-8, -46), (-11, -48), (-14, -50), (-16, -53), (-16, -58), (-14, -62), (-11, -65), (-8, -67), (-5, -69), (2, -70), (7, -70), (13, -69), (20, -66), (25, -62), (27, -59), (27, -55), (25, -51), (22, -48), (18, -46), ] plotPoly(points, True, pencolor=(0.0, 0.0, 0.0), fillcolor=(0.0, 0.0, 0.0), width=2) # points = [ (1, -51), (3, -51), (6, -52), (7, -54), (7, -57), (6, -59), (4, -60), (1, -60), (-3, -60), (-5, -59), (-7, -58), (-7, -56), (-6, -54), (-4, -52), (-1, -51), ] plotPoly(points, True, pencolor=(0.14, 0.14, 0.13), fillcolor=(0.14, 0.14, 0.13), width=2) # points = [ (-11, -49), (-7, -48), (-4, -49), (-2, -50), (-2, -52), (-2, -54), (-3, -55), (-5, -56), (-7, -57), (-10, -56), (-12, -55), (-13, -52), (-12, -50), ] plotPoly(points, True, pencolor=(1.0, 1.0, 1.0), fillcolor=(1.0, 1.0, 1.0), width=2) # 嘴巴 points = [ (-15, -73), (-17, -76), (-17, -79), (-14, -82), (-12, -83), (-8, -84), (-3, -84), (0, -82), (3, -81), (4, -80), (6, -80), (9, -82), (12, -84), (16, -85), (20, -84), (24, -83), (27, -81), (28, -78), (28, -76), (26, -74), (28, -76), (28, -78), (27, -81), (24, -83), (24, -86), (24, -91), (23, -96), (21, -100), (19, -103), (16, -106), (13, -108), (9, -110), (6, -110), (3, -110), (1, -109), (-3, -107), (-7, -103), (-10, -100), (-11, -96), (-12, -91), (-12, -87), (-12, -83), (-14, -82), (-17, -79), (-17, -76), ] plotPoly(points, True, pencolor=(0.26, 0.26, 0.26), fillcolor=(0.58, 0.14, 0.18), width=2) # points = [ (-10, -96), (-9, -99), (-7, -102), (-4, -105), (0, -107), (4, -109), (8, -109), (12, -108), (15, -106), (18, -103), (20, -100), (21, -98), (21, -96), (19, -94), (15, -92), (13, -91), (7, -91), (0, -92), (-4, -93), (-7, -94), ] plotPoly(points, True, pencolor=(0.78, 0.45, 0.49), fillcolor=(0.78, 0.45, 0.49), width=1) # 右手 points = [ (-123, -142), (-125, -145), (-128, -148), (-129, -150), (-129, -154), (-129, -156), ] plotLine(points, pencolor=(0.24, 0.24, 0.25), width=1) # points = [ (-116, -148), (-119, -151), (-120, -154), (-122, -156), (-123, -159), (-123, -160), ] plotLine(points, pencolor=(0.2, 0.18, 0.2), width=2) # points = [ (-107, -156), (-109, -159), (-111, -160), ] plotLine(points, pencolor=(0.34, 0.34, 0.36), width=2) # 左手 points = [ (98, -158), (100, -161), (102, -164), ] plotLine(points, pencolor=(0.27, 0.27, 0.29), width=2) # points = [ (106, -151), (109, -154), (111, -157), (113, -160), (114, -163), (114, -164), ] plotLine(points, pencolor=(0.2, 0.2, 0.22), width=2) # points = [ (113, -145), (116, -148), (118, -150), (120, -153), (120, -157), (120, -159), ] plotLine(points, pencolor=(0.16, 0.16, 0.19), width=2) # 衣服 points = [ (-59, -136), (-54, -133), (-51, -129), (-44, -126), (-29, -126), (-20, -126), (-17, -128), (-11, -130), (-7, -131), (0, -132), (8, -131), (12, -130), (16, -128), (24, -128), (39, -129), (48, -129), (53, -133), (57, -137), (59, -141), (61, -150), (63, -159), (65, -166), (66, -175), (67, -182), (66, -184), (65, -186), (61, -190), (59, -191), (55, -192), (51, -191), (47, -189), (44, -185), (40, -183), (37, -186), (34, -189), (31, -191), (28, -191), (22, -190), (19, -187), (16, -185), (14, -182), (11, -185), (8, -187), (4, -189), (-2, -189), (-5, -187), (-9, -185), (-12, -183), (-15, -185), (-17, -187), (-18, -188), (-25, -186), (-32, -182), (-34, -186), (-37, -187), (-41, -188), (-46, -186), (-49, -183), (-50, -182), (-52, -184), (-54, -186), (-57, -188), (-60, -189), (-62, -189), (-64, -186), (-66, -184), (-67, -178), (-67, -172), (-66, -169), (-65, -163), (-64, -157), (-63, -151), (-62, -146), (-61, -142), (-60, -139), (-58, -135), ] plotPoly(points, True, pencolor=(0.15, 0.1, 0.13), fillcolor=(0.98, 0.7, 0.75), width=2) # 围巾 points = [ (-55, -108), (-55, -118), (-51, -120), (-45, -122), (-38, -124), (-30, -125), (-22, -126), (-14, -126), (-2, -126), (7, -125), (12, -126), (17, -128), (22, -128), (29, -128), (38, -128), (44, -126), (50, -124), (52, -123), (54, -120), (53, -118), (52, -116), (52, -115), (45, -116), (39, -118), (45, -116), (52, -114), (55, -114), (57, -112), (59, -111), (59, -110), (60, -108), (54, -109), (48, -110), (44, -111), (36, -113), (29, -114), (23, -115), (15, -116), (6, -116), (-1, -116), (-9, -115), (-20, -114), (-31, -113), (-38, -111), (-46, -110), (-51, -109), (-55, -108), ] plotPoly(points, True, pencolor=(0.17, 0.13, 0.15), fillcolor=(0.91, 0.4, 0.6), width=2) # points = [ (-49, -122), (-50, -130), (-51, -138), (-52, -147), (-53, -158), (-53, -169), (-53, -178), (-53, -180), (-57, -183), (-60, -185), (-61, -188), (-61, -193), (-59, -196), (-57, -198), (-55, -199), (-55, -202), (-53, -205), (-51, -208), (-47, -208), (-44, -208), (-41, -206), (-38, -209), (-34, -209), (-32, -209), (-28, -207), (-25, -204), (-25, -201), (-23, -198), (-19, -195), (-19, -191), (-19, -188), (-22, -185), (-24, -181), (-25, -170), (-25, -156), (-25, -142), (-25, -130), (-26, -125), (-32, -124), (-38, -124), (-43, -123), (-49, -122), ] plotPoly(points, True, pencolor=(0.29, 0.15, 0.24), fillcolor=(0.93, 0.4, 0.63), width=2) # points = [ (24, -129), (24, -140), (22, -142), (21, -144), (19, -146), (19, -149), (21, -152), (22, -154), (25, -155), (26, -157), (26, -159), (28, -162), (32, -163), (35, -162), (37, -160), (38, -160), (40, -161), (42, -162), (44, -162), (47, -161), (48, -161), (50, -158), (50, -154), (50, -152), (53, -151), (55, -149), (55, -145), (54, -141), (50, -141), (49, -140), (48, -137), (48, -130), (47, -126), (44, -127), (37, -128), (28, -128), (24, -128), (24, -129), ] plotPoly(points, True, pencolor=(0.27, 0.16, 0.23), fillcolor=(0.91, 0.36, 0.6), width=2) turtle.up() turtle.goto((-40, -187)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(20) turtle.up() turtle.goto((-55, -191)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(10) turtle.up() turtle.goto((-46, -201)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(10) turtle.up() turtle.goto((-33, -201)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(10) turtle.up() turtle.goto((-26, -191)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(10) turtle.up() turtle.goto((37, -143)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(19) turtle.up() turtle.goto((25, -149)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(9) turtle.up() turtle.goto((32, -157)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(9) turtle.up() turtle.goto((44, -155)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(9) turtle.up() turtle.goto((50, -145)) turtle.down() turtle.pencolor((1.0, 1.0, 1.0)) turtle.dot(9) # 裤子 points = [ (-67, -182), (-66, -190), (-66, -197), (-64, -205), (-62, -212), (-61, -216), (-61, -220), (-54, -223), (-47, -225), (-40, -227), (-33, -227), (-26, -227), (-20, -227), (-19, -225), (-18, -222), (-16, -218), (-14, -212), (-13, -206), (-19, -205), (-13, -206), (-10, -207), (-1, -207), (7, -207), (11, -207), (16, -206), (18, -205), (16, -206), (11, -207), (13, -211), (15, -217), (16, -221), (18, -226), (22, -227), (28, -227), (34, -226), (40, -225), (47, -224), (52, -223), (57, -221), (60, -219), (61, -217), (61, -213), (62, -210), (63, -206), (64, -201), (65, -195), (65, -189), (65, -186), (62, -189), (60, -191), (56, -191), (52, -192), (50, -190), (46, -187), (43, -185), (40, -183), (38, -185), (36, -187), (33, -189), (32, -191), (29, -191), (25, -191), (21, -190), (17, -187), (15, -185), (14, -183), (11, -185), (8, -187), (6, -188), (2, -189), (-1, -189), (-5, -187), (-8, -185), (-10, -183), (-12, -183), (-14, -184), (-15, -186), (-17, -187), (-19, -188), (-18, -192), (-19, -195), (-21, -198), (-24, -200), (-25, -201), (-26, -204), (-28, -206), (-29, -208), (-32, -209), (-35, -209), (-38, -208), (-40, -206), (-43, -207), (-46, -208), (-50, -208), (-53, -205), (-54, -203), (-55, -201), (-55, -199), (-57, -197), (-59, -196), (-61, -194), (-61, -190), (-62, -188), (-64, -185), (-66, -183), ] plotPoly(points, True, pencolor=(0.27, 0.12, 0.15), fillcolor=(1.0, 0.97, 0.78), width=2) # 裤子下边红色部分 points = [ (-62, -216), (-62, -220), (-59, -222), (-54, -223), (-49, -224), (-42, -226), (-34, -227), (-26, -228), (-21, -228), (-18, -226), (-19, -224), (-25, -224), (-34, -222), (-44, -221), (-50, -220), (-57, -218), (-60, -217), ] plotPoly(points, True, pencolor=(0.2, 0.2, 0.2), fillcolor=(0.91, 0.61, 0.66), width=2) # 裤子下边红色部分 points = [ (17, -224), (18, -227), (21, -227), (28, -227), (37, -226), (47, -225), (54, -223), (58, -221), (61, -219), (61, -216), (60, -216), (58, -217), (55, -219), (51, -220), (46, -221), (40, -222), (33, -222), (27, -223), (22, -223), ] plotPoly(points, True, pencolor=(0.2, 0.2, 0.2), fillcolor=(0.91, 0.61, 0.66), width=2) # 右边红晕 points = [ (-93, -60), (-99, -61), (-104, -63), (-105, -66), (-103, -70), (-98, -73), (-92, -74), (-85, -73), (-80, -70), (-79, -66), (-80, -62), (-83, -61), (-88, -60), ] plotPoly(points, True, pencolor=(0.68, 0.55, 0.55), fillcolor=(0.68, 0.55, 0.55), width=2) # 左边红晕 points = [ (87, -61), (93, -58), (98, -58), (104, -59), (109, -61), (110, -64), (109, -67), (106, -70), (101, -71), (95, -72), (89, -70), (87, -67), (86, -64), ] plotPoly(points, True, pencolor=(0.68, 0.55, 0.55), fillcolor=(0.68, 0.55, 0.55), width=2) # 右脚 points = [ (-76, -246), (-77, -249), (-79, -252), (-79, -256), (-79, -259), (-79, -260), ] plotLine(points, pencolor=(0.18, 0.18, 0.2), width=2) # points = [ (-64, -250), (-66, -252), (-66, -256), (-66, -260), (-66, -263), ] plotLine(points, pencolor=(0.18, 0.18, 0.19), width=2) # 左脚 points = [ (64, -250), (65, -253), (66, -257), (66, -260), (66, -263), ] plotLine(points, pencolor=(0.22, 0.22, 0.23), width=2) # points = [ (74, -246), (76, -250), (77, -252), (78, -255), (78, -260), ] plotLine(points, pencolor=(0.15, 0.16, 0.18), width=2) # 隐藏海龟 turtle.hideturtle() turtle.done()

  

 

 

 

 

 

 

 

 

 

 

 



 

标签:turtle,1.0,炼成,Python,pencolor,width,points,fillcolor,红太狼
From: https://www.cnblogs.com/ytp5201314/p/17934564.html

相关文章

  • 【Python高级应用课程设计 】大数据分析——银行客户认购产品预测
    一、选题背景随着大数据时代的到来,银行客户认购产品的预测分析变得越来越重要。在竞争激烈的市场环境中,银行需要更好地了解客户需求,提供更精准的产品推荐和服务,以提高客户满意度和忠诚度。同时,通过预测客户认购产品,银行可以更好地规划产品线和营销策略,提高业务效益和盈利能力......
  • 在Python中,如果你想查找特定的SQLite数据库文件(例如'mydatabase.db'),你可以使用os模块
    这是Python中os.walk()函数的常见用法¹²⁴⁵⁶。os.walk()函数用于递归遍历指定目录及其子目录,并返回一个生成器,每次迭代都会返回一个包含三个元素的元组:当前目录的路径、当前目录下所有子目录的列表和当前目录下所有文件的列表¹²⁴⁵⁶。在fordirpath,dirnames,filenamesi......
  • python实现打扑克方法
    #游戏规则:#一付扑克牌,去掉大小王,每个玩家发3张牌,最后比大小,看谁赢。##有以下几种牌:#豹子:三张一样的牌,如3张6.#同花顺:即3张同样花色的顺子,如红桃5、6、7#顺子:又称拖拉机,花色不同,但是顺子,如红桃5、方片6、黑桃7,组成的顺子#对子:2张牌一样#单......
  • Miniconda 3 | 出发,探索Python
    介绍Miniconda是Anaconda的精简版本,是一个轻量级的Python包管理工具和环境管理工具。优势和功能主要包括:轻量级和快速安装:Miniconda相比Anaconda更小巧,只包含最基本的工具和包管理功能。安装速度更快,更适合对资源要求较高的环境。包管理:提供conda包管理工具,可......
  • python 删除链表的倒数第 N 个结点 多种解法
    解法一:双指针法这种解法使用两个指针,一个快指针和一个慢指针,它们之间的距离为N。首先,让快指针先移动N步。然后,同时移动快指针和慢指针,直到快指针到达链表末尾。此时,慢指针指向的节点就是要删除的节点的前一个节点。最后,将慢指针的下一个节点指向下下个节点,完成删除操作。defre......
  • python turtle画图练习一
    1. 使用turtle库的函数绘制10层旋状放大的类正方形,提示:类正方形边长从0度方向,边长为1像素开始,每条边长度比前一条边增加2个像素,画笔逆时针旋转91度。效果如下图所示: 2. 使用turtle库的turtle.righ()函数和turtle.circle()函数绘制一个星星图形,圆弧的半径为90......
  • python基础(二)-异常处理
    异常是指程序运行时引发的错误,引发错误的原因有很多,如语法错误、逻辑错误等,若这些错误没有进行处理,将会导致程序终止运行python标准异常异常名称描述BaseException所有异常的基类SystemExit解释器请求退出KeyboardInterrupt用户中断执行(通常是输入^C)Exception......
  • python 读书报告
    蒋彬:以下是使用NumPy、SciPy、Pandas和Matplotlib库进行图像处理的一些示例代码。这些库通常与专用的图像处理库(如OpenCV或Pillow)一起使用,以实现更广泛的图像操作和处理。使用Matplotlib显示图像pythonCopycodeimportmatplotlib.pyplotaspltimportmatplotlib.image......
  • 【python爬虫课程设计】大数据分析——东方股票
    【python爬虫课程设计】大数据分析——东方股票一、选题的背景    近年来,东方股票作为中国股市的一部分,其行业地位和影响力较大。本次研究的目标是通过对东方股票的大数据分析,可以了解其在行业中的表现和趋势,从而为投资者提供决策依据。东方股票的交易数据和信息披露比较......
  • # yyds干货盘点 # 盘点一个Python自动化办公实战案例(四)
    大家好,我是皮皮。一、前言前几天在Python最强王者交流群【钟爱一生】问了一个Python自动化办公的问题,一起来看看吧。【温馨提示】遇到表达不清的,能稍微描述下,想要达成的结果吗?在excel上,或者画图也行。最好是把你想要的结果展示在excel中,另外,你展示的这个表格最好做个小的demo发上来......