-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhorus.py
2941 lines (2752 loc) · 126 KB
/
horus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import turtle
import math
from time import strftime
from random import *
### Setting up Osiris' Window
wn = turtle.Screen()
osiris = turtle.Turtle()
wn.screensize(10000, 10000)
djet = strftime("%Y-%m-%d %H-%M-%S")
### SCREENSHOT COMMAND ON 'A' KEYBOARD PRESS ###
def ihy():
ts = osiris.getscreen()
osiris.hideturtle()
ts.getcanvas().postscript(file="horus - " + djet +
".eps", width=5000, height=5000)
osiris.showturtle()
print ('screenshot taken')
turtle.onkey(ihy,"a")
turtle.listen()
### CENTRE DOT COMMAND ON 'D' KEYBOARD PRESS ###
def yam():
osiris.penup()
osiris.goto(0,0)
osiris.dot(3,'#0000FF')
turtle.onkey(yam,"d")
turtle.listen()
### MATH DEFINITIONS ###
def pythag(sidea, sideb):
csquare = (sidea ** 2) + (sideb ** 2)
sidec = math.sqrt(csquare)
return sidec
def eq_triangle_height(side):
eqheight = (math.sqrt(3)/2)* side
return eqheight
def work_sin(sin_length,sin_angle):
sin_number = ((math.sin(math.radians(sin_angle)))*sin_length)
return sin_number
## Example 1: https://www.mathsisfun.com/algebra/trig-solving-sas-triangles.html##
def work_cos_sas(side_1,side_2,cos_angle):
cos_b = (side_1 ** 2)
cos_c = (side_2 ** 2)
cos_1 = (math.cos(math.radians(cos_angle)))
cos_workout_1 = (cos_b + cos_c) - (2 * side_1 * side_2 * cos_1)
cos_number = math.sqrt(cos_workout_1)
return cos_number
def work_sin_by_sin(sin_length_1,sin_angle_1,sin_length_2,sin_angle_2):
sin_1 = (sin_length_1/(math.sin(math.radians(sin_angle_1))))
sin_2 = (math.sin(math.radians(sin_angle_2))* sin_length_2)
sin_number = sin_1 * sin_2
return sin_number
def work_cos(cos_length,cos_angle):
cos_number = ((math.cos(math.radians(cos_angle)))*cos_length)
return cos_number
def work_tan(work_tan_a,work_tan_b):
work_tan_angle = (work_tan_a / work_tan_b)
work_tan_number = (math.degrees(math.atan(work_tan_angle)))
return work_tan_number
def work_tan_opp(tan_opp_length,tan_opp_angle):
tan_opp_number = ((math.tan(math.radians(tan_opp_angle)))*tan_opp_length)
return tan_opp_number
def work_sin_opp(sin_opp_angle_adj,sin_opp_angle_opp,sin_opp_length):
sin_opp_a = (math.sin(math.radians(sin_opp_angle_adj)))
sin_opp_b = sin_opp_length / sin_opp_a
sin_opp_c = sin_opp_b * (math.sin(math.radians(sin_opp_angle_opp)))
return sin_opp_c
def work_acos(A,B,C):
X = math.degrees(math.acos(((C ** 2) + (A ** 2) - (B ** 2))/(2.0 * C * A)))
return X
'''
#############################################################
################## GEOMETRIC DEFINITIONS ####################
################## START ####################
#############################################################
'''
########################################
### Aker = Outward facing lines ###
### God of the horizon ###
########################################
### Developed Using These Integars
### (aker_y=1,aker_span=10,aker_start=-50,
### aker_start_increase = 15,aker_no=5,aker_length=300,
### aker_length_increase=-30,aker_angle=12,aker_angle_increase=5,
### aker_gap=10,aker_gap_increase=2,aker_pensize=3,aker_color='#F09900')
def aker(aker_y=1,aker_span=10,aker_start=-50,
aker_start_increase = 15,aker_no=5,aker_length=300,
aker_length_increase=-30,aker_angle=12,aker_angle_increase=5,
aker_gap=10,aker_gap_increase=2,aker_pensize=3,aker_color='#F09900'):
if aker_y == 1:
osiris.penup()
osiris.pencolor(aker_color)
osiris.pensize(aker_pensize)
osiris.setheading(osirisHeadingStart)
osiris.forward(aker_start)
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
for aker_d in range(1,3):
osiris.setheading(osirisHeadingStart)
if aker_d == 1:
osiris.right(90)
else:
osiris.left(90)
osiris.forward(aker_span)
osiris.dot(2)
osirisTemporaryX = osiris.xcor()
osirisTemporaryY = osiris.ycor()
for aker_e in range(1,(aker_no+1)):
osiris.setheading(osirisHeadingStart)
if aker_d == 1:
osiris.right(aker_angle+(aker_e*aker_angle_increase))
else:
osiris.left(aker_angle+(aker_e*aker_angle_increase))
osiris.pendown()
osiris.forward(aker_length+(aker_e*aker_length_increase))
osiris.penup()
osiris.goto(osirisTemporaryX,osirisTemporaryY)
osiris.setheading(osirisHeadingStart)
osiris.forward(aker_e*aker_start_increase)
if aker_d == 1:
osiris.right(90)
else:
osiris.left(90)
osiris.forward(aker_gap*(aker_e*aker_gap_increase))
osiris.goto(osirisCurrentX,osirisCurrentY)
osiris.setheading(osirisHeadingStart)
########################################
### Amun = Central Spikes ###
### Creator God, Associated With Ra ###
########################################
### Developed Using These Integars
### (1,10,0,360,40,100,4,'#BFDDE1')
def amun(amun_y,amun_no,amun_angle_a,amun_angle_b,
amun_forward_a,amun_forward_b,
amun_pensize,amun_color):
if amun_y == 1:
for amun_a in range(amun_no):
osiris.penup()
osiris.pencolor(amun_color)
osiris.pensize(amun_pensize)
osiris.goto(0,0)
osiris.right(randint(amun_angle_a,amun_angle_b))
osiris.pendown()
osiris.forward(randint(amun_forward_a,amun_forward_b))
osiris.penup()
########################
### Amunet = Diamond ###
### Creation Godess ###
########################
### Developed using
### 1,20,200,9,'#FF4444
def amunet(amunet_y,amunet_start,amunet_size,
amunet_pensize,amunet_color):
if amunet_y == 1:
osiris.forward(amunet_start)
osiris.pensize(amunet_pensize)
osiris.color(amunet_color)
osiris.pendown()
osiris.right(45)
osiris.forward(amunet_size)
for b in range(1,4):
osiris.left(90)
osiris.forward(amunet_size)
if b == 1:
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
osiris.penup()
osiris.goto(osirisCurrentX, osirisCurrentY)
osiris.setheading(osirisHeadingStart)
#######################################
### Anhur = Forward Facing Chevrons ###
### Sky god and god of war ###
#######################################
### Developed using
### 1,50,6,100,15,135,5,'#FF4444'
def anhur(anhur_y,anhur_start,anhur_no,
anhur_size,anhur_spacing,
anhur_pensize,anhur_color):
if anhur_y == 1:
osiris.pensize(anhur_pensize)
osiris.color(anhur_color)
osirisTemporaryX = osiris.xcor()
osirisTemporaryY = osiris.ycor()
for anhur_c in range(anhur_no):
osiris.penup()
osiris.goto(osirisTemporaryX, osirisTemporaryY)
osiris.setheading(osirisHeadingStart)
osiris.forward((anhur_start) + (anhur_spacing * anhur_c))
# This is marked here as it will mark the top chevron
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
osiris.right(135)
osiris.pendown()
osiris.pensize(2)
anhur_calsize = ((anhur_size) -
((anhur_size/anhur_no) * anhur_c))
osiris.forward(anhur_calsize)
osiris.backward(anhur_calsize)
osiris.right(90)
osiris.forward(anhur_calsize)
osiris.penup()
osiris.goto(osirisCurrentX, osirisCurrentY)
osiris.setheading(osirisHeadingStart)
##########################################
### Anput = Double Helix ###
### Goddess of dead and mummification ###
##########################################
### Developed Using These Integars
### (1,0,1,30,4,1,'#4C9FC1')
def anput(anput_y,anput_start,anput_outer,
anput_outer_size,anput_outerpensize,
anput_innerpensize,anput_color,):
if anput_y == 1:
osiris.penup()
osiris.pensize(anput_outerpensize)
osiris.color(anput_color)
osiris.setheading(osirisHeadingStart)
osiris.forward(anput_start)
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
if anput_outer == 1:
for anput_a in range(1,3):
osiris.goto(osirisCurrentX,osirisCurrentY)
osiris.setheading(osirisHeadingStart)
osiris.pendown()
if anput_a == 1:
osiris.right(60)
else:
osiris.left(60)
osiris.forward(anput_outer_size)
if anput_a == 1:
osiris.left(60)
else:
osiris.right(60)
osiris.forward(anput_outer_size)
if anput_a == 1:
osiris.left(60)
else:
osiris.right(60)
osiris.forward(anput_outer_size/3)
if anput_a == 1:
osiris.right(120)
else:
osiris.left(120)
osiris.forward(anput_outer_size/3)
for anput_b in range(1,3):
if anput_a == 1:
osiris.left(60)
else:
osiris.right(60)
osiris.forward(anput_outer_size)
osiris.penup()
osiris.goto(osirisCurrentX,osirisCurrentY)
osiris.setheading(osirisHeadingStart)
osiris.penup()
# Now we need to move to the centre of the helix
osiris.right(60)
osiris.pensize(anput_innerpensize)
osiris.forward(anput_outer_size)
osiris.left(120)
osiris.forward(anput_outer_size)
def anput_inner():
for anput_c in range(1,4):
osiris.forward(anput_outer_size/1.5)
osiris.right(120)
for anput_d in range(1,4):
osiris.forward(anput_outer_size/3)
osiris.right(120)
osiris.left(60)
for anput_e in range(1,3):
for anput_f in range(1,7):
osiris.pendown()
anput_inner()
osiris.penup()
if anput_e == 1:
osiris.left(120)
osiris.backward(anput_outer_size/0.75)
osiris.setheading(osirisHeadingStart)
osiris.forward(anput_outer_size*1)
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
################################################
### Anubis = Concentric squares with shapes ###
### Protector of the gates to the underworld ###
################################################
### Developed using
### (1,4,400,40,0,14,6,1,14,8,3,3,'#90CC16')
def anubis(anubis_y,anubis_no,anubis_size,anubis_reduction,
anubis_dot_y,anubis_dot_no,anubis_dot_size,
anubis_crosses_y,anubis_cross_no,anubis_cross_size,
anubis_cross_reduction,anubis_pensize,anubis_color):
if anubis_y == 1:
anubis_xy = anubis_size / 2
osiris.penup()
osiris.color(anubis_color)
osiris.pensize(anubis_pensize)
osiris.goto(anubis_xy,anubis_xy)
osiris.setheading(90)
for anubis_c in range (1,(anubis_no+1)):
for anubis_d in range (1,5):
osiris.pendown()
osiris.left(90)
osiris.forward(anubis_size)
osiris.penup()
# Decide if we want to draw crosses
if anubis_crosses_y == 1:
anubis_size = anubis_size - anubis_reduction
anubis_xy = anubis_xy - (anubis_reduction/2)
osiris.goto(anubis_xy,anubis_xy)
osiris.setheading(90)
anubis_cross_space = anubis_size / anubis_cross_no
for anubis_d in range (1,5):
osiris.left(90)
for anubis_e in range(anubis_cross_no):
osirisReturnX = osiris.xcor()
osirisReturnY = osiris.ycor()
for anubis_f in range(1,5):
osiris.left(90)
osiris.pendown()
osiris.forward(anubis_cross_size/2)
osiris.penup()
osiris.goto(osirisReturnX, osirisReturnY)
osiris.forward(anubis_cross_space)
# End of cross logic
# Decide if we want to draw dots
if anubis_dot_y == 1:
anubis_size = anubis_size - anubis_reduction
anubis_xy = anubis_xy - (anubis_reduction/2)
osiris.goto(anubis_xy,anubis_xy)
osiris.setheading(90)
anubis_dot_space = anubis_size / anubis_dot_no
for anubis_d in range (1,5):
osiris.left(90)
for anubis_e in range(anubis_dot_no):
osiris.pendown()
osiris.dot(anubis_dot_size)
osiris.penup()
osiris.forward(anubis_dot_space)
# End of dot logic
anubis_size = anubis_size - anubis_reduction
anubis_xy = anubis_xy - (anubis_reduction/2)
osiris.goto(anubis_xy,anubis_xy)
osiris.setheading(90)
anubis_cross_no = anubis_cross_no - anubis_cross_reduction
# If we want to draw dots or crosses then
# We don't need the final square
if anubis_dot_y == 1 or anubis_crosses_y == 1:
for anubis_k in range (1,5):
osiris.pendown()
osiris.left(90)
osiris.forward(anubis_size)
osiris.penup()
###################################################
### Anubis = Upward spikes and downward slashes ###
### Warlike Egyptian Lion God ###
###################################################
### Developed using
## apedemak_y=1,apedemak_start=0,
## apedemak_span_angle=70,apedemak_spike_inner_angle= 60,
## apedemak_length = 400,apedemak_spike_no = 5,
## apedemak_little_spike = 1,apedemak_little_spike_type = 'percentage',
## apedemak_little_spike_reduction = 0.5,adepemak_slash_space = 0.5,
## adepemak_slash_extension = 200,adepemak_slash_no = 3,
## apedemak_spike_pensize = 4,apedemak_spike_color = '#FF4400',
## apedemak_little_spike_pensize = 3,apedemak_little_spike_color = '#FF4499',
## apedemak_slash_pensize = 6,apedemak_slash_color = '#4444FF'
def apedemak(
apedemak_y=1,apedemak_start=0,
apedemak_span_angle=70,apedemak_spike_inner_angle= 60,
apedemak_length = 400,apedemak_spike_no = 5,
apedemak_little_spike = 1,apedemak_little_spike_type = 'percentage',
apedemak_little_spike_reduction = 0.5,adepemak_slash_space = 0.5,
adepemak_slash_extension = 200,adepemak_slash_no = 3,
apedemak_spike_pensize = 4,apedemak_spike_color = '#FF4400',
apedemak_little_spike_pensize = 3,apedemak_little_spike_color = '#FF4499',
apedemak_slash_pensize = 6,apedemak_slash_color = '#4444FF'
):
if apedemak_y == 1:
### Universal Settings
osiris.setheading(osirisHeadingStart)
osiris.forward(apedemak_start)
osirisReturnX = osiris.xcor()
osirisReturnY = osiris.ycor()
apedemak_bottom_angle = (apedemak_span_angle/2)
apedemak_outer_line = apedemak_length + adepemak_slash_extension
### Upward Spike Measurements
apedemak_spike_angle = (180 - 90
- apedemak_spike_inner_angle) # Angle from centre
### Downward Slash Measurements
# Used for calculating top splash
apedemak_slash_angle_a = (180 - apedemak_spike_angle -
apedemak_bottom_angle)
# Height from the bottom of the cone to the top of the middle
apedemak_height = (work_sin_opp(apedemak_spike_inner_angle,
apedemak_slash_angle_a,
apedemak_length))
# The top slash line - also used to calculate the other slashes
apedemak_slash_first_line = (work_cos_sas(apedemak_outer_line,
apedemak_height,
apedemak_bottom_angle))
# The top most outer angle
apedemak_slash_top_angle = (work_acos(apedemak_outer_line,
apedemak_height,
apedemak_slash_first_line))
# The maximum height between the bottom and top slash terminal points
apedemak_slash_terminal_height = (apedemak_height *
adepemak_slash_space)
# The gap between where the downward slash lines terminate
apedemak_slash_gap = (apedemak_slash_terminal_height /
(adepemak_slash_no - 1))
# The angle for the top slash from the top-middle of the cone
apedemak_slash_angle_b = (180 - apedemak_bottom_angle
- apedemak_slash_top_angle)
for apedemak_a in range(1,3):
osiris.setheading(osirisHeadingStart)
osiris.goto(osirisReturnX, osirisReturnY)
apedemak_spike_outer_length = apedemak_length
# Calculation to reduce the distance that Osiris
# starts each spike at.
apedemak_red_distance = (apedemak_length
/ apedemak_spike_no)
for apedemak_g in range(1,apedemak_spike_no+1):
osiris.goto(osirisReturnX, osirisReturnY)
# The distance from where the spike starts
# to the centre of the cone - at a 90 degree angle.
# We can't use secant so need this workaround :(
apedemak_spike_hor = (work_sin
(apedemak_spike_outer_length,
apedemak_bottom_angle))
# The distance from the above calculation terminates
# at the centre of the cone to where the spike will
# terminate at - we already know the angle we want to use
apedemak_spike_upwards = (work_tan_opp
(apedemak_spike_hor,
apedemak_spike_angle))
# Now we work out the actual spike height -
# We can use pythag because we calcuated the above on
# a right angle triangle - neat :)
apedemak_spike_length = pythag(apedemak_spike_upwards,
apedemak_spike_hor)
# We need this measurement to work out the first slash
# later in the function
if apedemak_g == 1:
apedemak_slash_measure_a = apedemak_spike_length
### Now we can begin to move Osiris around
osiris.setheading(osirisHeadingStart)
if apedemak_a == 1:
osiris.left(apedemak_bottom_angle)
else:
osiris.right(apedemak_bottom_angle)
osiris.forward(apedemak_spike_outer_length)
osiris.setheading(osirisHeadingStart)
if apedemak_a == 1:
osiris.right(90-apedemak_spike_angle)
else:
osiris.left(90-apedemak_spike_angle)
osiris.pendown()
osiris.pensize(apedemak_spike_pensize)
osiris.color(apedemak_spike_color)
osiris.forward(apedemak_spike_length)
osiris.penup()
osiris.goto(osirisReturnX, osirisReturnY)
# Make sure the little spikes start half the distance
# of the big spikes
apedemak_little_spike_start = (apedemak_spike_outer_length
-(apedemak_red_distance/2))
# Little Spike Measurements - Use the same logic as
# the build up for the big spikes above in the function
apedemak_little_spike_hor = (work_sin(apedemak_little_spike_start,
apedemak_bottom_angle))
apedemak_little_spike_height = (work_tan_opp(apedemak_little_spike_hor,
apedemak_spike_angle))
apedemak_little_spike_length = pythag(apedemak_little_spike_height,
apedemak_little_spike_hor)
if apedemak_little_spike == 1:
if apedemak_little_spike_type == 'percentage':
# Working out where the little line gap
apedemak_little_spike_gap = (apedemak_little_spike_length *
apedemak_little_spike_reduction)
# work out the little line actual length
apedemak_little_spike_actual_length = (apedemak_little_spike_length -
apedemak_little_spike_gap)
if apedemak_little_spike_type == 'consistent':
# Working out where the little line gap
apedemak_little_spike_gap = (apedemak_little_spike_length -
apedemak_little_spike_reduction)
# work out the little line actual length
apedemak_little_spike_actual_length = (apedemak_little_spike_length -
apedemak_little_spike_gap)
osiris.setheading(osirisHeadingStart)
if apedemak_a == 1:
osiris.left(apedemak_bottom_angle)
else:
osiris.right(apedemak_bottom_angle)
osiris.forward(apedemak_little_spike_start)
# Get osiris into position for the actual drawn line)
osiris.setheading(osirisHeadingStart)
if apedemak_a == 1:
osiris.right(90-apedemak_spike_angle)
else:
osiris.left(90-apedemak_spike_angle)
osiris.forward(apedemak_little_spike_gap)
osiris.pendown()
osiris.pensize(apedemak_little_spike_pensize)
osiris.color(apedemak_little_spike_color)
osiris.forward(apedemak_little_spike_actual_length)
osiris.penup()
# The actual length of the outside line
apedemak_spike_outer_length = (apedemak_spike_outer_length-
apedemak_red_distance)
### Start of the slashes
osiris.goto(osirisReturnX, osirisReturnY)
osiris.setheading(osirisHeadingStart)
if apedemak_a == 1:
osiris.left(apedemak_bottom_angle)
else:
osiris.right(apedemak_bottom_angle)
osiris.forward(apedemak_outer_line)
if apedemak_a == 1:
osiris.right(180-apedemak_slash_top_angle)
else:
osiris.left(180-apedemak_slash_top_angle)
osiris.pendown()
osiris.pensize(apedemak_slash_pensize)
osiris.color(apedemak_slash_color)
osiris.forward(apedemak_slash_first_line)
osiris.penup()
for apedemak_t in range(1,adepemak_slash_no):
# The slash gap has to increase on each iteration
apedemak_slash_gap_dymanic = (apedemak_slash_gap *
apedemak_t)
# The length of the slash - for the second line onwards
apedemak_slash_length_2plus = work_cos_sas(apedemak_slash_first_line,
apedemak_slash_gap_dymanic,
apedemak_slash_angle_b)
# The top outer angle - for the second line onwards
apedemak_slash_angle_2plus = work_acos(apedemak_slash_first_line,
apedemak_slash_gap_dymanic,
apedemak_slash_length_2plus)
osiris.goto(osirisReturnX, osirisReturnY)
osiris.setheading(osirisHeadingStart)
if apedemak_a == 1:
osiris.left(apedemak_bottom_angle)
else:
osiris.right(apedemak_bottom_angle)
osiris.forward(apedemak_outer_line)
if apedemak_a == 1:
osiris.right(180-apedemak_slash_top_angle+apedemak_slash_angle_2plus)
else:
osiris.left(180-apedemak_slash_top_angle+apedemak_slash_angle_2plus)
osiris.pendown()
osiris.forward(apedemak_slash_length_2plus)
osiris.penup()
################################################
### Apep = Tiled Square with squares ###
### Serpent that ersonified malevolent chaos ###
################################################
### Developed Using
### (1,200,1,1,1,8,1,'#368BC1','#368B71')
### APEP NO ##########
## 1 = 1 OUTER RING ##
## 2 = 2 OUTER RING ##
## 3 = 3 OUTER RING ##
## ETC ##
######################
def apep(apep_y,apep_size,apep_square_y_n,
apep_stroke,apep_no,apep_quads,
apep_pen_size,apep_fill_color,apep_pen_color):
## THIS IS THE SHAPE WITHIN THE TILE ##
def apep_square():
osiris.pensize(apep_pen_size)
osiris.pencolor(apep_pen_color)
osiris.fillcolor(apep_fill_color)
osiris.penup()
osiris.setheading(90)
osirisCurrentX= osiris.xcor()
osirisCurrentY= osiris.ycor()
## DRAWS OUTER SQUARE IF 1 IN INTEGAR##
if apep_square_y_n == 1:
osiris.goto((osirisCurrentX-(apep_size/2)),
(osirisCurrentY+(apep_size/2)))
for apep_b in range(1,5):
osiris.right(90)
osiris.pendown()
osiris.forward(apep_size)
## GET INTO POSITION FOR THE QUADS
apep_short = ((apep_size / apep_quads)/2)
apep_long = pythag(apep_short,apep_short)
osiris.goto((osirisCurrentX-(apep_size/2)),
(osirisCurrentY+(apep_size/2)))
osiris.setheading(90)
osiris.right(135)
## MOVE TO THE CENTRE OF THE QUAD
osiris.forward(apep_long)
for apep_p in range(apep_quads):
osirisxret = osiris.xcor()
osirisyret = osiris.ycor()
for apep_q in range(apep_quads):
osirisTemporaryX = osiris.xcor()
osirisTemporaryY = osiris.ycor()
osiris_quad_heading = 90
## draw the top left triangles
for apep_r in range(1,5):
osiris.setheading(osiris_quad_heading)
apep_fill = randint(1,2)
if apep_stroke == 1:
osiris.pendow()
if apep_fill == 1:
osiris.begin_fill()
for apep_t in range (1,5):
osiris.forward(apep_short)
osiris.left(90)
if apep_fill == 1:
osiris.end_fill()
osiris.penup()
osiris_quad_heading = osiris_quad_heading + 90
osiris.goto(osirisTemporaryX,osirisTemporaryY)
osiris.setheading(270)
osiris.forward(apep_short *2)
osiris.goto(osirisxret,osirisyret)
osiris.setheading(0)
osiris.forward(apep_short *2)
osiris.setheading(90)
osiris.goto(osirisCurrentX,osirisCurrentY)
############ THIS IS THE TILE EXECUTION ##########################
### DRAW A CENTRAL TILE ###
if apep_y == 1:
osiris.goto(0,0)
apep_square()
### MOVING UP AND DRAW OTHER TILES LIKE A SNAKE ###
for apep_a in range(1,(apep_no+1)): # HOW MANY OUTER RINGS?
for apep_b in range(1,(2+((apep_a-1)*2))): # TOP ROW
if apep_b > 1:
osiris.right(90)
osiris.forward(apep_size)
apep_square()
for apep_c in range(1,(3+((apep_a-1)*2))): # RIGHT COLUMN
if apep_c > 1:
osiris.right(180)
else:
osiris.right(90)
osiris.forward(apep_size)
apep_square()
for apep_d in range(1,(3+((apep_a-1)*2))): # BOTTOM ROW
if apep_d > 1:
osiris.right(270)
else:
osiris.right(180)
osiris.forward(apep_size)
apep_square()
for apep_e in range(1,(4+((apep_a-1)*2))): #LEFT COLUMN
if apep_e > 1:
osiris.right(0)
else:
osiris.right(270)
osiris.forward(apep_size)
apep_square()
############################################
### Aten - Circle with extenuating lines ###
### Disk of the sun ###
############################################
### Developed Using These Integars
### (0,200,1,'#901273','#1FC012')
def aten(aten_y,aten_start,aten_circle_size,aten_gap,
aten_ray_no,aten_ray_span,aten_ray_length,
aten_pensize,aten_ray_pensize,aten_color):
if aten_y == 1:
osiris.penup()
osiris.setheading(osirisHeadingStart)
osiris.forward(aten_start)
osiris.pensize(aten_pensize)
osiris.pencolor(aten_color)
osiris.right(90) # Need to get in position for the circle start
osiris.pendown()
osiris.circle(aten_circle_size,360)
osiris.penup()
osiris.setheading(osirisHeadingStart)
osiris.forward(aten_circle_size) # Move to the circle middle
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
aten_angle_increase = (aten_ray_span/(aten_ray_no-1))
for aten_a in range(1,3):
for aten_b in range(1,(aten_ray_no+1)):
osiris.goto(osirisCurrentX, osirisCurrentY)
osiris.setheading(osirisHeadingStart)
if aten_a == 1:
osiris.right(90)
else:
osiris.left(90)
osiris.forward(aten_gap)
osiris.setheading(osirisHeadingStart)
# We have to go the opposite way here to normal logic
# to give us the correct angle or it's out of position
if aten_a == 1:
osiris.left(270 + ((aten_ray_span/2) -
(aten_angle_increase *
(aten_b-1))))
else:
osiris.right(270 + ((aten_ray_span/2) -
(aten_angle_increase *
(aten_b-1))))
osiris.pendown()
osiris.pensize(aten_ray_pensize)
osiris.forward(aten_ray_length)
osiris.penup()
osiris.goto(osirisCurrentX, osirisCurrentY)
osiris.setheading(osirisHeadingStart)
osiris.forward(aten_circle_size)
####################################
### Bast = Zig Zag Lines ###
### Goddess of protection ###
####################################
### Developed Using These Integars
### (0,16,120,0,4,'#45FF00',
### osirisStartingX,osirisStartingY)
def bast(bast_y,bast_start,bast_angle,
bast_forward,bast_no,bast_pensize,
bast_color,osirisStartingX,osirisStartingY):
if bast_y == 1:
osiris.penup()
osiris.pensize(bast_pensize)
osiris.color(bast_color)
osiris.goto(osirisStartingX,osirisStartingY)
osiris.setheading(osirisHeadingStart)
osiris.forward(bast_start)
osirisTemporaryX = osiris.xcor()
osirisTemporaryY = osiris.ycor()
for bast_a in range(1,3):
osiris.goto(osirisTemporaryX,osirisTemporaryY)
osiris.setheading(osirisHeadingStart)
osiris.pendown()
if bast_a == 1:
osiris.right(bast_angle)
else:
osiris.left(bast_angle)
osiris.forward(bast_forward)
if bast_a == 1:
osiris.left(bast_angle*3)
else:
osiris.right(bast_angle*3)
osiris.forward(bast_forward*1.5)
if bast_a == 1:
osiris.right(bast_angle)
else:
osiris.left(bast_angle)
osiris.forward(bast_forward*2)
# END OF NORMAL BAST ZIG ZAG
# NOW WE WANT TO PUT IN SOME IF CONDITIONS
if bast_no >= 2:
if bast_a == 1:
osiris.right(bast_angle*3)
else:
osiris.left(bast_angle*3)
osiris.forward(bast_forward*3)
if bast_a == 1:
osiris.left(bast_angle)
else:
osiris.right(bast_angle)
osiris.forward(bast_forward*2)
if bast_no >= 3:
if bast_a == 1:
osiris.left(bast_angle*2.5)
else:
osiris.right(bast_angle*2.5)
osiris.forward(bast_forward*3.5)
if bast_a == 1:
osiris.right(bast_angle)
else:
osiris.left(bast_angle)
osiris.forward(bast_forward*4)
osiris.penup()
#############################################
### Bennu = Tiled Square with triangles ###
### Linked with sun, creation and rebirth ###
#############################################
### Developed Using
### (200,1,1,1,8,1,'#368BC1','#368B71')##
### BENNU NO #########
## 1 = 1 OUTER RING ##
## 2 = 2 OUTER RING ##
## 3 = 3 OUTER RING ##
## ETC ##
######################
def bennu(bennu_y,bennu_size,bennu_square_y_n,
bennu_stroke,bennu_no,bennu_quads,
bennu_pen_size,bennu_fill_color,bennu_pen_color):
osiris.goto(0,0)
## THIS IS THE SHAPE WITHIN THE TILE ##
def bennu_square():
osiris.pensize(bennu_pen_size)
osiris.pencolor(bennu_pen_color)
osiris.fillcolor(bennu_fill_color)
osiris.penup()
osiris.setheading(90)
osirisCurrentX = osiris.xcor()
osirisCurrentY = osiris.ycor()
## DRAWS OUTER SQUARE IF 1 IN INTEGAR##
if bennu_square_y_n == 1:
osiris.goto((osirisCurrentX-(bennu_size/2)),
(osirisCurrentY+(bennu_size/2)))
for bennu_b in range(1,5):
osiris.right(90)
osiris.pendown()
osiris.forward(bennu_size)
## GET INTO POSITION FOR THE INNER TRIANGLES
osiris.penup()
bennu_short = ((bennu_size / bennu_quads)/2)
bennu_long = pythag(bennu_short,bennu_short)
osiris.goto ((osirisCurrentX-(bennu_size/2))
,(osirisCurrentY+(bennu_size/2)))
osiris.setheading(90)
osiris.right(135)
## MOVE TO THE CENTRE OF THE QUAD
osiris.forward(bennu_long)
for bennu_p in range(bennu_quads):
osirisxret = osiris.xcor()
osirisyret = osiris.ycor()
for bennu_q in range(bennu_quads):
osirisTemporaryX = osiris.xcor()
osirisTemporaryY = osiris.ycor()
osiris_quad_heading = 90
## draw the top left triangles
for bennu_r in range(1,5):
osiris.setheading(osiris_quad_heading)
for bennu_s in range (1,3):
bennu_fill = randint(1,2)
if bennu_stroke == 1:
osiris.pendown()
if bennu_fill == 1:
osiris.begin_fill()
osiris.forward(bennu_short)
osiris.left(135)
osiris.forward(bennu_long)
osiris.left(135)
osiris.forward(bennu_short)
if bennu_fill == 1:
osiris.end_fill()
osiris.penup()
## get in position for the second triangle
osiris.left(135)
osiris.forward(bennu_long)
osiris.left(135)
osiris_quad_heading = osiris_quad_heading + 90
osiris.goto(osirisTemporaryX,osirisTemporaryY)
osiris.setheading(270)
osiris.forward(bennu_short *2)
osiris.goto(osirisxret,osirisyret)
osiris.setheading(0)
osiris.forward(bennu_short *2)
osiris.setheading(90)
osiris.goto(osirisCurrentX,osirisCurrentY)
############ THIS IS THE TILE EXECUTION ##########################
### DRAW A CENTRAL TILE ###
if bennu_y == 1:
bennu_square()
### MOVING UP AND DRAW OTHER TILES LIKE A SNAKE ###
for bennu_a in range(1,(bennu_no+1)): #HOW MANY OUTER RINGS?
for bennu_b in range(1,(2+((bennu_a-1)*2))): #TOP ROW
if bennu_b > 1:
osiris.right(90)
osiris.forward(bennu_size)
bennu_square()
for bennu_c in range(1,(3+((bennu_a-1)*2))): #RIGHT COLUMN
if bennu_c > 1:
osiris.right(180)
else:
osiris.right(90)
osiris.forward(bennu_size)
bennu_square()
for bennu_d in range(1,(3+((bennu_a-1)*2))): #BOTTOM ROW
if bennu_d > 1:
osiris.right(270)
else:
osiris.right(180)
osiris.forward(bennu_size)
bennu_square()
for bennu_e in range(1,(4+((bennu_a-1)*2))): #LEFT COLUMN
if bennu_e > 1:
osiris.right(0)
else:
osiris.right(270)
osiris.forward(bennu_size)
bennu_square()
#######################################
### Geb = Filled in circle segments ###
### Father of snakes ###
#######################################
### Developed Using
### geb_y=1,geb_no=1,geb_circum_a=20,geb_circum_b=200,
### geb_distance_a=100,geb_distance_b=300,
### geb_circle_reduction_a=10,geb_circle_reduction_b=40,
### geb_pensize=1,geb_pencolor='#FF0000',geb_fillcolor='#FF0000'
def geb(geb_y=1,geb_no=1,geb_circum_a=20,geb_circum_b=200,
geb_distance_a=100,geb_distance_b=300,
geb_circle_reduction_a=5,geb_circle_reduction_b=30,
geb_pensize=1,geb_pencolor='#FF0000',geb_fillcolor='#FF0000'):
if geb_y == 1:
for geb_a in range(1,(geb_no+1)):
osiris.pencolor(geb_pencolor)
osiris.pensize(geb_pensize)
osiris.fillcolor(geb_fillcolor)
osiris.setheading(90)
osiris.goto(0,0)
osiris.right(randint(0,360))
geb_circum_one=(randint(geb_circum_a,geb_circum_b))
geb_distance_one=randint(geb_distance_a,geb_distance_b)
geb_distance_two=(randint(geb_circle_reduction_a,
geb_circle_reduction_b))
geb_distance_three=geb_distance_one + geb_distance_two
osiris.forward(geb_distance_one)
osiris.pendown()
osiris.begin_fill()
osiris.forward(geb_distance_two)
osiris.left(90)
osiris.circle(geb_distance_three,geb_circum_one)
osiris.left(90)
osiris.forward(geb_distance_two)
osiris.left(90)
osiris.circle(-geb_distance_one,geb_circum_one)
osiris.end_fill()
osiris.penup()
####################################
### Hapi = Criss cross lines ###
### God of the nile ###
####################################
### Developed Using
### hapi_y=1,hapi_start=0,hapi_length=300,
### hapi_angle=30,hapi_line_no=10,hapi_section_no=3,
### hapi_space=20,hapi_pensize=5,hapi_color='#FF3333'):
def hapi(hapi_y=1,hapi_start=0,hapi_length=300,
hapi_angle=30,hapi_line_no=10,hapi_section_no=3,
hapi_space=20,hapi_pensize=5,hapi_color='#FF3333'):
if hapi_y == 1:
osiris.penup()
osiris.pensize(hapi_pensize)
osiris.color(hapi_color)