feat: Wing root class

This commit is contained in:
Leni Aniva 2024-07-14 00:47:44 -07:00
parent a0ae8c91eb
commit 1bcb27c711
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 45 additions and 0 deletions

View File

@ -231,6 +231,51 @@ def wing_root(joint: HirthJoint,
) )
return result return result
@dataclass
class WingRoot:
"""
Generator for the wing root profile and model
"""
panel_thickness: float = 25.4 / 16
height: float = 100.0
shoulder_width: float = 20.0
root_width: float = 60.0
def outer_spline(self) -> list[Tuple[float, float]]:
"""
Generate outer wing shape spline
"""
def profile(self) -> Cq.Sketch:
tip_x, tip_y = -100.0, 70.0
sketch = (
Cq.Sketch()
.segment((-self.root_width, 0), (0, 0))
.spline([
(0, 0),
(-30.0, 50.0),
(tip_x, tip_y)
])
.segment(
(tip_x, tip_y),
(tip_x, tip_y - self.shoulder_width)
)
.segment(
(tip_x, tip_y - self.shoulder_width),
(-self.root_width, 0)
)
.assemble()
)
return sketch
def xy_surface(self) -> Cq.Workplane:
return (
Cq.Workplane()
.placeSketch(self.profile())
.extrude(self.panel_thickness)
)
@dataclass @dataclass
class WingProfile: class WingProfile: