Fix breaking height partially

This commit is contained in:
2024-06-16 00:24:39 +02:00
parent ce6e214015
commit 53160c6c8b
4 changed files with 8 additions and 3 deletions

View File

@@ -450,7 +450,10 @@ image.save('output_image.png')
# road = Road([Point3D(-454, 130, 1046), Point3D(-497, 127, 1070), # road = Road([Point3D(-454, 130, 1046), Point3D(-497, 127, 1070),
# Point3D(-545, 85, 1019), Point3D(-545, 85, 970), Point3D(-457, 87, 865)], 9) # Point3D(-545, 85, 1019), Point3D(-545, 85, 970), Point3D(-457, 87, 865)], 9)
# road.place() road = Road(Point3D.insert_3d(random_points, 'y', [random.randint(
200, 250) for _ in range(n_points)]), 15)
road.place()
# s = Segment2D(Point2D(-88, -12), Point2D(9, 75)) # s = Segment2D(Point2D(-88, -12), Point2D(9, 75))
# s.segment_thick(3, LINE_THICKNESS_MODE.MIDDLE) # s.segment_thick(3, LINE_THICKNESS_MODE.MIDDLE)

View File

@@ -69,6 +69,9 @@ class Polyline:
self.total_line_output.extend( self.total_line_output.extend(
self.segments[self.length_polyline-1].segment()) self.segments[self.length_polyline-1].segment())
self.total_line_output = self.total_line_output[0].optimized_path(
self.total_line_output)
def __repr__(self): def __repr__(self):
return str(self.alpha_radii) return str(self.alpha_radii)

View File

@@ -27,10 +27,9 @@ class Road:
self._projection() self._projection()
self._surface() self._surface()
print(self.polyline_total_line_output)
def _surface(self): def _surface(self):
# Segments # Segments
for i in range(1, len(self.polyline.segments)): for i in range(1, len(self.polyline.segments)):
if len(self.polyline.segments[i].segment()) > 1: if len(self.polyline.segments[i].segment()) > 1:
for j in range(len(self.polyline.segments[i].segment_thick(self.width, LINE_THICKNESS_MODE.MIDDLE))): for j in range(len(self.polyline.segments[i].segment_thick(self.width, LINE_THICKNESS_MODE.MIDDLE))):

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB