diff --git a/nhf/touhou/houjuu_nue/wing.py b/nhf/touhou/houjuu_nue/wing.py index da83b90..d05eaf5 100644 --- a/nhf/touhou/houjuu_nue/wing.py +++ b/nhf/touhou/houjuu_nue/wing.py @@ -231,6 +231,51 @@ def wing_root(joint: HirthJoint, ) 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 class WingProfile: