@@ -611,6 +611,29 @@ def buildGUI(self, root): # Called in the __init__ to build the GUI window
611
611
self .start = canvas .create_oval (195 , 195 + scale * radius , 205 , 205 + scale * radius , fill = "green" , width = 1 )
612
612
self .goal = canvas .create_oval (goalLBorder , goalTopBorder , goalRBorder , goalBottomBorder , fill = "red" , width = 1 )
613
613
614
+
615
+ # calculation of angular cooridor, updates to user input and renders blue lines on user interface
616
+ # to represent outer bounds of cooridor
617
+ rightCorridorSideAngle = math .radians (float (corridorWidthStringVar .get ())/ 2 + math .degrees (math .atan ((float (goalX ))/ (float (goalY ) + radius ))))
618
+ rightCorridorLeftDiameterChordSection = radius + radius * math .tan (rightCorridorSideAngle )
619
+ rightCorridorRightDiameterChordSection = radius - radius * math .tan (rightCorridorSideAngle )
620
+ rightCorridorBottomChordSection = radius / math .cos (rightCorridorSideAngle )
621
+ rightCorridorTopChordSection = (rightCorridorLeftDiameterChordSection * rightCorridorRightDiameterChordSection )/ rightCorridorBottomChordSection
622
+ rightCorridorOnCircleX = radius * math .tan (rightCorridorSideAngle ) + rightCorridorTopChordSection * math .sin (rightCorridorSideAngle )
623
+ rightCorridorOnCircleY = rightCorridorTopChordSection * math .cos (rightCorridorSideAngle )
624
+ self .rightAngularCooridorLine = canvas .create_line (200 , 200 + scale * radius , 200 + scale * (rightCorridorOnCircleX ), 200 - (scale * rightCorridorOnCircleY ), fill = "blue" , width = 2 )
625
+
626
+ leftCorridorSideAngle = rightCorridorSideAngle - math .radians (float (corridorWidthStringVar .get ()))
627
+ leftCorridorLeftDiameterChordSection = radius + radius * math .tan (leftCorridorSideAngle )
628
+ leftCorridorRightDiameterChordSection = radius - radius * math .tan (leftCorridorSideAngle )
629
+ leftCorridorBottomChordSection = radius / math .cos (leftCorridorSideAngle )
630
+ leftCorridorTopChordSection = (leftCorridorLeftDiameterChordSection * leftCorridorRightDiameterChordSection )/ leftCorridorBottomChordSection
631
+ leftCorridorOnCircleX = radius * math .tan (leftCorridorSideAngle ) + leftCorridorTopChordSection * math .sin (leftCorridorSideAngle )
632
+ leftCorridorOnCircleY = leftCorridorTopChordSection * math .cos (leftCorridorSideAngle )
633
+ self .leftAngularCooridorLine = canvas .create_line (200 , 200 + scale * radius , 200 + scale * (leftCorridorOnCircleX ), 200 - (scale * leftCorridorOnCircleY ),fill = "blue" , width = 2 )
634
+
635
+
636
+
614
637
# draw all rois
615
638
for aTuple in rois :
616
639
roiX , roiY = aTuple [0 ].split ("," )
@@ -688,6 +711,30 @@ def redraw(*args):
688
711
self .start = canvas .create_oval (195 , 195 + scale * radius , 205 , 205 + scale * radius , fill = "green" , width = 1 )
689
712
self .goal = canvas .create_oval (goalLBorder , goalTopBorder , goalRBorder , goalBottomBorder , fill = "red" , width = 1 )
690
713
714
+
715
+ # calculation of angular cooridor, updates to user input and renders blue lines on user interface
716
+ # to represent outer bounds of cooridor
717
+ rightCorridorSideAngle = math .radians (float (corridorWidthStringVar .get ())/ 2 + math .degrees (math .atan ((float (goalX ))/ (float (goalY ) + radius ))))
718
+ rightCorridorLeftDiameterChordSection = radius + radius * math .tan (rightCorridorSideAngle )
719
+ rightCorridorRightDiameterChordSection = radius - radius * math .tan (rightCorridorSideAngle )
720
+ rightCorridorBottomChordSection = radius / math .cos (rightCorridorSideAngle )
721
+ rightCorridorTopChordSection = (rightCorridorLeftDiameterChordSection * rightCorridorRightDiameterChordSection )/ rightCorridorBottomChordSection
722
+ rightCorridorOnCircleX = radius * math .tan (rightCorridorSideAngle ) + rightCorridorTopChordSection * math .sin (rightCorridorSideAngle )
723
+ rightCorridorOnCircleY = rightCorridorTopChordSection * math .cos (rightCorridorSideAngle )
724
+ self .rightAngularCooridorLine = canvas .create_line (200 , 200 + scale * radius , 200 + scale * (rightCorridorOnCircleX ), 200 - (scale * rightCorridorOnCircleY ), fill = "blue" , width = 2 )
725
+
726
+
727
+ leftCorridorSideAngle = rightCorridorSideAngle - math .radians (float (corridorWidthStringVar .get ()))
728
+ leftCorridorLeftDiameterChordSection = radius + radius * math .tan (leftCorridorSideAngle )
729
+ leftCorridorRightDiameterChordSection = radius - radius * math .tan (leftCorridorSideAngle )
730
+ leftCorridorBottomChordSection = radius / math .cos (leftCorridorSideAngle )
731
+ leftCorridorTopChordSection = (leftCorridorLeftDiameterChordSection * leftCorridorRightDiameterChordSection )/ leftCorridorBottomChordSection
732
+ leftCorridorOnCircleX = radius * math .tan (leftCorridorSideAngle ) + leftCorridorTopChordSection * math .sin (leftCorridorSideAngle )
733
+ leftCorridorOnCircleY = leftCorridorTopChordSection * math .cos (leftCorridorSideAngle )
734
+ self .leftAngularCooridorLine = canvas .create_line (200 , 200 + scale * radius , 200 + scale * (leftCorridorOnCircleX ), 200 - (scale * leftCorridorOnCircleY ), fill = "blue" , width = 2 )
735
+
736
+
737
+
691
738
# draw all rois
692
739
for aTuple in rois :
693
740
roiX , roiY = aTuple [0 ].split ("," )
0 commit comments