RUVIDEO
Поделитесь видео 🙏

Simple Python Turtle Graphic and Code: Twisted Pair

A representation of two wires twisted. The basic Python Turtle code here utilized the repetitive appearance of wire portions from left to right. In the case of the graphic here, 4 wire portions are drawn -- two of the red wire and another 2 of the green.

Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to write ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)

Incidentally, for more graphics and variations, please visit my author url at https://www.amazon.com/author/basicpythonturtleart.url




import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4) #Changeable
number_of_wire_portion_pairs = 2 #Number of pairs of consecutive wire portions; Changeable
wire_portion_size = 30 #Radius associated with smaller arc of wire portion; Changeable
wire_width = 70 #Diameter of wire's cross section; Changeable
wire_portion_start = () #Initialization for starting point of wire portion drawing
latest_starts = [] #Initialization for list of starting points of wire portion drawing
def wire_portion(): #Procedure for drawing a wire portion
for i in range(2): #The two sides of a wire portion
t.circle(wire_portion_size, 90) #Smaller arc of wire portion
wire_portion_start = t.position() #Recording of turtle position to locate starting point of next
latest_starts.append(wire_portion_start) #wire portion drawing; Adding of turtle position to list
t.forward(wire_width) #Turtle movement over wire width
t.circle(-(wire_portion_size + wire_width), 90) #Bigger arc of wire portion
t.right(90) #Turtle direction to draw wire width
t.forward(wire_width) #Drawing over wire width
t.right(90) #Turtle direction to repeat the procedures in the loop
t.penup() #Python_Graphic start of drawing procedure
t.goto(-310, 0) #Starting point of drawing twisted pair from left to right
for i in range(number_of_wire_portion_pairs): #Loop to draw wire portion pairs by a number initialized above
for color in ["red", "green"]: #Loop specifying colors of wire portions in a pair: Changeable
t.setheading(315) #Initial direction of turtle to draw a wire portion
t.pendown() #Start of drawing a wire portion
t.fillcolor(color) #Color assignment for current wire portion
t.begin_fill() #Start of color filling
wire_portion() #Function call to draw a wire portion
t.end_fill() #End of color filling
t.penup() #End of drawing the wire portion
t.goto(latest_starts[-1]) #Trail-less movement of turtle to starting point of next wire
t.hideturtle() #portion; Last item in the latest_starts list
screen.exitonclick()

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Simple Python Turtle Graphic and Code: Twisted Pair», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.