generated from mwc/project_drawing
update 2 to drawing project
This is my work playing around with trying to set up an opening line to select an element and also trying to animate the electrons. This is the work before Chris and I sat down to go over some of the animation, and I am going to next incorporate the animation from that discussion into this program. I have a lot of ideas here commented out and will need to clean up some of the code next as I continue my work.
This commit is contained in:
parent
9bd0d8e285
commit
71a208e261
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
name = "Chris"
|
68
drawing.py
68
drawing.py
|
@ -7,6 +7,9 @@
|
|||
from turtle import *
|
||||
from argparse import ArgumentParser
|
||||
import turtle
|
||||
from superturtle.animation import animate
|
||||
from superturtle.easing import easeInCirc
|
||||
from animation import name
|
||||
|
||||
def draw_ring(ring):
|
||||
radius = ring*50
|
||||
|
@ -44,23 +47,62 @@ parser.add_argument("radius", type=int)
|
|||
args = parser.parse_args()'''
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
for frame in animate(frames=50):
|
||||
with frame.rotate(0, 360):
|
||||
circle(100)
|
||||
input()'''
|
||||
|
||||
'''for x in range(500):
|
||||
for y in range(500):
|
||||
|
||||
for frame in animate(frames=30):
|
||||
with frame.translate([0, 0], [x,y], easing = easeInCirc):
|
||||
draw_electron()'''
|
||||
|
||||
|
||||
print(name)
|
||||
choice = input("What is your element?")
|
||||
elements = ["H", "He", "Li", "Be", "B"]
|
||||
if choice in elements:
|
||||
electron_number = elements.index(choice) + 1
|
||||
print(electron_number)
|
||||
|
||||
else:
|
||||
print("error")
|
||||
|
||||
|
||||
for ring in range(4): #draws rings
|
||||
draw_ring(ring)
|
||||
return_to_center() #returns to center
|
||||
forward(50)
|
||||
|
||||
for electron in range(1,electron_number+1,1):
|
||||
if electron < 2:
|
||||
|
||||
#if electron % 2 == 1:
|
||||
forward(50)
|
||||
draw_electron()
|
||||
return_to_center()
|
||||
if electron ==2:
|
||||
back(50)
|
||||
draw_electron()
|
||||
return_to_center
|
||||
if electron ==3:
|
||||
forward(100)
|
||||
draw_electron()
|
||||
return_to_center()
|
||||
if electron ==4:
|
||||
back(100)
|
||||
draw_electron()
|
||||
return_to_center()
|
||||
|
||||
input()
|
||||
'''
|
||||
draw_electron()
|
||||
back(100)
|
||||
draw_electron()
|
||||
return_to_center()
|
||||
forward(100)
|
||||
draw_electron()
|
||||
back(200)
|
||||
draw_electron()
|
||||
return_to_center()
|
||||
|
||||
right(90)
|
||||
forward(100)
|
||||
draw_electron()
|
||||
back(200)
|
||||
draw_electron()
|
||||
input()
|
||||
|
||||
back(200)'''
|
Loading…
Reference in New Issue