diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f6985c..68c6659 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,3 +42,9 @@ + wire angle fix + heading fix + declutter option + +#### 0.9.0-beta3 + ++ wire origin fix ++ aim-off distance option ++ heading fix diff --git a/README.md b/README.md index 38830c1..8e4b938 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ CLI | YES | --releasealt | -ra | SLED's *release* MSL altitude | ft | | | YES | --abortalt | -aa | SLED's *abort* MSL altitude | ft | | | YES | --minalt | -ma | SLED's *mimimum* MSL altitude | ft | | +| YES | --aimdist | -ad | aim-off distance | ft | | | | --filename | -fn | name of the generated `.xml` file | | "sled" | | | --leewayalt | -la | available +/- leeway for the SLED's *base*, *track*, and *release* altitudes | ft | 200ft | | | --leewayhdg | -lh | available +/- leeway for the range's attack heading at the SLED's *base* altitude | ° | 10° | diff --git a/dist/taser.exe b/dist/taser.exe index 5d87920..9fdb8e9 100644 Binary files a/dist/taser.exe and b/dist/taser.exe differ diff --git a/source/args.py b/source/args.py index ccab9a4..392ff60 100644 --- a/source/args.py +++ b/source/args.py @@ -17,6 +17,7 @@ RELEASE_ALT = None ABORT_ALT = None MIN_ALT = None +AIM_DIST = None def parse(): global RANGE @@ -32,6 +33,7 @@ def parse(): global RELEASE_ALT global ABORT_ALT global MIN_ALT + global AIM_DIST parser = argparse.ArgumentParser(description="generate .xml files to visually render SLED attack profiles in the Tacview 3D environment version: 0.6.0-beta1", formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=30)) parser.add_argument("-v", "--version", action="version", version="0.8.0-beta2") @@ -53,6 +55,7 @@ def parse(): required_options.add_argument("-ra", "--releasealt", type=_positive_float, help="release altitude (in feet MSL)", metavar="ft", required=True) required_options.add_argument("-aa", "--abortalt", type=_positive_float, help="abort altitude (in feet MSL)", metavar="ft", required=True) required_options.add_argument("-ma", "--minalt", type=_positive_float, help="minimum altitude (in feet MSL)", metavar="ft", required=True) + required_options.add_argument("-ad", "--aimdist", type=_positive_float, help="aim-off distance (in feet)", metavar="ft", required=True) args = parser.parse_args() @@ -69,6 +72,7 @@ def parse(): RELEASE_ALT = args.releasealt ABORT_ALT = args.abortalt MIN_ALT = args.minalt + AIM_DIST = args.aimdist def check_range(): global RANGE @@ -111,6 +115,7 @@ def convert(): global RELEASE_ALT global ABORT_ALT global MIN_ALT + global AIM_DIST LEEWAY_ALT = calc.ft_to_m(LEEWAY_ALT) if ATTACK_HDG is not None: @@ -121,6 +126,7 @@ def convert(): RELEASE_ALT = calc.ft_to_m(RELEASE_ALT) ABORT_ALT = calc.ft_to_m(ABORT_ALT) MIN_ALT = calc.ft_to_m(MIN_ALT) + AIM_DIST = calc.ft_to_m(AIM_DIST) def _positive_int(value): number = int(value) diff --git a/source/calc.py b/source/calc.py index c0eb089..fcef41a 100644 --- a/source/calc.py +++ b/source/calc.py @@ -7,7 +7,7 @@ def ft_to_m(ft): return ft*0.3048 def thdg_to_mhdg(thdg): - return thdg+19 + return thdg+11 def reverse_heading(hdg): return (hdg+180) % 360 @@ -24,9 +24,9 @@ def sin_cathetus_from_angle(l, a): def cos_cathetus_from_angle(h, a): return h/math.tan(math.radians(a)) -def shift_coords(coords, dist, hdg): - lat = _dms_to_dd(coords["latitude"]) - lon = _dms_to_dd(coords["longitude"]) +def shift_coords(lat, lon, dist, hdg): + lat = _dms_to_dd(lat) + lon = _dms_to_dd(lon) origin = geopy.Point(lat, lon) destination = geopy.distance.VincentyDistance(kilometers=dist/1000).destination(origin, hdg) diff --git a/source/tacview.py b/source/tacview.py index f05f0ae..8a42c79 100644 --- a/source/tacview.py +++ b/source/tacview.py @@ -16,16 +16,17 @@ def generate(): attack_heading = calc.reverse_heading(calc.thdg_to_mhdg(args.TARGET["heading"])) else: attack_heading = calc.reverse_heading(args.ATTACK_HDG) + aimdist_lat, aimdist_lon = calc.shift_coords(args.TARGET["position"]["latitude"], args.TARGET["position"]["longitude"], args.AIM_DIST, -calc.reverse_heading(attack_heading)) wire_length = calc.hypotenuse_from_catheti(args.BASE_DIST, base_altitude) wire_angle = calc.angle_from_catheti(base_altitude, args.BASE_DIST) wire_entry_width = calc.sin_cathetus_from_angle(wire_length, args.LEEWAY_HDG) wire_height = args.LEEWAY_ALT*2 - min_lat, min_lon = calc.shift_coords(args.TARGET["position"], args.BASE_DIST*0.3, -attack_heading) + min_lat, min_lon = calc.shift_coords(aimdist_lat, aimdist_lon, args.BASE_DIST*0.3, -attack_heading) abort_lat, abort_lon = min_lat, min_lon - release_lat, release_lon = calc.shift_coords(args.TARGET["position"], calc.cos_cathetus_from_angle(args.RELEASE_ALT-target_altitude, wire_angle), -attack_heading) - track_lat, track_lon = calc.shift_coords(args.TARGET["position"], calc.cos_cathetus_from_angle(args.TRACK_ALT-target_altitude, wire_angle), -attack_heading) + release_lat, release_lon = calc.shift_coords(aimdist_lat, aimdist_lon, calc.cos_cathetus_from_angle(args.RELEASE_ALT-target_altitude, wire_angle), -attack_heading) + track_lat, track_lon = calc.shift_coords(aimdist_lat, aimdist_lon, calc.cos_cathetus_from_angle(args.TRACK_ALT-target_altitude, wire_angle), -attack_heading) if args.DECLUTTER: min_altitude = args.MIN_ALT @@ -55,8 +56,8 @@ def generate(): release_height = args.LEEWAY_ALT*2 track_height = args.LEEWAY_ALT*2 - template[0]["Position"]["Latitude"] = args.TARGET["position"]["latitude"] - template[0]["Position"]["Longitude"] = args.TARGET["position"]["longitude"] + template[0]["Position"]["Latitude"] = aimdist_lat + template[0]["Position"]["Longitude"] = aimdist_lon template[0]["Position"]["Altitude"] = target_altitude template[0]["Orientation"]["Pitch"] = wire_angle template[0]["Orientation"]["Yaw"] = attack_heading