Skip to content

Commit

Permalink
Update ecl.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sergej-singer committed Jan 6, 2025
1 parent 299e7b9 commit 4224c52
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions mapbuilder/utils/ecl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from mapbuilder.utils.geo import Brg, Fix, back_bearing

from mapbuilder.utils.geo import Brg, Fix, back_bearing

def extrapolate_rwy(rwy_info, count: int, dist: float = 1) -> list[Fix]:
"""Extrapolates count points from the runway threshold, each spaced dist nautical miles apart
Expand Down Expand Up @@ -33,16 +33,21 @@ def draw_loc_tick(rwy_info, gap: float, length: float):
return str(Fix(rwy_info["loc"]).move_to(gap, brg).line_to(length, brg))


def draw_marker_ticks(rwy_info, at: list, gap: float, length: float):
def draw_marker_ticks(rwy_info, at: list, gap: float, length: float, symmetry: str = "B"):
lines = []
brg = Brg(rwy_info["bearing"]).invert()
tick_brg = brg + 90
for dist in at:
base = Fix(rwy_info["thr"]).move_to(dist, brg)

lines.extend((
str(base.move_to(gap, tick_brg).line_to(length, tick_brg)),
str(base.move_to(-gap, tick_brg).line_to(-length, tick_brg)),
))
if symmetry == "B":
lines.extend((str(base.move_to(gap, tick_brg).line_to(length, tick_brg)),
str(base.move_to(-gap, tick_brg).line_to(-length, tick_brg))))
elif symmetry == "L":
lines.append(str(base.move_to(gap, tick_brg).line_to(length, tick_brg)))
elif symmetry == "R":
lines.append(str(base.move_to(-gap, tick_brg).line_to(-length, tick_brg)))
else:
raise ValueError(f"Unknown argument {symmetry}")

return "\n".join(lines)

0 comments on commit 4224c52

Please sign in to comment.