diff --git a/main.py b/main.py index 65ee6d7..16e1490 100644 --- a/main.py +++ b/main.py @@ -138,15 +138,28 @@ for coordinate in circle[0]: # --- -y = 150 +# y = 150 -r1 = Road.Road((-1337, y, 472), "None") -r2 = Road.Road((-1269, y, 574), "None") -r3 = Road.Road((-1392, y, 527), "None") +# r1 = Road.Road((-1337, y, 472), "None") +# r2 = Road.Road((-1269, y, 574), "None") +# r3 = Road.Road((-1392, y, 527), "None") + +# i = Intersection.Intersection( +# (-1327, y, 533), [(-1335, y, 494), (-1298, y, 553), (-1366, y, 530)], [r1, r2, r3]) + + +# --- + +y = 100 + +r1 = Road.Road((-1380, 75, 406), "None") +r2 = Road.Road((-1365, 75, 468), "None") +r3 = Road.Road((-1411, 75, 501), "None") +r4 = Road.Road((-1451, 75, 449), "None") +r5 = Road.Road((-1432, 75, 423), "None") i = Intersection.Intersection( - (-1327, y, 533), [(-1335, y, 494), (-1298, y, 553), (-1366, y, 530)], [r1, r2, r3]) - + (-1411, 75, 461), [(-1392, 75, 427), (-1385, 75, 465), (-1411, 75, 487), (-1435, 75, 454), (-1426, 75, 435)], [r1, r2, r3, r4, r5]) i.compute_curved_corner() @@ -181,4 +194,4 @@ for k in range(len(i.intersections_curved)): if coordinate != None: if k >= 0: editor.placeBlock( - (coordinate[0], y, coordinate[1]), Block("cyan_concrete")) + (coordinate[0], 75, coordinate[1]), Block("cyan_concrete")) diff --git a/networks/geometry/point_tools.py b/networks/geometry/point_tools.py index 31ef5e5..fa5942c 100644 --- a/networks/geometry/point_tools.py +++ b/networks/geometry/point_tools.py @@ -410,7 +410,4 @@ def curved_corner_intersection( # Be sure that all the points are in correct order. curve_corner_points = optimized_path( curved_corner_points_temporary, start_curve_point) - print("Output:") - print(curve_corner_points) - print("\n") return curve_corner_points, center, radius diff --git a/networks/roads/intersections/Intersection.py b/networks/roads/intersections/Intersection.py index dcf9446..1e80418 100644 --- a/networks/roads/intersections/Intersection.py +++ b/networks/roads/intersections/Intersection.py @@ -28,18 +28,10 @@ class Intersection: self.intersections.append(segments_intersection( self.parallel_delimitations[j][1], self.parallel_delimitations[(j+1) % len(self.Roads)][0], full_line=False)) - test = tuple(self.parallel_delimitations[( + next_parallel = tuple(self.parallel_delimitations[( j+1) % len(self.Roads)][0][0]), tuple(self.parallel_delimitations[(j+1) % len(self.Roads)][0][1]) - test0 = tuple(self.parallel_delimitations[j][1][0]), tuple( + current_parallel = tuple(self.parallel_delimitations[j][1][0]), tuple( self.parallel_delimitations[j][1][1]) - print("\n\n\n --- \n\n\n") - print(self.parallel_delimitations) - print(self.parallel_delimitations[( - j+1) % len(self.Roads)][0]) - print(self.parallel_delimitations[j][1]) - self.intersections_curved.append(curved_corner_intersection( - ((test0[0][0], test0[0][-1]), (test0[1][0], test0[1][-1])), ((test[0][0], test[0][-1]), (test[1][0], test[1][-1])), 10, angle_adaptation=False, output_only_points=False)) - - print("\n", test0, test) + ((current_parallel[0][0], current_parallel[0][-1]), (current_parallel[1][0], current_parallel[1][-1])), ((next_parallel[0][0], next_parallel[0][-1]), (next_parallel[1][0], next_parallel[1][-1])), 10, angle_adaptation=True, output_only_points=False))