From d668fb1966ff3976d30da770b29706c730d9c259 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Wed, 17 Jul 2024 01:19:17 -0700 Subject: [PATCH] fix: Splitting line for each wing --- nhf/touhou/houjuu_nue/wing.py | 74 ++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/nhf/touhou/houjuu_nue/wing.py b/nhf/touhou/houjuu_nue/wing.py index e21edf2..4834080 100644 --- a/nhf/touhou/houjuu_nue/wing.py +++ b/nhf/touhou/houjuu_nue/wing.py @@ -399,31 +399,14 @@ class WingProfile(Model): return wrist_x, wrist_y - def _mask_elbow(self) -> list[Tuple[float, float]]: """ Polygon shape to mask out parts above the elbow """ - l = 200 - return [ - (0, -l), - (self.elbow_x, -l), - (self.elbow_x, self.elbow_y), - (self.elbow_top_x, self.elbow_top_y), - (self.elbow_top_x, l), - (0, l) - ] - def _mask_wrist(self) -> list[Tuple[float, float]]: - l = 200 - return [ - (0, -l), - (self.wrist_x, -l), - (self.wrist_x, self.wrist_y), - (self.wrist_top_x, self.wrist_top_y), - (self.wrist_top_x, l), - (0, l), - ] + """ + Polygon shape to mask wrist + """ @target(name="profile-s1", kind=TargetKind.DXF) @@ -748,10 +731,10 @@ class WingR(WingProfile): """ elbow_height: float = 111.0 - elbow_x: float = 363.0 - elbow_y: float = 44.0 + elbow_x: float = 285.0 + elbow_y: float = 5.0 # Tilt of elbow w.r.t. shoulder - elbow_angle: float = 30.0 + elbow_angle: float = 25.0 wrist_height: float = 60.0 # Bottom point of the wrist @@ -841,6 +824,29 @@ class WingR(WingProfile): ) return result + def _mask_elbow(self) -> list[Tuple[float, float]]: + l = 200 + return [ + (0, -l), + (self.elbow_x, -l), + (self.elbow_x, self.elbow_y), + (self.elbow_top_x, self.elbow_top_y), + (self.elbow_top_x, l), + (0, l) + ] + + def _mask_wrist(self) -> list[Tuple[float, float]]: + l = 200 + return [ + (0, -l), + (self.wrist_x, -l), + (self.wrist_x, self.wrist_y), + (self.wrist_top_x, self.wrist_top_y), + #(self.wrist_top_x, self.wrist_top_y), + (0, self.wrist_top_y), + ] + + @dataclass(kw_only=True) class WingL(WingProfile): @@ -949,3 +955,25 @@ class WingL(WingProfile): for line in arrow_beziers: result = result.bezier([self.arrow_to_abs(x, y) for x,y in line]) return result.assemble() + + def _mask_elbow(self) -> list[Tuple[float, float]]: + l = 200 + return [ + (0, -l), + (self.elbow_x, -l), + (self.elbow_x, self.elbow_y), + (self.elbow_top_x, self.elbow_top_y), + (self.elbow_top_x, l), + (0, l) + ] + + def _mask_wrist(self) -> list[Tuple[float, float]]: + l = 200 + return [ + (0, -l), + (self.elbow_x, self.wrist_y), + (self.wrist_x, self.wrist_y), + (self.wrist_top_x, self.wrist_top_y), + (self.elbow_x, self.elbow_top_y + 50), + (0, l), + ]