import sys import matplotlib matplotlib.use('QtAgg') import matplotlib.pyplot as plt from shapely import Polygon from shapely.plotting import plot_polygon def geo_current(full_plot:bool=False): A_crosswalk=Polygon([ (-1,1.499), (-1,3.327), (0,3.327), (11.214, 3.327), (11.214,1.499), (0,1.499) ]) B_queue=Polygon([ (11.214, 0), (22.163, 0), (22.163, 4.826), (11.214, 4.826) ]) C_road_adj_path=Polygon([ (21.787,4.826), (24.214,4.826), (24.214,40.431), (29.179,40.431), (29.179,42.511), (24.214,42.511), (21.787,42.511) ]) D_path_k_3=Polygon([ (26.45,42.511), (26.45,52.84), (26.45,53.84), (29.179,53.84), (29.179,52.84), (29.179,42.511) ]) E_path_4_6=Polygon([ (29.179,42.511), (54.351,42.511), (60.406,48.842), (60.406,51.22), (60.406,52.22), (63.49,52.22), (63.49,51.22), (63.49,47.866), (56.381,40.431), (29.179,40.431) ]) F_path_7_12=Polygon([ (22.163, 0), (39.227, 5.516), (39.631, 4.267), (39.939,3.315), (45.099,4.983), (44.792,5.935), (43.169,10.954), (24.214,4.826), (22.163,4.826) ]) G_extended_queue=Polygon([ (11.214,0), (12.924,0), (12.924,-4.569), (11.214,-4.569) ]) H_angled_path=Polygon([ (21.787,13.192), (21.787,10.527), (17,4.826), (14.767,4.826) ]) enter_k_3=Polygon([ (26.45,52.84), (29.179,52.84), (29.179,53.84), (26.45,53.84) ]) enter_4_6=Polygon([ (60.406,51.22), (60.406,52.22), (63.49,52.22), (63.49,51.22) ]) enter_7_12=Polygon([ (39.631, 4.267), (39.939,3.315), (45.099,4.983), (44.792,5.935) ]) exit_polygon=Polygon([ (0,1.499), (0,3.327), (-1,3.327), (-1,1.499) ]) geometry = ( A_crosswalk.union( B_queue).union( C_road_adj_path).union( D_path_k_3).union( E_path_4_6).union( F_path_7_12).union( G_extended_queue).union( H_angled_path) ) doors = [ enter_k_3, enter_4_6, enter_7_12, exit_polygon ] if full_plot is False: plot_polygon(A_crosswalk,color="black",add_points=False) plot_polygon(B_queue,color="black",add_points=False) plot_polygon(C_road_adj_path, color="blue",add_points=False) plot_polygon(D_path_k_3, color="blue",add_points=False) plot_polygon(E_path_4_6, color="blue",add_points=False) plot_polygon(F_path_7_12, color="blue",add_points=False) plot_polygon(G_extended_queue, color="black",add_points=False) plot_polygon(H_angled_path, color="black",add_points=False) plot_polygon(enter_k_3, color="darkgreen",add_points=False) plot_polygon(enter_4_6, color="darkgreen",add_points=False) plot_polygon(enter_7_12, color="darkgreen",add_points=False) plot_polygon(exit_polygon, color="orangered",add_points=False) else: plot_polygon(geometry,color="blue",add_points=False) plot_polygon(enter_k_3,color="red",add_points=False) plot_polygon(enter_4_6,color="red",add_points=False) plot_polygon(enter_7_12,color="red",add_points=False) return geometry, doors if __name__ == "__main__": from PyQt6 import QtWidgets app = QtWidgets.QApplication(sys.argv) geometry,doors = geo_current(True) plt.show(block=False) sys.exit(app.exec())