more drawing

This commit is contained in:
Motiejus Jakštys 2019-11-28 19:55:27 +02:00
parent 3f18644fb7
commit 5c610d6609
4 changed files with 17 additions and 15 deletions

View File

@ -17,7 +17,7 @@ print("""=== Apskaiciuoti liniju stiliu kurimo parametrai (0.001 tikslumu) ===
Plotis L1 (duotas) Plotis L1 (duotas)
%.3f""" % L1 + """ %.3f""" % L1 + """
Visas kelio A-03 plotis Visas kelio A-03 plotis
******* %.3f""" % L1 + """
Koeficientas L1 plocio atidejimui (+/-0.001) Koeficientas L1 plocio atidejimui (+/-0.001)
******* *******
=== Kelias A-05 === === Kelias A-05 ===

View File

@ -1,24 +1,16 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from shapely.geometry import LineString from shapely.geometry import LineString
from math import sqrt
def heptagon(linelen, slant): from measure import *
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)
fig, ax = plt.subplots() fig, ax = plt.subplots()
line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
#plot_coords(ax, line) KA03_l = LineString([Points[i].xy for i in [11,12,13,14,15,16,17,18] ])
#plot_bounds(ax, line) KA03_offset = KA03_l.parallel_offset(KA03_plotis, 'right', join_style=2)
plot_line(ax, line)
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') ax.set_title('Užliejamų plotų brėžinys')

View File

@ -34,6 +34,11 @@ class Vertex:
self.dirang = dirang self.dirang = dirang
self.coords = coords 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') A = Dec('6.094')
B = Dec('-2.923') B = Dec('-2.923')
C = Dec('-13.462') C = Dec('-13.462')
@ -125,6 +130,11 @@ K1 = Dec('13.147') + B
# Atstumas iki tikrosios uzliejimo zonos (A1) (0.001 tikslumu) # Atstumas iki tikrosios uzliejimo zonos (A1) (0.001 tikslumu)
A1 = Dec('67.536') + B A1 = Dec('67.536') + B
# Points is vertice map by id
Points = {}
for v in vertices:
Points[v.point] = v
if __name__ == '__main__': if __name__ == '__main__':
print("angle sum %.4f, theoretical angle sum %d" % \ print("angle sum %.4f, theoretical angle sum %d" % \
(angle_sum, theoretical_angle_sum)) (angle_sum, theoretical_angle_sum))

Binary file not shown.