Skip to content

Fixed the bug of setting the iflo direction #1629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions flo2d/gui/fpxsec_editor_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,21 +530,23 @@ def get_iflo_direction(self, azimuth):
if azimuth < 0:
azimuth += 360

if 337.5 <= azimuth or azimuth < 22.5:
perp_azimuth = (azimuth + 90) % 360

if 337.5 <= perp_azimuth or perp_azimuth < 22.5:
return [1, 3]
elif 22.5 <= azimuth < 67.5:
elif 22.5 <= perp_azimuth < 67.5:
return [5, 7]
elif 67.5 <= azimuth < 112.5:
elif 67.5 <= perp_azimuth < 112.5:
return [2, 4]
elif 112.5 <= azimuth < 157.5:
elif 112.5 <= perp_azimuth < 157.5:
return [6, 8]
elif 157.5 <= azimuth < 202.5:
elif 157.5 <= perp_azimuth < 202.5:
return [3, 1]
elif 202.5 <= azimuth < 247.5:
elif 202.5 <= perp_azimuth < 247.5:
return [7, 5]
elif 247.5 <= azimuth < 292.5:
elif 247.5 <= perp_azimuth < 292.5:
return [4, 2]
elif 292.5 <= azimuth < 337.5:
elif 292.5 <= perp_azimuth < 337.5:
return [8, 6]