Skip to content

Commit

Permalink
adds logic that keeps airfoil coordinates counterclockwise even with …
Browse files Browse the repository at this point in the history
…scale_x<0
  • Loading branch information
peterdsharpe committed Apr 4, 2024
1 parent 809aea9 commit e0b8931
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion aerosandbox/geometry/airfoil/airfoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,13 +1420,26 @@ def scale(self,
x = self.x() * scale_x
y = self.y() * scale_y

if scale_x < 0:
TE_index = np.argmax(x)
x = np.concatenate([
x[TE_index::-1],
x[-2:TE_index-1:-1]
])
y = np.concatenate([
y[TE_index::-1],
y[-2:TE_index-1:-1]
])

if scale_y < 0:
x = x[::-1]
y = y[::-1]

coordinates = np.stack((x, y), axis=1)

return Airfoil(
name=self.name,
coordinates=np.stack((x, y), axis=1)
coordinates=coordinates,
)

def translate(self,
Expand Down

0 comments on commit e0b8931

Please sign in to comment.