commit 5c610d6609f306198d72cff10f11ed7c10264241 (tree)
parent 3f18644fb75b5a8a2128c997c5c3f4c17b10cd09
Author: Motiejus Jakštys <desired.mta@gmail.com>
Date: Thu, 28 Nov 2019 19:55:27 +0200
more drawing
Diffstat:
4 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/Karto/assignment4/KTZ004_2019_04_ats.py b/Karto/assignment4/KTZ004_2019_04_ats.py
@@ -17,7 +17,7 @@ print("""=== Apskaiciuoti liniju stiliu kurimo parametrai (0.001 tikslumu) ===
Plotis L1 (duotas)
%.3f""" % L1 + """
Visas kelio A-03 plotis
-*******
+%.3f""" % L1 + """
Koeficientas L1 plocio atidejimui (+/-0.001)
*******
=== Kelias A-05 ===
diff --git a/Karto/assignment4/draw.py b/Karto/assignment4/draw.py
@@ -1,24 +1,16 @@
#!/usr/bin/env python3
import matplotlib.pyplot as plt
from shapely.geometry import LineString
-from math import sqrt
-def heptagon(linelen, slant):
- inner_angle = 180*5/7
- pts = [(0, 0)]
- dx = linelen * sin(
- for _ in range(7):
-
-def plot_line(ax, ob):
- x, y = ob.xy
- ax.plot(x, y, color='#6699cc', alpha=0.7, linewidth=3, solid_capstyle='round', zorder=2)
+from measure import *
fig, ax = plt.subplots()
-line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
-#plot_coords(ax, line)
-#plot_bounds(ax, line)
-plot_line(ax, line)
+KA03_l = LineString([Points[i].xy for i in [11,12,13,14,15,16,17,18] ])
+KA03_offset = KA03_l.parallel_offset(KA03_plotis, 'right', join_style=2)
+
+ax.plot(*(KA03_l.xy), linewidth=1)
+ax.plot(*(KA03_offset.xy), linewidth=1, dashes=[5,5])
ax.set_title('Užliejamų plotų brėžinys')
diff --git a/Karto/assignment4/measure.py b/Karto/assignment4/measure.py
@@ -34,6 +34,11 @@ class Vertex:
self.dirang = dirang
self.coords = coords
+ @property
+ def xy(self):
+ """xy returns a tuple of lksx and lksy coordinates"""
+ return (self.coords.lksx, self.coords.lksy)
+
A = Dec('6.094')
B = Dec('-2.923')
C = Dec('-13.462')
@@ -125,6 +130,11 @@ K1 = Dec('13.147') + B
# Atstumas iki tikrosios uzliejimo zonos (A1) (0.001 tikslumu)
A1 = Dec('67.536') + B
+# Points is vertice map by id
+Points = {}
+for v in vertices:
+ Points[v.point] = v
+
if __name__ == '__main__':
print("angle sum %.4f, theoretical angle sum %d" % \
(angle_sum, theoretical_angle_sum))
diff --git a/Karto/lesson6/lesson6.dwg b/Karto/lesson6/lesson6.dwg
Binary files differ.