blob: a2ddf5d0a930ee8d5bd81d425a44ba2c2de913ac [file] [log] [blame]
John Park91e69732019-03-03 13:12:43 -08001import cairo
2from color import Color, palette
3from constants import *
4import numpy as np
5
John Park91e69732019-03-03 13:12:43 -08006def set_color(cr, color, a=1):
7 if color.a == 1.0:
8 cr.set_source_rgba(color.r, color.g, color.b, a)
9 else:
10 cr.set_source_rgba(color.r, color.g, color.b, color.a)
11
12
13def draw_px_cross(cr, x, y, length_px, color=palette["RED"]):
14 """Draws a cross with fixed dimensions in pixel space."""
15 set_color(cr, color)
16 cr.move_to(x, y - length_px)
17 cr.line_to(x, y + length_px)
18 cr.stroke()
19
20 cr.move_to(x - length_px, y)
21 cr.line_to(x + length_px, y)
22 cr.stroke()
23 set_color(cr, palette["WHITE"])
24
25
26def draw_px_x(cr, x, y, length_px1, color=palette["BLACK"]):
27 """Draws a x with fixed dimensions in pixel space."""
28 length_px = length_px1 / np.sqrt(2)
29 set_color(cr, color)
30 cr.move_to(x - length_px, y - length_px)
31 cr.line_to(x + length_px, y + length_px)
32 cr.stroke()
33
34 cr.move_to(x - length_px, y + length_px)
35 cr.line_to(x + length_px, y - length_px)
36 cr.stroke()
37 set_color(cr, palette["WHITE"])
38
John Parkcf545162020-02-23 20:07:25 -080039def draw_circle(cr, x, y, radius, color=palette["RED"]):
40 set_color(cr, color)
41 cr.arc(x, y, radius, 0, 2*np.pi)
42 cr.fill()
43 cr.stroke()
John Park91e69732019-03-03 13:12:43 -080044
45def draw_control_points(cr, points, width=10, radius=4, color=palette["BLUE"]):
46 for i in range(0, len(points)):
47 draw_px_x(cr, points[i][0], points[i][1], width, color)
48 set_color(cr, color)
49 cr.arc(points[i][0], points[i][1], radius, 0, 2.0 * np.pi)
50 cr.fill()
51 set_color(cr, palette["WHITE"])
52
John Park91e69732019-03-03 13:12:43 -080053def display_text(cr, text, widtha, heighta, widthb, heightb):
54 cr.scale(widtha, -heighta)
55 cr.show_text(text)
56 cr.scale(widthb, -heightb)
57
John Parkcf545162020-02-23 20:07:25 -080058def markers(cr):
59 SHOW_MARKERS = False
60 if SHOW_MARKERS:
61 # Shield Generator Reference
62 color = palette["BLUE"]
63 yorigin = 0-SCREEN_SIZE/2 # Move origin to bottom left
64 # Top Left
65 draw_circle(cr, mToPx(inToM(206.625)), yorigin + mToPx(inToM(212.097), True), 10, color)
66 # Top Right
67 draw_circle(cr, mToPx(inToM(373.616)), yorigin + mToPx(inToM(281.26), True), 10, color)
68 # Bottom Right
69 draw_circle(cr, mToPx(inToM(422.625)), yorigin + mToPx(inToM(124.67), True), 10, color)
70 # Bottom Left
71 draw_circle(cr, mToPx(inToM(255.634)), yorigin + mToPx(inToM(55.5), True), 10, color)
72
73 # Trench Run Reference
74 color = palette["GREEN"]
75 # Bottom Trench Run
76 # Bottom Right
77 draw_circle(cr, mToPx(inToM(206.625)), yorigin, 10, color)
78 # Top Right
79 draw_circle(cr, mToPx(inToM(206.625)), yorigin + mToPx(inToM(55.5), True), 10, color)
80 # Top Left
81 draw_circle(cr, mToPx(inToM(422.625)), yorigin + mToPx(inToM(55.5), True), 10, color)
82 # Bottom Left
83 draw_circle(cr, mToPx(inToM(422.625)), yorigin, 10, color)
84
85 # Top Trench Run
86 # Top Right
87 draw_circle(cr, mToPx(inToM(206.625)), yorigin + mToPx(inToM(323.25), True), 10, color)
88 # Bottom Right
89 draw_circle(cr, mToPx(inToM(206.625)), yorigin + mToPx(inToM(281.26), True), 10, color)
90 # Top Left
91 draw_circle(cr, mToPx(inToM(422.625)), yorigin + mToPx(inToM(281.26), True), 10, color)
92 # Bottom Left
93 draw_circle(cr, mToPx(inToM(422.625)), yorigin + mToPx(inToM(323.25), True), 10, color)
94 cr.stroke()
95
96def draw_init_lines(cr):
97 yorigin = 0-SCREEN_SIZE/2 # Move origin to bottom left
98 set_color(cr, palette["RED"])
99 cr.move_to(mToPx(inToM(120)), yorigin)
100 cr.line_to(mToPx(inToM(120)), yorigin + mToPx(8.21055, True))
101
102 cr.move_to(mToPx(inToM(505.25)), yorigin)
103 cr.line_to(mToPx(inToM(505.25)), yorigin + mToPx(8.21055, True))
104
105 cr.stroke()
106
107def draw_trench_run(cr):
108 set_color(cr, palette["GREEN"])
109 yorigin = 0-SCREEN_SIZE/2 # Move origin to bottom left
110 cr.move_to(mToPx(inToM(206.625)), yorigin)
111 cr.line_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(55.5), True))
112
113 cr.move_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(55.5), True))
114 cr.line_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(55.5), True))
115
116 cr.move_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(55.5), True))
117 cr.line_to(mToPx(inToM(422.625)), yorigin)
118
119 cr.move_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(323.25), True))
120 cr.line_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(281.26), True))
121
122 cr.move_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(281.26), True))
123 cr.line_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(281.26), True))
124
125 cr.move_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(281.26), True))
126 cr.line_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(323.25), True))
127
128 cr.stroke()
129
130def draw_shield_generator(cr):
131 set_color(cr, palette["BLUE"])
132 yorigin = 0-SCREEN_SIZE/2 # Move origin to bottom left
133
134 cr.move_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(212.097), True))
135 cr.line_to(mToPx(inToM(373.616)), yorigin + mToPx(inToM(281.26), True))
136
137 cr.move_to(mToPx(inToM(373.616)), yorigin + mToPx(inToM(281.26), True))
138 cr.line_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(124.67), True))
139
140 cr.move_to(mToPx(inToM(422.625)), yorigin + mToPx(inToM(124.67), True))
141 cr.line_to(mToPx(inToM(255.634)), yorigin + mToPx(inToM(55.5), True))
142
143 cr.move_to(mToPx(inToM(255.634)), yorigin + mToPx(inToM(55.5), True))
144 cr.line_to(mToPx(inToM(206.625)), yorigin + mToPx(inToM(212.097), True))
145
146 cr.stroke()
147
148def draw_control_panel(cr): # Base plates are not included
149 set_color(cr, palette["LIGHT_GREY"])
150 yorigin = 0-SCREEN_SIZE/2 # Move origin to bottom left
151 # Bottom Control Panel
152 # Top Line
153 cr.move_to(mToPx(inToM(225.624)), yorigin + mToPx(inToM(55.5), True))
154 cr.line_to(mToPx(inToM(285.624)), yorigin + mToPx(inToM(55.5), True))
155
156 # Left Line
157 cr.move_to(mToPx(inToM(225.624)), yorigin + mToPx(inToM(55.5), True))
158 cr.line_to(mToPx(inToM(225.624)), yorigin)
159
160 # Right Line
161 cr.move_to(mToPx(inToM(285.624)), yorigin + mToPx(inToM(55.5), True))
162 cr.line_to(mToPx(inToM(285.624)), yorigin)
163
164 # Top Control Panel
165 # Bottom Line
166 cr.move_to(mToPx(inToM(403.616)), yorigin + mToPx(inToM(281.26), True))
167 cr.line_to(mToPx(inToM(343.616)), yorigin + mToPx(inToM(281.26), True))
168
169 # Right Line
170 cr.move_to(mToPx(inToM(403.616)), yorigin + mToPx(inToM(281.26), True))
171 cr.line_to(mToPx(inToM(403.616)), yorigin + mToPx(inToM(323.25), True))
172
173 # Left Line
174 cr.move_to(mToPx(inToM(343.616)), yorigin + mToPx(inToM(281.26), True))
175 cr.line_to(mToPx(inToM(343.616)), yorigin + mToPx(inToM(323.25), True))
176
177 cr.stroke()
John Park91e69732019-03-03 13:12:43 -0800178
179def draw_HAB(cr):
180 # BASE Constants
181 X_BASE = 0
182 Y_BASE = 0
183 R = 0.381 - .1
184 BACKWALL_X = X_BASE
185 LOADING_Y = mToPx(4.129151) - mToPx(0.696976)
186 # HAB Levels 2 and 3 called in variables backhab
187 # draw loading stations
188 cr.move_to(0, LOADING_Y)
189 cr.line_to(mToPx(0.6), LOADING_Y)
190 cr.move_to(mToPx(R), LOADING_Y)
191 cr.arc(mToPx(R), LOADING_Y, 5, 0, np.pi * 2.0)
192 cr.move_to(0, -1.0 * LOADING_Y)
193 cr.line_to(mToPx(0.6), -1.0 * LOADING_Y)
194 cr.move_to(mToPx(R), -1.0 * LOADING_Y)
195 cr.arc(mToPx(R), -1.0 * LOADING_Y, 5, 0, np.pi * 2.0)
196
197 # HAB Levels 2 and 3 called in variables backhab
198 WIDTH_BACKHAB = mToPx(1.2192)
199
200 Y_TOP_BACKHAB_BOX = Y_BASE + mToPx(0.6096)
201 BACKHAB_LV2_LENGTH = mToPx(1.016)
202
203 BACKHAB_LV3_LENGTH = mToPx(1.2192)
204 Y_LV3_BOX = Y_TOP_BACKHAB_BOX - BACKHAB_LV3_LENGTH
205
206 Y_BOTTOM_BACKHAB_BOX = Y_LV3_BOX - BACKHAB_LV2_LENGTH
207
208 # HAB LEVEL 1
209 X_LV1_BOX = BACKWALL_X + WIDTH_BACKHAB
210
211 WIDTH_LV1_BOX = mToPx(0.90805)
212 LENGTH_LV1_BOX = mToPx(1.6256)
213
214 Y_BOTTOM_LV1_BOX = Y_BASE - LENGTH_LV1_BOX
215
216 # Ramp off Level 1
217 X_RAMP = X_LV1_BOX
218
219 Y_TOP_RAMP = Y_BASE + LENGTH_LV1_BOX
220 WIDTH_TOP_RAMP = mToPx(1.20015)
221 LENGTH_TOP_RAMP = Y_BASE + mToPx(0.28306)
222
223 X_MIDDLE_RAMP = X_RAMP + WIDTH_LV1_BOX
224 Y_MIDDLE_RAMP = Y_BOTTOM_LV1_BOX
225 LENGTH_MIDDLE_RAMP = 2 * LENGTH_LV1_BOX
226 WIDTH_MIDDLE_RAMP = WIDTH_TOP_RAMP - WIDTH_LV1_BOX
227
228 Y_BOTTOM_RAMP = Y_BASE - LENGTH_LV1_BOX - LENGTH_TOP_RAMP
229
230 # Side Bars to Hold in balls
231 X_BARS = BACKWALL_X
232 WIDTH_BARS = WIDTH_BACKHAB
233 LENGTH_BARS = mToPx(0.574675)
234
235 Y_TOP_BAR = Y_TOP_BACKHAB_BOX + BACKHAB_LV2_LENGTH
236
237 Y_BOTTOM_BAR = Y_BOTTOM_BACKHAB_BOX - LENGTH_BARS
238
239 set_color(cr, palette["BLACK"])
240 cr.rectangle(BACKWALL_X, Y_TOP_BACKHAB_BOX, WIDTH_BACKHAB,
241 BACKHAB_LV2_LENGTH)
242 cr.rectangle(BACKWALL_X, Y_LV3_BOX, WIDTH_BACKHAB, BACKHAB_LV3_LENGTH)
243 cr.rectangle(BACKWALL_X, Y_BOTTOM_BACKHAB_BOX, WIDTH_BACKHAB,
244 BACKHAB_LV2_LENGTH)
245 cr.rectangle(X_LV1_BOX, Y_BASE, WIDTH_LV1_BOX, LENGTH_LV1_BOX)
246 cr.rectangle(X_LV1_BOX, Y_BOTTOM_LV1_BOX, WIDTH_LV1_BOX, LENGTH_LV1_BOX)
247 cr.rectangle(X_RAMP, Y_TOP_RAMP, WIDTH_TOP_RAMP, LENGTH_TOP_RAMP)
248 cr.rectangle(X_MIDDLE_RAMP, Y_MIDDLE_RAMP, WIDTH_MIDDLE_RAMP,
249 LENGTH_MIDDLE_RAMP)
250 cr.rectangle(X_RAMP, Y_BOTTOM_RAMP, WIDTH_TOP_RAMP, LENGTH_TOP_RAMP)
251 cr.rectangle(X_BARS, Y_TOP_BAR, WIDTH_BARS, LENGTH_BARS)
252 cr.rectangle(X_BARS, Y_BOTTOM_BAR, WIDTH_BARS, LENGTH_BARS)
253 cr.stroke()
254
255 cr.set_line_join(cairo.LINE_JOIN_ROUND)
256
257 cr.stroke()
258
259 #draw 0, 0
260 set_color(cr, palette["BLACK"])
261 cr.move_to(0, 0)
262 cr.line_to(0, 0 + mToPx(8.2296 / 2.0))
263 cr.move_to(0, 0)
264 cr.line_to(0, 0 + mToPx(-8.2296 / 2.0))
265 cr.move_to(0, 0)
266 cr.line_to(0 + mToPx(8.2296), 0)
267
268 cr.stroke()
269
270
271def draw_rockets(cr):
272 # BASE Constants
273 X_BASE = mToPx(2.41568)
274 Y_BASE = 0
275 # Robot longitudinal radius
276 R = 0.381
277 near_side_rocket_center = [
278 X_BASE + mToPx((2.89973 + 3.15642) / 2.0), Y_BASE + mToPx(
279 (3.86305 + 3.39548) / 2.0)
280 ]
281 middle_rocket_center = [
282 X_BASE + mToPx((3.15642 + 3.6347) / 2.0), Y_BASE + mToPx(
283 (3.39548 + 3.392380) / 2.0)
284 ]
285 far_side_rocket_center = [
286 X_BASE + mToPx((3.63473 + 3.89984) / 2.0), Y_BASE + mToPx(
287 (3.39238 + 3.86305) / 2.0)
288 ]
289
290 cr.move_to(near_side_rocket_center[0], near_side_rocket_center[1])
291 cr.line_to(near_side_rocket_center[0] - 0.8 * mToPx(0.866),
292 near_side_rocket_center[1] - 0.8 * mToPx(0.5))
293 cr.move_to(near_side_rocket_center[0] - R * mToPx(0.866),
294 near_side_rocket_center[1] - R * mToPx(0.5))
295 cr.arc(near_side_rocket_center[0] - R * mToPx(0.866),
296 near_side_rocket_center[1] - R * mToPx(0.5), 5, 0, np.pi * 2.0)
297
298 cr.move_to(middle_rocket_center[0], middle_rocket_center[1])
299 cr.line_to(middle_rocket_center[0], middle_rocket_center[1] - mToPx(0.8))
300 cr.move_to(middle_rocket_center[0], middle_rocket_center[1] - mToPx(R))
301 cr.arc(middle_rocket_center[0], middle_rocket_center[1] - mToPx(R), 5, 0,
302 np.pi * 2.0)
303
304 cr.move_to(far_side_rocket_center[0], far_side_rocket_center[1])
305 cr.line_to(far_side_rocket_center[0] + 0.8 * mToPx(0.866),
306 far_side_rocket_center[1] - 0.8 * mToPx(0.5))
307 cr.move_to(far_side_rocket_center[0] + R * mToPx(0.866),
308 far_side_rocket_center[1] - R * mToPx(0.5))
309 cr.arc(far_side_rocket_center[0] + R * mToPx(0.866),
310 far_side_rocket_center[1] - R * mToPx(0.5), 5, 0, np.pi * 2.0)
311
312 #print(far_side_rocket_center)
313 near_side_rocket_center = [
314 X_BASE + mToPx((2.89973 + 3.15642) / 2.0), Y_BASE - mToPx(
315 (3.86305 + 3.39548) / 2.0)
316 ]
317 middle_rocket_center = [
318 X_BASE + mToPx((3.15642 + 3.6347) / 2.0), Y_BASE - mToPx(
319 (3.39548 + 3.392380) / 2.0)
320 ]
321 far_side_rocket_center = [
322 X_BASE + mToPx((3.63473 + 3.89984) / 2.0), Y_BASE - mToPx(
323 (3.39238 + 3.86305) / 2.0)
324 ]
325
326 cr.move_to(near_side_rocket_center[0], near_side_rocket_center[1])
327 cr.line_to(near_side_rocket_center[0] - 0.8 * mToPx(0.866),
328 near_side_rocket_center[1] + 0.8 * mToPx(0.5))
329
330 cr.move_to(middle_rocket_center[0], middle_rocket_center[1])
331 cr.line_to(middle_rocket_center[0], middle_rocket_center[1] + mToPx(0.8))
332
333 cr.move_to(far_side_rocket_center[0], far_side_rocket_center[1])
334 cr.line_to(far_side_rocket_center[0] + 0.8 * mToPx(0.866),
335 far_side_rocket_center[1] + 0.8 * mToPx(0.5))
336
337 # Leftmost Line
338 cr.move_to(X_BASE + mToPx(2.89973), Y_BASE + mToPx(3.86305))
339 cr.line_to(X_BASE + mToPx(3.15642), Y_BASE + mToPx(3.39548))
340
341 # Top Line
342 cr.move_to(X_BASE + mToPx(3.15642), Y_BASE + mToPx(3.39548))
343 cr.line_to(X_BASE + mToPx(3.63473), Y_BASE + mToPx(3.39238))
344
345 #Rightmost Line
346 cr.move_to(X_BASE + mToPx(3.63473), Y_BASE + mToPx(3.39238))
347 cr.line_to(X_BASE + mToPx(3.89984), Y_BASE + mToPx(3.86305))
348
349 #Back Line
350 cr.move_to(X_BASE + mToPx(2.89973), Y_BASE + mToPx(3.86305))
351 cr.line_to(X_BASE + mToPx(3.89984), Y_BASE + mToPx(3.86305))
352
353 # Bottom Rocket
354 # Leftmost Line
355 cr.move_to(X_BASE + mToPx(2.89973), Y_BASE - mToPx(3.86305))
356 cr.line_to(X_BASE + mToPx(3.15642), Y_BASE - mToPx(3.39548))
357
358 # Top Line
359 cr.move_to(X_BASE + mToPx(3.15642), Y_BASE - mToPx(3.39548))
360 cr.line_to(X_BASE + mToPx(3.63473), Y_BASE - mToPx(3.39238))
361
362 #Rightmost Line
363 cr.move_to(X_BASE + mToPx(3.63473), Y_BASE - mToPx(3.39238))
364 cr.line_to(X_BASE + mToPx(3.89984), Y_BASE - mToPx(3.86305))
365
366 #Back Line
367 cr.move_to(X_BASE + mToPx(2.89973), Y_BASE - mToPx(3.86305))
368 cr.line_to(X_BASE + mToPx(3.89984), Y_BASE - mToPx(3.86305))
369
370 cr.stroke()
371
372
373def draw_cargo_ship(cr):
374 # BASE Constants
375 X_BASE = 0 + mToPx(5.59435)
376 Y_BASE = 0 + 0 #mToPx(4.129151)
377 R = 0.381 - 0.1
378
379 FRONT_PEG_DELTA_Y = mToPx(0.276352)
380 cr.move_to(X_BASE, Y_BASE + FRONT_PEG_DELTA_Y)
381 cr.line_to(X_BASE - mToPx(0.8), Y_BASE + FRONT_PEG_DELTA_Y)
382
383 cr.move_to(X_BASE, Y_BASE + FRONT_PEG_DELTA_Y)
384 cr.arc(X_BASE - mToPx(R), Y_BASE + FRONT_PEG_DELTA_Y, 5, 0, np.pi * 2.0)
385
386 cr.move_to(X_BASE, Y_BASE - FRONT_PEG_DELTA_Y)
387 cr.line_to(X_BASE - mToPx(0.8), Y_BASE - FRONT_PEG_DELTA_Y)
388
389 cr.move_to(X_BASE, Y_BASE - FRONT_PEG_DELTA_Y)
390 cr.arc(X_BASE - mToPx(R), Y_BASE - FRONT_PEG_DELTA_Y, 5, 0, np.pi * 2.0)
391
392 SIDE_PEG_Y = mToPx(1.41605 / 2.0)
393 SIDE_PEG_X = X_BASE + mToPx(1.148842)
394 SIDE_PEG_DX = mToPx(0.55245)
395
396 cr.move_to(SIDE_PEG_X, SIDE_PEG_Y)
397 cr.line_to(SIDE_PEG_X, SIDE_PEG_Y + mToPx(0.8))
398 cr.move_to(SIDE_PEG_X, SIDE_PEG_Y + mToPx(R))
399 cr.arc(SIDE_PEG_X, SIDE_PEG_Y + mToPx(R), 5, 0, np.pi * 2.0)
400
401 cr.move_to(SIDE_PEG_X + SIDE_PEG_DX, SIDE_PEG_Y)
402 cr.line_to(SIDE_PEG_X + SIDE_PEG_DX, SIDE_PEG_Y + mToPx(0.8))
403 cr.move_to(SIDE_PEG_X + SIDE_PEG_DX, SIDE_PEG_Y + mToPx(R))
404 cr.arc(SIDE_PEG_X + SIDE_PEG_DX, SIDE_PEG_Y + mToPx(R), 5, 0, np.pi * 2.0)
405
406 cr.move_to(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, SIDE_PEG_Y)
407 cr.line_to(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, SIDE_PEG_Y + mToPx(0.8))
408 cr.move_to(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, SIDE_PEG_Y + mToPx(R))
409 cr.arc(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, SIDE_PEG_Y + mToPx(R), 5, 0,
410 np.pi * 2.0)
411
412 cr.move_to(SIDE_PEG_X, -1.0 * SIDE_PEG_Y)
413 cr.line_to(SIDE_PEG_X, -1.0 * SIDE_PEG_Y - mToPx(0.8))
414 cr.move_to(SIDE_PEG_X, -1.0 * SIDE_PEG_Y - mToPx(R))
415 cr.arc(SIDE_PEG_X, -1.0 * SIDE_PEG_Y - mToPx(R), 5, 0, np.pi * 2.0)
416
417 cr.move_to(SIDE_PEG_X + SIDE_PEG_DX, -1.0 * SIDE_PEG_Y)
418 cr.line_to(SIDE_PEG_X + SIDE_PEG_DX, -1.0 * SIDE_PEG_Y - mToPx(0.8))
419 cr.move_to(SIDE_PEG_X + SIDE_PEG_DX, -1.0 * SIDE_PEG_Y - mToPx(R))
420 cr.arc(SIDE_PEG_X + SIDE_PEG_DX, -1.0 * SIDE_PEG_Y - mToPx(R), 5, 0,
421 np.pi * 2.0)
422
423 cr.move_to(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, -1.0 * SIDE_PEG_Y)
424 cr.line_to(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, -1.0 * SIDE_PEG_Y - mToPx(0.8))
425 cr.move_to(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, -1.0 * SIDE_PEG_Y - mToPx(R))
426 cr.arc(SIDE_PEG_X + 2.0 * SIDE_PEG_DX, -1.0 * SIDE_PEG_Y - mToPx(R), 5, 0,
427 np.pi * 2.0)
428
429 cr.rectangle(X_BASE, Y_BASE - mToPx(1.41605 / 2.0), mToPx(2.43205),
430 mToPx(1.41605))
431 cr.stroke()
432
John Park91e69732019-03-03 13:12:43 -0800433def draw_points(cr, p, size):
434 for i in range(0, len(p)):
435 draw_px_cross(cr, p[i][0], p[i][1], size,
436 Color(0, np.sqrt(0.2 * i), 0))