Skip to content

Commit

Permalink
Rename some variables and print out whether the loops go through the …
Browse files Browse the repository at this point in the history
…center of the post
  • Loading branch information
AngledLuffa committed Dec 23, 2020
1 parent 3694e11 commit b3306dd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions generate_two_post_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ def describe_curve(args):
print("Ellipses making up the loops are {} long and {} wide".format(args.loop_length, args.loop_width))

def build_x_y_r_t(args):
loop_through_post = abs(args.post_distance - args.loop_length) < 0.1
print("Loops go through post: {}".format(loop_through_post))

# start and end segments are the curves into the post
num_segments = 4 * args.num_loops + 2
start_length = args.num_time_steps // num_segments
end_length = args.num_time_steps // num_segments
num_loop_steps = args.num_time_steps - start_length - end_length
start_steps = args.num_time_steps // num_segments
end_steps = args.num_time_steps // num_segments
num_loop_steps = args.num_time_steps - start_steps - end_steps

def time_t(time_step):
return time_step * 2 * math.pi * args.num_loops / num_loop_steps - math.pi / 2
Expand All @@ -64,10 +67,10 @@ def y_t(time_step):

slope_angle_t = lambda x: args.slope_angle

args.zero_circle_sides = start_length
args.zero_circle_sides = start_steps
num_time_steps, x_t, y_t, _, r_t = combine_functions.add_zero_circle(args, True, num_loop_steps, x_t, y_t, slope_angle_t, r_t)

args.zero_circle_sides = end_length
args.zero_circle_sides = end_steps
num_time_steps, x_t, y_t, _, r_t = combine_functions.add_zero_circle(args, False, num_time_steps, x_t, y_t, slope_angle_t, r_t, endpoint_x=args.post_distance)

return x_t, y_t, r_t
Expand Down

0 comments on commit b3306dd

Please sign in to comment.