From 1a8e7396ff3d30853a8ee921d31ac32d46551792 Mon Sep 17 00:00:00 2001 From: GabrielBarberini Date: Wed, 2 Oct 2024 15:17:01 -0300 Subject: [PATCH] adjusts airfoil signature accordingly --- lib/models/aerosurfaces.py | 9 +++++++-- lib/models/rocket.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/models/aerosurfaces.py b/lib/models/aerosurfaces.py index a097083..069909e 100644 --- a/lib/models/aerosurfaces.py +++ b/lib/models/aerosurfaces.py @@ -1,5 +1,5 @@ from enum import Enum -from typing import Optional, Tuple +from typing import Optional, Tuple, List from pydantic import BaseModel @@ -24,6 +24,11 @@ class FinsKinds(str, Enum): ELLIPTICAL: str = "ELLIPTICAL" +class AngleUnit(str, Enum): + RADIANS: str = "RADIANS" + DEGREES: str = "DEGREES" + + class Fins(BaseModel): fins_kind: FinsKinds name: str @@ -34,7 +39,7 @@ class Fins(BaseModel): position: float cant_angle: float radius: float - airfoil: Tuple[float, float] + airfoil: Tuple[List[Tuple[float, float]], AngleUnit] # TODO: implement airbrakes diff --git a/lib/models/rocket.py b/lib/models/rocket.py index 4344930..1ebc3a0 100644 --- a/lib/models/rocket.py +++ b/lib/models/rocket.py @@ -71,7 +71,7 @@ class Rocket(BaseModel): position=-1.04956, cant_angle=0, radius=0.0635, - airfoil=(0.0, 0.0), + airfoil=([(0.0, 0.0), (0.1, 0.1), (0.2, 0.2)], "RADIANS"), ) ] tail: Optional[Tail] = Tail(