From 5c610d6609f306198d72cff10f11ed7c10264241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 28 Nov 2019 19:55:27 +0200 Subject: [PATCH] more drawing --- Karto/assignment4/KTZ004_2019_04_ats.py | 2 +- Karto/assignment4/draw.py | 20 ++++++-------------- Karto/assignment4/measure.py | 10 ++++++++++ Karto/lesson6/lesson6.dwg | Bin 51642 -> 51944 bytes 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 index f54d1a1..94f123b 100755 --- 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 index 27b3c52..bc974cb 100755 --- 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 index c306f78..99fd85b 100755 --- 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 index b802d11ba46858daf62a56ead96bd92e2fa0e9ba..c1f27f574dff902c68b28d790954265713114bae 100644 GIT binary patch delta 2790 zcmb_eiCa_07N5EIW`QJ_lt7cPh6#*R=$=v5pxFtKC~&j+9=508GG2VNERtUzDriU4R`c z$KWsqJ1W$W10R=R&=b3{OAVWT1F+{8CERigzz3%x9KK4YVB?tksxii%%XAgy!>l<3 zv4>4`2Ua1{5x5I%1aN95zyje^7?=g*8YZ|ym*f7-p_`C#vYPI|V}&>BFnFp;4Siu# z6$XP~5cf?dJ)4-~w+x3QB?JIJwE=KWbALa8;r7t}wFTfbac>@r$E{R7fYrhss>9k^ z0OuNa;FO+03f%trLNQ zPP7?E9~Ih~;)SkwdevM645DYjA1FsL-=e_RF^jW2VXfW(AYcOkFt7%A#6SxT1WW)d z5PAfX5@=^3Vj?m~H!?9cV&Hm=6bS+2&~N&Llx6z$x=-f`43S6ylE{2421Xk|xgEoZ zjY?LNk|;20x_a%p-jKErv)CYq6tYhf(vQl#KMx73c2 z>BJgL$DzAKsbYn}dP+F>*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