blob: e2b0412bfb0e94bd9b55b7df32aa462e0aa1b8f4 [file] [log] [blame]
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -07001#!/usr/bin/python3
2
Parker Schuhdc682952018-03-03 18:24:01 -08003from __future__ import print_function
Parker Schuh19b93b12018-03-02 23:26:58 -08004import os
5import basic_window
Parker Schuhdc682952018-03-03 18:24:01 -08006import random
Parker Schuh19b93b12018-03-02 23:26:58 -08007import gi
8import numpy
9gi.require_version('Gtk', '3.0')
10from gi.repository import Gdk
11import cairo
12import graph_generate
13from graph_generate import XYSegment, AngleSegment, to_theta, to_xy, alpha_blend
14from graph_generate import back_to_xy_loop, subdivide_theta, to_theta_loop
15from graph_generate import l1, l2, joint_center
16
17from basic_window import OverrideMatrix, identity, quit_main_loop
18
19import shapely
20from shapely.geometry import Polygon
21
Parker Schuhdc682952018-03-03 18:24:01 -080022
Parker Schuh19b93b12018-03-02 23:26:58 -080023def px(cr):
Parker Schuhdc682952018-03-03 18:24:01 -080024 return OverrideMatrix(cr, identity)
Parker Schuh19b93b12018-03-02 23:26:58 -080025
Parker Schuhdc682952018-03-03 18:24:01 -080026
Parker Schuh19b93b12018-03-02 23:26:58 -080027def draw_px_cross(cr, length_px):
Parker Schuhdc682952018-03-03 18:24:01 -080028 """Draws a cross with fixed dimensions in pixel space."""
29 with px(cr):
30 x, y = cr.get_current_point()
31 cr.move_to(x, y - length_px)
32 cr.line_to(x, y + length_px)
33 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -080034
Parker Schuhdc682952018-03-03 18:24:01 -080035 cr.move_to(x - length_px, y)
36 cr.line_to(x + length_px, y)
37 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -080038
Parker Schuhdc682952018-03-03 18:24:01 -080039
Parker Schuh19b93b12018-03-02 23:26:58 -080040def angle_dist_sqr(a1, a2):
Parker Schuhdc682952018-03-03 18:24:01 -080041 """Distance between two points in angle space."""
42 return (a1[0] - a2[0])**2 + (a1[1] - a2[1])**2
43
Parker Schuh19b93b12018-03-02 23:26:58 -080044
45# Find the highest y position that intersects the vertical line defined by x.
46def inter_y(x):
Parker Schuhdc682952018-03-03 18:24:01 -080047 return numpy.sqrt((l2 + l1)**2 -
48 (x - joint_center[0])**2) + joint_center[1]
49
Parker Schuh19b93b12018-03-02 23:26:58 -080050
51# This is the x position where the inner (hyperextension) circle intersects the horizontal line
Parker Schuhdc682952018-03-03 18:24:01 -080052derr = numpy.sqrt((l1 - l2)**2 - (joint_center[1] - 0.3048)**2)
53
Parker Schuh19b93b12018-03-02 23:26:58 -080054
55# Define min and max l1 angles based on vertical constraints.
56def get_angle(boundary):
Parker Schuhdc682952018-03-03 18:24:01 -080057 h = numpy.sqrt((l1)**2 - (boundary - joint_center[0])**2) + joint_center[1]
58 return numpy.arctan2(h, boundary - joint_center[0])
59
Parker Schuh19b93b12018-03-02 23:26:58 -080060
61# left hand side lines
62lines1 = [
Parker Schuhdc682952018-03-03 18:24:01 -080063 (-0.826135, inter_y(-0.826135)),
64 (-0.826135, 0.1397),
65 (-23.025 * 0.0254, 0.1397),
66 (-23.025 * 0.0254, 0.3048),
67 (joint_center[0] - derr, 0.3048),
Parker Schuh19b93b12018-03-02 23:26:58 -080068]
69
70# right hand side lines
Parker Schuhdc682952018-03-03 18:24:01 -080071lines2 = [(joint_center[0] + derr, 0.3048), (0.422275, 0.3048),
72 (0.422275, 0.1397), (0.826135, 0.1397), (0.826135,
73 inter_y(0.826135))]
Parker Schuh19b93b12018-03-02 23:26:58 -080074
Parker Schuhdc682952018-03-03 18:24:01 -080075t1_min = get_angle((32.525 - 4.0) * 0.0254)
76t2_min = -7.0 / 4.0 * numpy.pi
Parker Schuh19b93b12018-03-02 23:26:58 -080077
Parker Schuhdc682952018-03-03 18:24:01 -080078t1_max = get_angle((-32.525 + 4.0) * 0.0254)
79t2_max = numpy.pi * 3.0 / 4.0
80
Parker Schuh19b93b12018-03-02 23:26:58 -080081
82# Draw lines to cr + stroke.
83def draw_lines(cr, lines):
Parker Schuhdc682952018-03-03 18:24:01 -080084 cr.move_to(lines[0][0], lines[0][1])
85 for pt in lines[1:]:
86 cr.line_to(pt[0], pt[1])
87 with px(cr):
88 cr.stroke()
89
Parker Schuh19b93b12018-03-02 23:26:58 -080090
91# Rotate a rasterized loop such that it aligns to when the parameters loop
92def rotate_to_jump_point(points):
Parker Schuhdc682952018-03-03 18:24:01 -080093 last_pt = points[0]
94 for pt_i in range(1, len(points)):
95 pt = points[pt_i]
96 delta = last_pt[1] - pt[1]
97 if abs(delta) > numpy.pi:
Parker Schuhdc682952018-03-03 18:24:01 -080098 return points[pt_i:] + points[:pt_i]
99 last_pt = pt
100 return points
101
Parker Schuh19b93b12018-03-02 23:26:58 -0800102
103# shift points vertically by dy.
104def y_shift(points, dy):
Parker Schuhdc682952018-03-03 18:24:01 -0800105 return [(x, y + dy) for x, y in points]
106
Parker Schuh19b93b12018-03-02 23:26:58 -0800107
108lines1_theta_part = rotate_to_jump_point(to_theta_loop(lines1, 0))
109lines2_theta_part = rotate_to_jump_point(to_theta_loop(lines2))
110
111# Some hacks here to make a single polygon by shifting to get an extra copy of the contraints.
112lines1_theta = y_shift(lines1_theta_part, -numpy.pi * 2) + lines1_theta_part + \
113 y_shift(lines1_theta_part, numpy.pi * 2)
114lines2_theta = y_shift(lines2_theta_part, numpy.pi * 2) + lines2_theta_part + \
115 y_shift(lines2_theta_part, -numpy.pi * 2)
116
117lines_theta = lines1_theta + lines2_theta
118
119p1 = Polygon(lines_theta)
120
Parker Schuhdc682952018-03-03 18:24:01 -0800121p2 = Polygon([(t1_min, t2_min), (t1_max, t2_min), (t1_max, t2_max), (t1_min,
122 t2_max)])
Parker Schuh19b93b12018-03-02 23:26:58 -0800123
124# Fully computed theta constrints.
125lines_theta = list(p1.intersection(p2).exterior.coords)
126
Parker Schuh19b93b12018-03-02 23:26:58 -0800127lines1_theta_back = back_to_xy_loop(lines1_theta)
128lines2_theta_back = back_to_xy_loop(lines2_theta)
129
130lines_theta_back = back_to_xy_loop(lines_theta)
131
Parker Schuhdc682952018-03-03 18:24:01 -0800132
Parker Schuh19b93b12018-03-02 23:26:58 -0800133# Get the closest point to a line from a test pt.
134def get_closest(prev, cur, pt):
Parker Schuhdc682952018-03-03 18:24:01 -0800135 dx_ang = (cur[0] - prev[0])
136 dy_ang = (cur[1] - prev[1])
Parker Schuh19b93b12018-03-02 23:26:58 -0800137
Parker Schuhdc682952018-03-03 18:24:01 -0800138 d = numpy.sqrt(dx_ang**2 + dy_ang**2)
139 if (d < 0.000001):
140 return prev, numpy.sqrt((prev[0] - pt[0])**2 + (prev[1] - pt[1])**2)
141
142 pdx = -dy_ang / d
143 pdy = dx_ang / d
144
145 dpx = pt[0] - prev[0]
146 dpy = pt[1] - prev[1]
147
148 alpha = (dx_ang * dpx + dy_ang * dpy) / d / d
149
150 if (alpha < 0):
151 return prev, numpy.sqrt((prev[0] - pt[0])**2 + (prev[1] - pt[1])**2)
152 elif (alpha > 1):
153 return cur, numpy.sqrt((cur[0] - pt[0])**2 + (cur[1] - pt[1])**2)
154 else:
155 return (alpha_blend(prev[0], cur[0], alpha), alpha_blend(prev[1], cur[1], alpha)), \
156 abs(dpx * pdx + dpy * pdy)
Parker Schuh19b93b12018-03-02 23:26:58 -0800157
158
Parker Schuhdc682952018-03-03 18:24:01 -0800159#
Parker Schuh19b93b12018-03-02 23:26:58 -0800160def closest_segment(lines, pt):
Parker Schuhdc682952018-03-03 18:24:01 -0800161 c_pt, c_pt_dist = get_closest(lines[-1], lines[0], pt)
162 for i in range(1, len(lines)):
163 prev = lines[i - 1]
164 cur = lines[i]
165 c_pt_new, c_pt_new_dist = get_closest(prev, cur, pt)
166 if c_pt_new_dist < c_pt_dist:
167 c_pt = c_pt_new
168 c_pt_dist = c_pt_new_dist
169 return c_pt, c_pt_dist
170
Parker Schuh19b93b12018-03-02 23:26:58 -0800171
172# Create a GTK+ widget on which we will draw using Cairo
173class Silly(basic_window.BaseWindow):
Parker Schuhdc682952018-03-03 18:24:01 -0800174 def __init__(self):
175 super(Silly, self).__init__()
Parker Schuh19b93b12018-03-02 23:26:58 -0800176
Austin Schuhed018082018-07-08 16:01:01 -0700177 self.theta_version = False
Parker Schuhdc682952018-03-03 18:24:01 -0800178 self.reinit_extents()
Parker Schuh19b93b12018-03-02 23:26:58 -0800179
Parker Schuhdc682952018-03-03 18:24:01 -0800180 self.last_pos = (numpy.pi / 2.0, 1.0)
181 self.circular_index_select = -1
Parker Schuh19b93b12018-03-02 23:26:58 -0800182
Parker Schuhdc682952018-03-03 18:24:01 -0800183 # Extra stuff for drawing lines.
184 self.segments = []
185 self.prev_segment_pt = None
186 self.now_segment_pt = None
Austin Schuhee249892018-07-08 16:20:09 -0700187 self.spline_edit = 0
188 self.edit_control1 = True
Parker Schuh19b93b12018-03-02 23:26:58 -0800189
Parker Schuhdc682952018-03-03 18:24:01 -0800190 def reinit_extents(self):
191 if self.theta_version:
192 self.extents_x_min = -numpy.pi * 2
193 self.extents_x_max = numpy.pi * 2
194 self.extents_y_min = -numpy.pi * 2
195 self.extents_y_max = numpy.pi * 2
Parker Schuh19b93b12018-03-02 23:26:58 -0800196 else:
Parker Schuhdc682952018-03-03 18:24:01 -0800197 self.extents_x_min = -40.0 * 0.0254
198 self.extents_x_max = 40.0 * 0.0254
199 self.extents_y_min = -4.0 * 0.0254
200 self.extents_y_max = 110.0 * 0.0254
Parker Schuh19b93b12018-03-02 23:26:58 -0800201
Parker Schuhdc682952018-03-03 18:24:01 -0800202 self.init_extents(
203 (0.5 * (self.extents_x_min + self.extents_x_max), 0.5 *
204 (self.extents_y_max + self.extents_y_min)),
205 (1.0 * (self.extents_x_max - self.extents_x_min), 1.0 *
206 (self.extents_y_max - self.extents_y_min)))
Parker Schuh19b93b12018-03-02 23:26:58 -0800207
Parker Schuhdc682952018-03-03 18:24:01 -0800208 # Handle the expose-event by drawing
209 def handle_draw(self, cr):
210 # use "with px(cr): blah;" to transform to pixel coordinates.
Parker Schuh19b93b12018-03-02 23:26:58 -0800211
Parker Schuhdc682952018-03-03 18:24:01 -0800212 # Fill the background color of the window with grey
213 cr.set_source_rgb(0.5, 0.5, 0.5)
214 cr.paint()
Parker Schuh19b93b12018-03-02 23:26:58 -0800215
Parker Schuhdc682952018-03-03 18:24:01 -0800216 # Draw a extents rectangle
217 cr.set_source_rgb(1.0, 1.0, 1.0)
218 cr.rectangle(self.extents_x_min, self.extents_y_min,
219 (self.extents_x_max - self.extents_x_min),
220 self.extents_y_max - self.extents_y_min)
221 cr.fill()
Parker Schuh19b93b12018-03-02 23:26:58 -0800222
Parker Schuhdc682952018-03-03 18:24:01 -0800223 if not self.theta_version:
224 # Draw a filled white rectangle.
225 cr.set_source_rgb(1.0, 1.0, 1.0)
226 cr.rectangle(-2.0, -2.0, 4.0, 4.0)
227 cr.fill()
Parker Schuh19b93b12018-03-02 23:26:58 -0800228
Parker Schuhdc682952018-03-03 18:24:01 -0800229 cr.set_source_rgb(0.0, 0.0, 1.0)
230 cr.arc(joint_center[0], joint_center[1], l2 + l1, 0,
231 2.0 * numpy.pi)
232 with px(cr):
233 cr.stroke()
234 cr.arc(joint_center[0], joint_center[1], l1 - l2, 0,
235 2.0 * numpy.pi)
236 with px(cr):
237 cr.stroke()
238 else:
239 # Draw a filled white rectangle.
240 cr.set_source_rgb(1.0, 1.0, 1.0)
241 cr.rectangle(-numpy.pi, -numpy.pi, numpy.pi * 2.0, numpy.pi * 2.0)
242 cr.fill()
Parker Schuh19b93b12018-03-02 23:26:58 -0800243
Parker Schuhdc682952018-03-03 18:24:01 -0800244 if self.theta_version:
245 cr.set_source_rgb(0.0, 0.0, 1.0)
246 for i in range(-6, 6):
247 cr.move_to(-40, -40 + i * numpy.pi)
248 cr.line_to(40, 40 + i * numpy.pi)
249 with px(cr):
250 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -0800251
Parker Schuhdc682952018-03-03 18:24:01 -0800252 if self.theta_version:
253 cr.set_source_rgb(0.5, 0.5, 1.0)
254 draw_lines(cr, lines_theta)
255 else:
256 cr.set_source_rgb(0.5, 1.0, 1.0)
257 draw_lines(cr, lines1)
258 draw_lines(cr, lines2)
Parker Schuh19b93b12018-03-02 23:26:58 -0800259
Parker Schuhdc682952018-03-03 18:24:01 -0800260 def set_color(cr, circular_index):
261 if circular_index == -2:
262 cr.set_source_rgb(0.0, 0.25, 1.0)
263 elif circular_index == -1:
264 cr.set_source_rgb(0.5, 0.0, 1.0)
265 elif circular_index == 0:
266 cr.set_source_rgb(0.5, 1.0, 1.0)
267 elif circular_index == 1:
268 cr.set_source_rgb(0.0, 0.5, 1.0)
269 elif circular_index == 2:
270 cr.set_source_rgb(0.5, 1.0, 0.5)
271 else:
272 cr.set_source_rgb(1.0, 0.0, 0.0)
Parker Schuh19b93b12018-03-02 23:26:58 -0800273
Parker Schuhdc682952018-03-03 18:24:01 -0800274 def get_circular_index(pt):
275 theta1, theta2 = pt
276 circular_index = int(numpy.floor((theta2 - theta1) / numpy.pi))
277 return circular_index
Parker Schuh19b93b12018-03-02 23:26:58 -0800278
Parker Schuhdc682952018-03-03 18:24:01 -0800279 cr.set_source_rgb(0.0, 0.0, 1.0)
280 lines = subdivide_theta(lines_theta)
281 o_circular_index = circular_index = get_circular_index(lines[0])
282 p_xy = to_xy(lines[0][0], lines[0][1])
283 if circular_index == self.circular_index_select:
284 cr.move_to(p_xy[0] + circular_index * 0, p_xy[1])
285 for pt in lines[1:]:
286 p_xy = to_xy(pt[0], pt[1])
287 circular_index = get_circular_index(pt)
288 if o_circular_index == self.circular_index_select:
289 cr.line_to(p_xy[0] + o_circular_index * 0, p_xy[1])
290 if circular_index != o_circular_index:
291 o_circular_index = circular_index
292 with px(cr):
293 cr.stroke()
294 if circular_index == self.circular_index_select:
295 cr.move_to(p_xy[0] + circular_index * 0, p_xy[1])
Parker Schuh19b93b12018-03-02 23:26:58 -0800296
Parker Schuhdc682952018-03-03 18:24:01 -0800297 with px(cr):
298 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -0800299
Parker Schuhdc682952018-03-03 18:24:01 -0800300 if not self.theta_version:
301 theta1, theta2 = to_theta(self.last_pos, self.circular_index_select)
302 x, y = joint_center[0], joint_center[1]
303 cr.move_to(x, y)
Parker Schuh19b93b12018-03-02 23:26:58 -0800304
Parker Schuhdc682952018-03-03 18:24:01 -0800305 x += numpy.cos(theta1) * l1
306 y += numpy.sin(theta1) * l1
307 cr.line_to(x, y)
308 x += numpy.cos(theta2) * l2
309 y += numpy.sin(theta2) * l2
310 cr.line_to(x, y)
311 with px(cr):
312 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -0800313
Parker Schuhdc682952018-03-03 18:24:01 -0800314 cr.move_to(self.last_pos[0], self.last_pos[1])
315 cr.set_source_rgb(0.0, 1.0, 0.2)
316 draw_px_cross(cr, 20)
Parker Schuh19b93b12018-03-02 23:26:58 -0800317
Parker Schuhdc682952018-03-03 18:24:01 -0800318 if self.theta_version:
319 cr.set_source_rgb(0.0, 1.0, 0.2)
Parker Schuh19b93b12018-03-02 23:26:58 -0800320
Parker Schuhdc682952018-03-03 18:24:01 -0800321 cr.set_source_rgb(0.0, 1.0, 0.2)
322 cr.move_to(self.last_pos[0], self.last_pos[1])
323 draw_px_cross(cr, 5)
Parker Schuh19b93b12018-03-02 23:26:58 -0800324
Parker Schuhdc682952018-03-03 18:24:01 -0800325 c_pt, dist = closest_segment(lines_theta, self.last_pos)
326 print("dist:", dist, c_pt, self.last_pos)
327 cr.set_source_rgb(0.0, 1.0, 1.0)
328 cr.move_to(c_pt[0], c_pt[1])
329 draw_px_cross(cr, 5)
Parker Schuh19b93b12018-03-02 23:26:58 -0800330
Parker Schuhdc682952018-03-03 18:24:01 -0800331 cr.set_source_rgb(0.0, 0.5, 1.0)
332 for segment in self.segments:
333 color = [0, random.random(), 1]
334 random.shuffle(color)
335 cr.set_source_rgb(*color)
336 segment.DrawTo(cr, self.theta_version)
337 with px(cr):
338 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -0800339
Parker Schuhdc682952018-03-03 18:24:01 -0800340 cr.set_source_rgb(0.0, 1.0, 0.5)
341 segment = self.current_seg()
342 if segment:
343 print(segment)
344 segment.DrawTo(cr, self.theta_version)
345 with px(cr):
346 cr.stroke()
Parker Schuh19b93b12018-03-02 23:26:58 -0800347
Parker Schuhdc682952018-03-03 18:24:01 -0800348 def cur_pt_in_theta(self):
349 if self.theta_version: return self.last_pos
350 return to_theta(self.last_pos, self.circular_index_select)
351
352 # Current segment based on which mode the drawing system is in.
353 def current_seg(self):
354 if self.prev_segment_pt and self.now_segment_pt:
355 if self.theta_version:
356 return AngleSegment(self.prev_segment_pt, self.now_segment_pt)
357 else:
358 return XYSegment(self.prev_segment_pt, self.now_segment_pt)
359
360 def do_key_press(self, event):
361 keyval = Gdk.keyval_to_lower(event.keyval)
362 print("Gdk.KEY_" + Gdk.keyval_name(keyval))
363 if keyval == Gdk.KEY_q:
364 print("Found q key and exiting.")
365 quit_main_loop()
366 elif keyval == Gdk.KEY_c:
367 # Increment which arm solution we render
368 self.circular_index_select += 1
369 print(self.circular_index_select)
370 elif keyval == Gdk.KEY_v:
371 # Decrement which arm solution we render
372 self.circular_index_select -= 1
373 print(self.circular_index_select)
374 elif keyval == Gdk.KEY_w:
375 # Add this segment to the segment list.
376 segment = self.current_seg()
377 if segment: self.segments.append(segment)
378 self.prev_segment_pt = self.now_segment_pt
379
380 elif keyval == Gdk.KEY_r:
381 self.prev_segment_pt = self.now_segment_pt
382
383 elif keyval == Gdk.KEY_p:
384 # Print out the segments.
385 print(repr(self.segments))
386 elif keyval == Gdk.KEY_g:
387 # Generate theta points.
388 if self.segments:
389 print(repr(self.segments[0].ToThetaPoints()))
390 elif keyval == Gdk.KEY_e:
391 best_pt = self.now_segment_pt
392 best_dist = 1e10
393 for segment in self.segments:
394 d = angle_dist_sqr(segment.start, self.now_segment_pt)
395 if (d < best_dist):
396 best_pt = segment.start
397 best_dist = d
398 d = angle_dist_sqr(segment.end, self.now_segment_pt)
399 if (d < best_dist):
400 best_pt = segment.end
401 best_dist = d
402 self.now_segment_pt = best_pt
403
404 elif keyval == Gdk.KEY_t:
405 # Toggle between theta and xy renderings
406 if self.theta_version:
407 theta1, theta2 = self.last_pos
408 data = to_xy(theta1, theta2)
409 self.circular_index_select = int(
410 numpy.floor((theta2 - theta1) / numpy.pi))
411 self.last_pos = (data[0], data[1])
412 else:
413 self.last_pos = self.cur_pt_in_theta()
414
415 self.theta_version = not self.theta_version
416 self.reinit_extents()
Austin Schuhee249892018-07-08 16:20:09 -0700417
418 elif keyval == Gdk.KEY_z:
419 self.edit_control1 = not self.edit_control1
420 if self.edit_control1:
421 self.now_segment_pt = self.segments[0].control1
422 else:
423 self.now_segment_pt = self.segments[0].control2
424 if not self.theta_version:
425 data = to_xy(self.now_segment_pt[0], self.now_segment_pt[1])
426 self.last_pos = (data[0], data[1])
427 else:
428 self.last_pos = self.now_segment_pt
429
430 print("self.last_pos: ", self.last_pos, " ci: ",
431 self.circular_index_select)
432
Parker Schuhdc682952018-03-03 18:24:01 -0800433 self.redraw()
434
435 def do_button_press(self, event):
436 self.last_pos = (event.x, event.y)
437 self.now_segment_pt = self.cur_pt_in_theta()
Austin Schuhee249892018-07-08 16:20:09 -0700438
439 if self.edit_control1:
440 self.segments[0].control1 = self.now_segment_pt
441 else:
442 self.segments[0].control2 = self.now_segment_pt
443
Austin Schuh17e484e2018-03-11 01:11:36 -0800444 print('Clicked at theta: %s' % (repr(self.now_segment_pt,)))
Parker Schuhdc682952018-03-03 18:24:01 -0800445 if not self.theta_version:
446 print('Clicked at xy, circular index: (%f, %f, %f)' %
447 (self.last_pos[0], self.last_pos[1],
448 self.circular_index_select))
449
Austin Schuhed018082018-07-08 16:01:01 -0700450 print('c1: numpy.array([%f, %f])' % (self.segments[0].control1[0],
451 self.segments[0].control1[1]))
452 print('c2: numpy.array([%f, %f])' % (self.segments[0].control2[0],
453 self.segments[0].control2[1]))
454
Parker Schuhdc682952018-03-03 18:24:01 -0800455 self.redraw()
456
Parker Schuh19b93b12018-03-02 23:26:58 -0800457
458silly = Silly()
Parker Schuhdc682952018-03-03 18:24:01 -0800459silly.segments = graph_generate.segments
Parker Schuh19b93b12018-03-02 23:26:58 -0800460basic_window.RunApp()