# capture all the specified control points # they are relative to the plotter's starting point specified_control_points = [plotter.initial_position] for point in sys.argv[1].split(' '): specified_control_points.append( [plotter.initial_position[0] + float(point.split(',')[0]) , plotter.initial_position[1] + float(point.split(',')[1])] ) if '--control' in sys.argv: for point in specified_control_points: if point == plotter.initial_position: continue plotter.move_to(point) # back to start plotter.move_to(plotter.initial_position) b = Bezier(specified_control_points) path = b.generate_path() # plot curve points for p in path: plotter.move_to(p) # wraps things up with the sim plotter.finish()
, simulate=simulate_plot) # capture all the specified control points # they are relative to the plotter's starting point specified_control_points = [plotter.initial_position] for point in sys.argv[1].split(' '): specified_control_points.append([ plotter.initial_position[0] + float(point.split(',')[0]), plotter.initial_position[1] + float(point.split(',')[1]) ]) if '--control' in sys.argv: for point in specified_control_points: if point == plotter.initial_position: continue plotter.move_to(point) # back to start plotter.move_to(plotter.initial_position) b = Bezier(specified_control_points) path = b.generate_path() # plot curve points for p in path: plotter.move_to(p) # wraps things up with the sim plotter.finish()